[PATCH 2/3] fs: check for valid name in filename_lookup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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);
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux