public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Forwarded: Testing for v4 scsi: target: fix recursive locking in __configfs_open_file()
Date: Tue, 10 Feb 2026 06:00:11 -0800	[thread overview]
Message-ID: <698b39eb.050a0220.2eeac1.008a.GAE@google.com> (raw)
In-Reply-To: <6767d8ea.050a0220.226966.0021.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Testing for v4 scsi: target: fix recursive locking in __configfs_open_file()
Author: activprithvi@gmail.com

#syz test

Signed-off-by: Prithvi Tambewagh <activprithvi@gmail.com>
---
 drivers/target/target_core_configfs.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index b19acd662726..f94c242eff97 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -108,8 +108,8 @@ static ssize_t target_core_item_dbroot_store(struct config_item *item,
 					const char *page, size_t count)
 {
 	ssize_t read_bytes;
-	struct file *fp;
 	ssize_t r = -EINVAL;
+	struct path path = {};
 
 	mutex_lock(&target_devices_lock);
 	if (target_devices) {
@@ -131,17 +131,14 @@ static ssize_t target_core_item_dbroot_store(struct config_item *item,
 		db_root_stage[read_bytes - 1] = '\0';
 
 	/* validate new db root before accepting it */
-	fp = filp_open(db_root_stage, O_RDONLY, 0);
-	if (IS_ERR(fp)) {
+	r = kern_path(db_root_stage, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path);
+	if (r) {
 		pr_err("db_root: cannot open: %s\n", db_root_stage);
+		if (r == -ENOTDIR)
+			pr_err("db_root: not a directory: %s\n", db_root_stage);
 		goto unlock;
 	}
-	if (!S_ISDIR(file_inode(fp)->i_mode)) {
-		filp_close(fp, NULL);
-		pr_err("db_root: not a directory: %s\n", db_root_stage);
-		goto unlock;
-	}
-	filp_close(fp, NULL);
+	path_put(&path);
 
 	strscpy(db_root, db_root_stage);
 	pr_debug("Target_Core_ConfigFS: db_root set to %s\n", db_root);

base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
-- 
2.34.1


  parent reply	other threads:[~2026-02-10 14:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-22  9:16 [syzbot] [fs?] possible deadlock in __configfs_open_file syzbot
2026-01-08 17:32 ` Syzbot test for fixing recursive locking " Prithvi Tambewagh
2026-01-08 17:58   ` [syzbot] [fs?] possible deadlock " syzbot
2026-01-21 15:02 ` Testing for v2: configfs: add lock class key to struct configfs_fragment for frag_sem Prithvi Tambewagh
2026-01-21 15:19   ` [syzbot] [fs?] possible deadlock in __configfs_open_file syzbot
2026-02-06  9:02 ` Forwarded: Testing for v3: scsi: target: fix recursive locking in __configfs_open_file() syzbot
2026-02-06 16:04 ` syzbot
2026-02-07 10:43 ` Forwarded: Testing for v4: " syzbot
2026-02-08 16:41 ` syzbot
2026-02-09  5:14 ` Forwarded: Testing for v3 " syzbot
2026-02-09  6:05 ` Forwarded: Testing for v4 " syzbot
2026-02-09 14:29 ` Forwarded: Syzbot build test syzbot
2026-02-09 15:01 ` Forwarded: Testing for v4 scsi: target: fix recursive locking in __configfs_open_file() syzbot
2026-02-09 15:37 ` Forwarded: Testing for v4: " syzbot
2026-02-09 15:45 ` Forwarded: Testing for v4 " syzbot
2026-02-10 13:41 ` syzbot
2026-02-10 13:48 ` syzbot
2026-02-10 13:53 ` Forwarded: Testing for v4: " syzbot
2026-02-10 14:00 ` syzbot [this message]
2026-02-16  4:27 ` Forwarded: Testing for v4 " syzbot
2026-02-16  5:18 ` syzbot

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=698b39eb.050a0220.2eeac1.008a.GAE@google.com \
    --to=syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox