Commit cf6b7921 authored by Jia He's avatar Jia He Committed by Petr Mladek

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)

Link: http://lkml.kernel.org/r/20190809012457.56685-2-justin.he@arm.com
To: Geert Uytterhoeven <geert+renesas@glider.be>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Petr Mladek <pmladek@suse.com>
To: linux-kernel@vger.kernel.org
Cc: Kees Cook <keescook@chromium.org>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: "Tobin C. Harding" <tobin@kernel.org>
Signed-off-by: default avatarJia He <justin.he@arm.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
parent 36594b31
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment