[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190809012457.56685-2-justin.he@arm.com>
Date: Fri, 9 Aug 2019 09:24:57 +0800
From: Jia He <justin.he@....com>
To: Petr Mladek <pmladek@...e.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Cc: "Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Kees Cook <keescook@...omium.org>,
Shuah Khan <shuah@...nel.org>,
"Tobin C. Harding" <tobin@...nel.org>, Jia He <justin.he@....com>
Subject: [PATCH 2/2] lib/test_printf: add test of null/invalid pointer dereference for dentry
This add some additional test cases of null/invalid pointer dereference
for dentry and file (%pd and %pD)
Signed-off-by: Jia He <justin.he@....com>
---
lib/test_printf.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/test_printf.c b/lib/test_printf.c
index 944eb50f3862..befedffeb476 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -455,6 +455,13 @@ dentry(void)
test("foo", "%pd", &test_dentry[0]);
test("foo", "%pd2", &test_dentry[0]);
+ /* test the null/invalid pointer case for dentry */
+ test("(null)", "%pd", NULL);
+ test("(efault)", "%pd", PTR_INVALID);
+ /* test the null/invalid pointer case for file */
+ test("(null)", "%pD", NULL);
+ test("(efault)", "%pD", PTR_INVALID);
+
test("romeo", "%pd", &test_dentry[3]);
test("alfa/romeo", "%pd2", &test_dentry[3]);
test("bravo/alfa/romeo", "%pd3", &test_dentry[3]);
--
2.17.1
Powered by blists - more mailing lists