summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-02-25 19:20:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-21 09:04:52 +0200
commit4542e583e2b82e573b94e4afcc5ca3c04288aae1 (patch)
tree31da31bbe9917a893b575f94bc6c69919ef0779f /arch
parent5815a5d70def3f785d847e77acb48efe90b6a23c (diff)
acpi/nfit: improve bounds checking for 'func'
commit 01091c496f920e634ea84b689f480c39016752a8 upstream. The 'func' variable can come from the user in the __nd_ioctl(). If it's too high then the (1 << func) shift in acpi_nfit_clear_to_send() is undefined. In acpi_nfit_ctl() we pass 'func' to test_bit(func, &dsm_mask) which could result in an out of bounds access. To fix these issues, I introduced the NVDIMM_CMD_MAX (31) define and updated nfit_dsm_revid() to use that define as well instead of magic numbers. Fixes: 11189c1089da ("acpi/nfit: Fix command-supported detection") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Link: https://lore.kernel.org/r/20200225161927.hvftuq7kjn547fyj@kili.mountain Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions