summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-05-07 12:49:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-07 12:53:43 +0200
commit6f25a81074782649ee9f5d209bd4bf9e40319029 (patch)
treec4bbdb37d471312aee2127c9e365235667d39a74 /fs
parentef98a567d7468c9be9954be67a482d81447f4fb1 (diff)
downloadbarebox-6f25a81074782649ee9f5d209bd4bf9e40319029.tar.gz
barebox-6f25a81074782649ee9f5d209bd4bf9e40319029.tar.xz
fs: check for valid name in filename_lookup()
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 <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c3
1 files changed, 3 insertions, 0 deletions
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);