diff options
| author | Chris Mason <mason@kernel.org> | 2026-10-07 09:45:28 +0000 |
|---|---|---|
| committer | Amir Goldstein <amir73il@gmail.com> | 2026-10-29 13:19:03 +0100 |
| commit | 755b5c5c9277be251a51623d6065abab948c61bc (patch) | |
| tree | 14c5844685b51a673a6e5c4789138b58ac635bab /scripts/Makefile.thinlto | |
| parent | 214897acc8c2e5d6b63189d23ccaed6fa2af45a9 (diff) | |
| download | linux-755b5c5c9277be251a51623d6065abab948c61bc.tar.gz linux-755b5c5c9277be251a51623d6065abab948c61bc.zip | |
ovl: do not copy up an xattr value that was never read
Copy-up stores uninitialized kernel memory in an xattr of the upper
file, where the user can read it.
ovl_copy_xattr() may only pass bytes to ovl_do_setxattr() that
ovl_do_getxattr() has read. When the read fails with -ERANGE the
function asks for the size again, and if the new size fits the buffer
it stores the buffer although nothing was read into it. The buffer
comes from kvmalloc(), or it still holds the value of the previous
xattr.
A FUSE lower layer that answers every sized GETXATTR with -ERANGE made
copy-up store 4096 bytes that the server never sent, with a kernel
pointer in them, as an xattr of the upper file.
Fix this by failing the copy-up with -EIO when the size that follows
-ERANGE fits the buffer.
Reported-by: Fahad Alharbi <fahad@codepure.com>
Closes: https://lore.kernel.org/linux-fsdevel/CAOQ4uxjhfpNVvoVrTayj46H2CViTOc3oxzM6xdb8+E7ikE2CSA@mail.gmail.com/
Fixes: e4ad29fa0d22 ("ovl: use a minimal buffer in ovl_copy_xattr")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
