patch "usb: mtu3: fix memory corruption in mtu3_debugfs_regset()" added to usb-next
Subsystems (3)
This is a note to let you know that I've just added the patch titled
usb: mtu3: fix memory corruption in mtu3_debugfs_regset()
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-next branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release during the merge window.
If you have any questions about this process, please let me know.
From 3f6f6343a29d9ea7429306b83b18e66dc1331d5c Mon Sep 17 00:00:00 2001
From: Dan Carpenter <[email protected]>
Date: Thu, 3 Dec 2020 11:41:13 +0300
Subject: usb: mtu3: fix memory corruption in mtu3_debugfs_regset()
This code is using the wrong sizeof() so it does not allocate enough memory. It allocates 32 bytes but 72 are required. That will lead to memory corruption.
--- drivers/usb/mtu3/mtu3_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/mtu3/mtu3_debugfs.c +1 -1
@@ -127,7 +127,7 @@ static void mtu3_debugfs_regset(struct mtu3 *mtu, void __iomem *base,struct debugfs_regset32 *regset;struct mtu3_regset *mregs; - mregs =devm_kzalloc (mtu->dev,sizeof (*regset),GFP_KERNEL ); + mregs =devm_kzalloc (mtu->dev,sizeof (*mregs),GFP_KERNEL );if (!mregs)return ;
Signature · 1 line
2.29.2