Re: [PATCH] twist: allow converting pr_devel()/pr_debug() into printk(KERN_DEBUG)
From: Sergey Senozhatsky
Date: Mon May 25 2020 - 05:12:03 EST
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].
> >
> > pr_debug("fallback-read subflow=%p",
> > mptcp_subflow_ctx(ssock->sk));
> > copied = sock_recvmsg(ssock, msg, flags);
>
> The NULL pointer deference was found even without this patch.
> This patch would just cause that it will manifest itself on another
> place. What is the benefit, please?
Right, I don't get this patch. A NULL-deref is still a NULL pointer deref.
pr_debug() will fault reading one byte from the address and print something
like "fallback-read subflow=(efault)" to printk-safe buffer, but then
sock_recvmsg() is still going to do its thing.
-ss