Skip to content

btrfs: drop path before copying to userspace

Anand Jain linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs: drop path before copying inodes to userspacefs/btrfs/ioctl.c+7 -90 replies
2/4btrfs: drop path before copying fspath to userspacefs/btrfs/ioctl.c+2 -00 replies
3/4btrfs: drop path before copying rootrefs to userspacefs/btrfs/ioctl.c+1 -10 replies
4/4btrfs: drop path before copying subvol info to userspacefs/btrfs/ioctl.c+2 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] btrfs: drop path before copying to userspace

In the ioctl functions below, we are holing ref to the path when copying the temp buffer to the userland. Which can lead to a similar lock splat warning as in the commit
[PATCH] btrfs: drop path before copying root refs to userspace

btrfs_ioctl_logical_to_ino
btrfs_ioctl_ino_to_path
btrfs_ioctl_get_subvol_rootref
btrfs_ioctl_get_subvol_info

Fix this by freeing the path before we copy it to userspace.

Individual patch 4/4 is also in the ML and is different from here: Check the value of ret to copy got dropped to keep it closer to the original logic. However, its version is unchanged to match the rest of the patch version.

Anand Jain (4):
btrfs: drop path before copying inodes to userspace
btrfs: drop path before copying fspath to userspace
btrfs: drop path before copying rootrefs to userspace
btrfs: drop path before copying subvol info to userspace

 fs/btrfs/ioctl.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
Signature · 1 line
2.31.1