Repository navigation
Commit 8d83f10
USB: usbfs: Don't WARN about excessively large memory allocations
commit 4f2629e upstream.
Syzbot found that the kernel generates a WARNing if the user tries to
submit a bulk transfer through usbfs with a buffer that is way too
large. This isn't a bug in the kernel; it's merely an invalid request
from the user and the usbfs code does handle it correctly.
In theory the same thing can happen with async transfers, or with the
packet descriptor table for isochronous transfers.
To prevent the MM subsystem from complaining about these bad
allocation requests, add the __GFP_NOWARN flag to the kmalloc calls
for these buffers.
CC: Andrew Morton <akpm@linux-foundation.org>
CC: <stable@vger.kernel.org>
Reported-and-tested-by: syzbot+882a85c0c8ec4a3e2281@syzkaller.appspotmail.com
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20210518201835.GA1140918@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent bc439b4 commit 8d83f10
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
1221 | | - | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
1222 | 1227 | | |
1223 | 1228 | | |
1224 | 1229 | | |
| |||
1696 | 1701 | | |
1697 | 1702 | | |
1698 | 1703 | | |
1699 | | - | |
| 1704 | + | |
1700 | 1705 | | |
1701 | 1706 | | |
1702 | 1707 | | |
| |||
1731 | 1736 | | |
1732 | 1737 | | |
1733 | 1738 | | |
1734 | | - | |
| 1739 | + | |
1735 | 1740 | | |
1736 | 1741 | | |
1737 | 1742 | | |
| |||
0 commit comments