RE: [PATCH 2/2] lib/test_printf: add test of null/invalid pointer dereference for dentry
Hi Petr > -Original Message- > From: Petr Mladek > Sent: 2019年8月16日 16:27 > To: Justin He (Arm Technology China) > Cc: Geert Uytterhoeven ; Sergey Senozhatsky > ; Thomas Gleixner ; > Andy Shevchenko ; linux- > ker...@vger.kernel.org; Kees Cook ; Steven > Rostedt (VMware) ; Shuah Khan > ; Tobin C. Harding > Subject: Re: [PATCH 2/2] lib/test_printf: add test of null/invalid pointer > dereference for dentry > > On Fri 2019-08-09 09:24:57, Jia He wrote: > > This add some additional test cases of null/invalid pointer dereference > > for dentry and file (%pd and %pD) > > > > Signed-off-by: Jia He > > --- > > 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", _dentry[0]); > > test("foo", "%pd2", _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 */ > > The two comments mention something that is obvious from the code. > No problem, ok with me -- Cheers, Justin (Jia He) > I have pushed the patch as is and removed the comments in > a follow up patch [1]. Both are in printk.git, branch for-5.4. > > > + test("(null)", "%pD", NULL); > > + test("(efault)", "%pD", PTR_INVALID); > > Reference: > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commi > t/?h=for-5.4=8ebea6ea1a7ed5d67ecbb2a493c716a2a89c0be2 > > Best Regards, > Petr IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Re: [PATCH 2/2] lib/test_printf: add test of null/invalid pointer dereference for dentry
On Fri 2019-08-09 09:24:57, Jia He wrote: > This add some additional test cases of null/invalid pointer dereference > for dentry and file (%pd and %pD) > > Signed-off-by: Jia He > --- > 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", _dentry[0]); > test("foo", "%pd2", _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 */ The two comments mention something that is obvious from the code. I have pushed the patch as is and removed the comments in a follow up patch [1]. Both are in printk.git, branch for-5.4. > + test("(null)", "%pD", NULL); > + test("(efault)", "%pD", PTR_INVALID); Reference: [1] https://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git/commit/?h=for-5.4=8ebea6ea1a7ed5d67ecbb2a493c716a2a89c0be2 Best Regards, Petr
Re: [PATCH 2/2] lib/test_printf: add test of null/invalid pointer dereference for dentry
On Fri, Aug 9, 2019 at 4:28 AM Jia He wrote: > > This add some additional test cases of null/invalid pointer dereference > for dentry and file (%pd and %pD) > Reviewed-by: Andy Shevchenko > Signed-off-by: Jia He > --- > 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", _dentry[0]); > test("foo", "%pd2", _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", _dentry[3]); > test("alfa/romeo", "%pd2", _dentry[3]); > test("bravo/alfa/romeo", "%pd3", _dentry[3]); > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko
[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 --- 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", _dentry[0]); test("foo", "%pd2", _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", _dentry[3]); test("alfa/romeo", "%pd2", _dentry[3]); test("bravo/alfa/romeo", "%pd3", _dentry[3]); -- 2.17.1