-
由 Dan Carpenter 提交于
fix #29902604 commit f84afbdd3a9e5e10633695677b95422572f920dc upstream The "cmd" comes from the user and it can be up to 255. It it's more than the number of bits in long, it results out of bounds read when we check test_bit(cmd, &cmd_mask). The highest valid value for "cmd" is ND_CMD_CALL (10) so I added a compare against that. Fixes: 62232e45 ("libnvdimm: control (ioctl) messages for nvdimm_bus and nvdimm devices") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Reviewed-by: NArtie Ding <artie.ding@linux.alibaba.com>
6d91d578