All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs: drop path before copying to userspace
@ 2022-11-10  6:06 Anand Jain
  2022-11-10  6:06 ` [PATCH 1/4] btrfs: drop path before copying inodes " Anand Jain
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Anand Jain @ 2022-11-10  6:06 UTC (permalink / raw)
  To: linux-btrfs

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(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-11 15:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-10  6:06 [PATCH 0/4] btrfs: drop path before copying to userspace Anand Jain
2022-11-10  6:06 ` [PATCH 1/4] btrfs: drop path before copying inodes " Anand Jain
2022-11-10  6:06 ` [PATCH 2/4] btrfs: drop path before copying fspath " Anand Jain
2022-11-10  6:06 ` [PATCH 3/4] btrfs: drop path before copying rootrefs " Anand Jain
2022-11-10  6:06 ` [PATCH 4/4] btrfs: drop path before copying subvol info " Anand Jain
2022-11-11 15:12 ` [PATCH 0/4] btrfs: drop path before copying " David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.