ACPI / IPMI: Fix potential response buffer overflow
authorLv Zheng <lv.zheng@intel.com>
Fri, 13 Sep 2013 05:13:30 +0000 (13:13 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 Sep 2013 17:46:11 +0000 (19:46 +0200)
commit6b68f03f95e3f0aeea0c47799aecb296276a7cd6
treebdb6018d8a6f2a9661c1a2fa0351fe0491b33d27
parent15c03dd4859ab16f9212238f29dd315654aa94f6
ACPI / IPMI: Fix potential response buffer overflow

This patch enhances sanity checks on message size to avoid potential buffer
overflow.

The kernel IPMI message size is IPMI_MAX_MSG_LENGTH(272 bytes) while the
ACPI specification defined IPMI message size is 64 bytes.  The difference
is not handled by the original codes.  This may cause crash in the response
handling codes.

This patch closes this gap and also combines rx_data/tx_data to use single
data/len pair since they need not be seperate.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_ipmi.c