mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
orangefs: fix a oob in orangefs_debug_write
[ Upstream commit f7c848431632598ff9bce57a659db6af60d75b39 ] I got a syzbot report: slab-out-of-bounds Read in orangefs_debug_write... several people suggested fixes, I tested Al Viro's suggestion and made this patch. Signed-off-by: Mike Marshall <hubcap@omnibond.com> Reported-by: syzbot+fc519d7875f2d9186c1f@syzkaller.appspotmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c0c082fef5
commit
18b7f84110
1 changed files with 2 additions and 2 deletions
|
|
@ -393,9 +393,9 @@ static ssize_t orangefs_debug_write(struct file *file,
|
|||
* Thwart users who try to jamb a ridiculous number
|
||||
* of bytes into the debug file...
|
||||
*/
|
||||
if (count > ORANGEFS_MAX_DEBUG_STRING_LEN + 1) {
|
||||
if (count > ORANGEFS_MAX_DEBUG_STRING_LEN) {
|
||||
silly = count;
|
||||
count = ORANGEFS_MAX_DEBUG_STRING_LEN + 1;
|
||||
count = ORANGEFS_MAX_DEBUG_STRING_LEN;
|
||||
}
|
||||
|
||||
buf = kzalloc(ORANGEFS_MAX_DEBUG_STRING_LEN, GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue