mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <>
To: Barebox List <>
Cc: Neeraj Pal <>
Subject: [PATCH 2/3] fs: check for valid name in filename_lookup()
Date: Fri,  7 May 2021 12:56:10 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

The getname() return value is passed to filename_lookup() without
checking the return value, so this must be done in filename_lookup().

Signed-off-by: Sascha Hauer <>
 fs/fs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/fs.c b/fs/fs.c
index 09fccf9c28..2eaf7eaa37 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -2189,6 +2189,9 @@ static int filename_lookup(int dfd, struct filename *name, unsigned flags,
 	struct nameidata nd;
 	const char *s;
+	if (IS_ERR(name))
+		return PTR_ERR(name);
 	set_nameidata(&nd, dfd, name);
 	s = path_init(&nd, flags);

barebox mailing list

  parent reply	other threads:[~2021-05-07 10:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 10:56 [PATCH 0/3] Fix opening empty path Sascha Hauer
2021-05-07 10:56 ` [PATCH 1/3] fs: check for empty name in getname() Sascha Hauer
2021-05-07 10:56 ` Sascha Hauer [this message]
2021-05-07 10:56 ` [PATCH 3/3] fs: check getname() return value in open() Sascha Hauer

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:

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

  git send-email \ \ \ \ \

* 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