public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Buffer overflow in the mptctl_replace_fw() function in linux kernel MPT ioctl driver
@ 2017-09-01  6:00 Dison River
  2017-09-01  6:44 ` Kees Cook
  2017-09-01  8:24 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dison River @ 2017-09-01  6:00 UTC (permalink / raw)
  To: sathya.prakash, chaitra.basappa, suganath-prabu.subramani,
	MPT-FusionLinux.pdl, linux-scsi, linux-kernel, security

Hi:
Buffer overflow in the mptctl_replace_fw() function in linux kernel
MPT ioctl driver.

In mptctl_replace_fw function, kernel didn't check the size of
"newFwSize" variable allows attackers to cause a denial of service via
unspecified vectors that trigger copy_from_user function calls with
improper length arguments.


static int
mptctl_replace_fw (unsigned long arg)
{
......
    if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) {
        printk(KERN_ERR MYNAM "%s@%d::mptctl_replace_fw - "
            "Unable to read in mpt_ioctl_replace_fw struct @ %p\n",
                __FILE__, __LINE__, uarg);
        return -EFAULT;
    }

......

    mpt_free_fw_memory(ioc);

    /* Allocate memory for the new FW image
     */
    newFwSize = ALIGN(karg.newImageSize, 4);

    mpt_alloc_fw_memory(ioc, newFwSize);
......

    if (copy_from_user(ioc->cached_fw, uarg->newImage, newFwSize)) {
///------->newFwSize can control in userspace
        printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_replace_fw - "
                "Unable to read in mpt_ioctl_replace_fw image "
                "@ %p\n", ioc->name, __FILE__, __LINE__, uarg);
        mpt_free_fw_memory(ioc);
        return -EFAULT;
    }

......

    return 0;
}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-01  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-01  6:00 Buffer overflow in the mptctl_replace_fw() function in linux kernel MPT ioctl driver Dison River
2017-09-01  6:44 ` Kees Cook
2017-09-01  8:24 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox