mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 10:12:16 +09:00
SCSI: megaraid: missing bounds check in mimd_to_kioc()
commit 3de2260140 upstream.
pthru32->dataxferlen comes from the user so we need to check that it's
not too large so we don't overflow the buffer.
Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e623c2cdb5
commit
8d6b283d97
@@ -486,6 +486,8 @@ mimd_to_kioc(mimd_t __user *umimd, mraid_mmadp_t *adp, uioc_t *kioc)
|
||||
|
||||
pthru32->dataxferaddr = kioc->buf_paddr;
|
||||
if (kioc->data_dir & UIOC_WR) {
|
||||
if (pthru32->dataxferlen > kioc->xferlen)
|
||||
return -EINVAL;
|
||||
if (copy_from_user(kioc->buf_vaddr, kioc->user_data,
|
||||
pthru32->dataxferlen)) {
|
||||
return (-EFAULT);
|
||||
|
||||
Reference in New Issue
Block a user