[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241222103522.GE1977892@ZenIV>
Date: Sun, 22 Dec 2024 10:35:22 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Edward Adam Davis <eadavis@...com>
Cc: syzbot+fc519d7875f2d9186c1f@...kaller.appspotmail.com,
devel@...ts.orangefs.org, hubcap@...ibond.com,
linux-kernel@...r.kernel.org, martin@...ibond.com,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] orangefs: fix a oob in orangefs_debug_write
On Sun, Dec 22, 2024 at 04:14:13PM +0800, Edward Adam Davis wrote:
> syzbot report a slab-out-of-bounds Read in orangefs_debug_write. [1]
>
> The string passed in from userspace is not terminated with a NULL character,
> which causes strlen to go out of bounds.
>
> Use kstrndup to replace kstrdup.
Better to replace
if (count > ORANGEFS_MAX_DEBUG_STRING_LEN + 1) {
silly = count;
count = ORANGEFS_MAX_DEBUG_STRING_LEN + 1;
}
with
if (count > ORANGEFS_MAX_DEBUG_STRING_LEN) {
silly = count;
count = ORANGEFS_MAX_DEBUG_STRING_LEN;
}
instead, so that we wouldn't have to deal with lack of NUL anywhere.
Powered by blists - more mailing lists