Commit 78f2560
fuse: Set *nbytesp=0 in fuse_get_user_pages on allocation failure
In fuse_get_user_pages(), set *nbytesp to 0 when struct page **pages
allocation fails. This prevents the caller (fuse_direct_io) from making
incorrect assumptions that could lead to NULL pointer dereferences
when processing the request reply.
Previously, *nbytesp was left unmodified on allocation failure, which
could cause issues if the caller assumed pages had been added to
ap->descs[] when they hadn't.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=87b8e6ed25dbc41759f7
Fixes: 3b97c36 ("fuse: convert direct io to use folios")
Signed-off-by: Bernd Schubert <[email protected]>
Reviewed-by: Joanne Koong <[email protected]>
Tested-by: Dmitry Antipov <[email protected]>
Tested-by: David Howells <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>1 parent 7a4f541 commit 78f2560
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1541 | 1541 | | |
1542 | 1542 | | |
1543 | 1543 | | |
1544 | | - | |
1545 | | - | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
1546 | 1548 | | |
1547 | 1549 | | |
1548 | 1550 | | |
| |||
1588 | 1590 | | |
1589 | 1591 | | |
1590 | 1592 | | |
| 1593 | + | |
1591 | 1594 | | |
1592 | 1595 | | |
1593 | 1596 | | |
| |||
0 commit comments