Re: [PATCH] net: skmsg: fix NULL pointer dereference in sk_msg_recvmsg()
From: Paolo Abeni
Date:  Thu Jul 17 2025 - 07:11:03 EST
On 7/15/25 10:11 AM, Pranav Tyagi wrote:
> A NULL page from sg_page() in sk_msg_recvmsg() can reach
> __kmap_local_page_prot() and crash the kernel. Add a check for the page
> before calling copy_page_to_iter() and fail early with -EFAULT to
> prevent the crash.
Interesting. I thought the sge in this case are build from the kernel, I
did not expect a null page to be possible. Can you describe in the
commit message how such bad sges are created?
> 
> Reported-by: syzbot+b18872ea9631b5dcef3b@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=b18872ea9631b5dcef3b
> Fixes: 2bc793e3272a ("skmsg: Extract __tcp_bpf_recvmsg() and tcp_bpf_wait_data()")
> Signed-off-by: Pranav Tyagi <pranav.tyagi03@xxxxxxxxx>
Does not apply to net. Please rebase and resend, adding the target tree
in the subj prefix and specifying a revision number.
Thanks,
Paolo