diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-05-07 12:49:59 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-05-07 12:53:43 +0200 |
commit | 6f25a81074782649ee9f5d209bd4bf9e40319029 (patch) | |
tree | c4bbdb37d471312aee2127c9e365235667d39a74 | |
parent | ef98a567d7468c9be9954be67a482d81447f4fb1 (diff) | |
download | barebox-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>
-rw-r--r-- | fs/fs.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |