Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-28 Thread Tetsuo Handa
On 2020/05/29 11:04, Sergey Senozhatsky wrote: > You are not going to add pr_debug() all over the kernel, are you? Of course, I'm not planning to add pr_debug() all over the kernel. When I need to print something to consoles, I will use one-time patch (like

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-28 Thread Sergey Senozhatsky
On (20/05/25 19:43), Tetsuo Handa wrote: > >> On Sun 2020-05-24 23:50:34, Tetsuo Handa wrote: > >>> syzbot found a NULL pointer dereference bug inside mptcp_recvmsg() due to > >>> ssock == NULL, but this bug manifested inside selinux_socket_recvmsg() > >>> because pr_debug() was no-op [1]. > >>> >

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-28 Thread Joe Perches
On Thu, 2020-05-28 at 14:14 +0200, Petr Mladek wrote: > On Thu 2020-05-28 20:33:10, Tetsuo Handa wrote: > > On 2020/05/28 19:59, Petr Mladek wrote: > > > 2. Add twist into vprintk_store(). In the current, implementation > > >it would do: > > > > > > #if TWIST > > > return text_len; > > >

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-28 Thread Tetsuo Handa
On 2020/05/28 21:14, Petr Mladek wrote: >> how to handle >> #define no_printk(fmt, ...) \ ({ \ if (0) \ printk(fmt,

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-28 Thread Petr Mladek
On Thu 2020-05-28 20:33:10, Tetsuo Handa wrote: > On 2020/05/28 19:59, Petr Mladek wrote: > > 2. Add twist into vprintk_store(). In the current, implementation > >it would do: > > > > #if TWIST > > return text_len; > > #endif > > > > return log_output(facility, level, lflags, > >

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-28 Thread Tetsuo Handa
On 2020/05/28 19:59, Petr Mladek wrote: > 2. Add twist into vprintk_store(). In the current, implementation >it would do: > > #if TWIST > return text_len; > #endif > > return log_output(facility, level, lflags, > dict, dictlen, text, text_len); This

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-28 Thread Petr Mladek
On Thu 2020-05-28 08:33:37, Tetsuo Handa wrote: > On 2020/05/28 0:55, Petr Mladek wrote: > >>> Well, it would be possible to call vsprintf() with NULL buffer. It is > >>> normally used to calculate the length of the message before it is > >>> printed. But it also does all the accesses without

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-27 Thread Tetsuo Handa
On 2020/05/28 0:55, Petr Mladek wrote: >>> Well, it would be possible to call vsprintf() with NULL buffer. It is >>> normally used to calculate the length of the message before it is >>> printed. But it also does all the accesses without printing anything. >> >> OK. I think that redirecting

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-27 Thread Petr Mladek
On Wed 2020-05-27 19:13:38, Tetsuo Handa wrote: > On 2020/05/27 17:37, Petr Mladek wrote: > > On Mon 2020-05-25 19:43:04, Tetsuo Handa wrote: > >> On 2020/05/25 17:42, Petr Mladek wrote: > >>> I see few drawbacks with this patch: > >>> > >>> 1. It will cause adding much more messages into the

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-27 Thread Tetsuo Handa
>From 3406a1853564618f167a5d0a815f174d2fb295f5 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Wed, 27 May 2020 22:34:50 +0900 Subject: [PATCH] dev_printk: Explicitly include dynamic_debug.h While printk.h included dynamic_debug.h before pr_debug(), dev_printk.h did not include it before

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-27 Thread kbuild test robot
Hi Tetsuo, I love your patch! Perhaps something to improve: [auto build test WARNING on next-20200519] [cannot apply to linus/master linux/master pmladek/for-next v5.7-rc6 v5.7-rc5 v5.7-rc4 v5.7-rc7] [if your patch is applied to the wrong git tree, please drop us a note to help improve the

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-27 Thread Tetsuo Handa
On 2020/05/27 17:37, Petr Mladek wrote: > On Mon 2020-05-25 19:43:04, Tetsuo Handa wrote: >> On 2020/05/25 17:42, Petr Mladek wrote: >>> I see few drawbacks with this patch: >>> >>> 1. It will cause adding much more messages into the logbuffer even >>>though they are not flushed to the

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-27 Thread kbuild test robot
Hi Tetsuo, I love your patch! Perhaps something to improve: [auto build test WARNING on next-20200519] [cannot apply to linus/master linux/master pmladek/for-next v5.7-rc6 v5.7-rc5 v5.7-rc4 v5.7-rc7] [if your patch is applied to the wrong git tree, please drop us a note to help improve the

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-27 Thread Petr Mladek
On Mon 2020-05-25 19:43:04, Tetsuo Handa wrote: > On 2020/05/25 17:42, Petr Mladek wrote: > > I see few drawbacks with this patch: > > > > 1. It will cause adding much more messages into the logbuffer even > >though they are not flushed to the console. It might cause that > >more

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-25 Thread Tetsuo Handa
On 2020/05/25 17:42, Petr Mladek wrote: > I see few drawbacks with this patch: > > 1. It will cause adding much more messages into the logbuffer even >though they are not flushed to the console. It might cause that >more important messages will get overridden before they reach >

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-25 Thread Sergey Senozhatsky
On (20/05/25 10:42), Petr Mladek wrote: > On Sun 2020-05-24 23:50:34, Tetsuo Handa wrote: > > syzbot found a NULL pointer dereference bug inside mptcp_recvmsg() due to > > ssock == NULL, but this bug manifested inside selinux_socket_recvmsg() > > because pr_debug() was no-op [1]. > > > >

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-25 Thread Petr Mladek
On Sun 2020-05-24 23:50:34, Tetsuo Handa wrote: > syzbot found a NULL pointer dereference bug inside mptcp_recvmsg() due to > ssock == NULL, but this bug manifested inside selinux_socket_recvmsg() > because pr_debug() was no-op [1]. > > pr_debug("fallback-read subflow=%p", >

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-25 Thread Dmitry Vyukov
On Mon, May 25, 2020 at 8:07 AM Joe Perches wrote: > > On Mon, 2020-05-25 at 14:03 +0900, Tetsuo Handa wrote: > > On 2020/05/25 4:18, Ondrej Mosnacek wrote: > > > I'm also not sure if this is really worth it... It would help localize > > > the bug in this specific case, but there is nothing

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-25 Thread Joe Perches
On Mon, 2020-05-25 at 14:03 +0900, Tetsuo Handa wrote: > On 2020/05/25 4:18, Ondrej Mosnacek wrote: > > I'm also not sure if this is really worth it... It would help localize > > the bug in this specific case, but there is nothing systematic about > > it. Are there that many debug print statements

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-24 Thread Tetsuo Handa
On 2020/05/25 4:18, Ondrej Mosnacek wrote: > I'm also not sure if this is really worth it... It would help localize > the bug in this specific case, but there is nothing systematic about > it. Are there that many debug print statements that dereference > pointers that are later passed to

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-24 Thread Ondrej Mosnacek
On Sun, May 24, 2020 at 7:38 PM Joe Perches wrote: > On Sun, 2020-05-24 at 23:50 +0900, Tetsuo Handa wrote: > > syzbot found a NULL pointer dereference bug inside mptcp_recvmsg() due to > > ssock == NULL, but this bug manifested inside selinux_socket_recvmsg() > > because pr_debug() was no-op

Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-24 Thread Joe Perches
On Sun, 2020-05-24 at 23:50 +0900, Tetsuo Handa wrote: > syzbot found a NULL pointer dereference bug inside mptcp_recvmsg() due to > ssock == NULL, but this bug manifested inside selinux_socket_recvmsg() > because pr_debug() was no-op [1]. > > pr_debug("fallback-read subflow=%p", >

[PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)

2020-05-24 Thread Tetsuo Handa
syzbot found a NULL pointer dereference bug inside mptcp_recvmsg() due to ssock == NULL, but this bug manifested inside selinux_socket_recvmsg() because pr_debug() was no-op [1]. pr_debug("fallback-read subflow=%p", mptcp_subflow_ctx(ssock->sk)); copied = sock_recvmsg(ssock, msg,