All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/4] btrfs: drop path before copying to userspace
Date: Thu, 10 Nov 2022 11:36:27 +0530	[thread overview]
Message-ID: <cover.1668056532.git.anand.jain@oracle.com> (raw)

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


             reply	other threads:[~2022-11-10  6:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10  6:06 Anand Jain [this message]
2022-11-10  6:06 ` [PATCH 1/4] btrfs: drop path before copying inodes to userspace 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1668056532.git.anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.