mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02:00
9p: BUG before corrupting memory
commit 5fcb08befa upstream.
The BUG_ON() in pack_sg_list() would get triggered only one time after we've
corrupted some memory by sg_set_buf() into an invalid sg buffer.
I'm still working on figuring out why I manage to trigger that bug...
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9f138fc8bc
commit
eef458cb6f
|
|
@ -192,10 +192,10 @@ static int pack_sg_list(struct scatterlist *sg, int start,
|
|||
s = rest_of_page(data);
|
||||
if (s > count)
|
||||
s = count;
|
||||
BUG_ON(index > limit);
|
||||
sg_set_buf(&sg[index++], data, s);
|
||||
count -= s;
|
||||
data += s;
|
||||
BUG_ON(index > limit);
|
||||
}
|
||||
|
||||
return index-start;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user