[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e24b125c-8ff4-9031-6c53-67ff2e01f316@huaweicloud.com>
Date: Thu, 21 Dec 2023 19:59:54 +0800
From: Hou Tao <houtao@...weicloud.com>
To: Thomas Gleixner <tglx@...utronix.de>, bpf <bpf@...r.kernel.org>
Cc: syzbot <syzbot+72aa0161922eba61b50e@...kaller.appspotmail.com>,
akpm@...ux-foundation.org, bp@...en8.de, bp@...e.de,
dave.hansen@...ux.intel.com, hpa@...or.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, luto@...nel.org, mingo@...hat.com,
netdev@...r.kernel.org, peterz@...radead.org,
syzkaller-bugs@...glegroups.com, x86@...nel.org, Jann Horn
<jannh@...gle.com>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>
Subject: Re: [syzbot] [mm?] BUG: unable to handle kernel paging request in
copy_from_kernel_nofault
Hi Thomas,
On 12/9/2023 5:01 AM, Thomas Gleixner wrote:
> diff --git a/arch/x86/mm/maccess.c b/arch/x86/mm/maccess.c
> index 6993f026adec..8e846833aa37 100644
> --- a/arch/x86/mm/maccess.c
> +++ b/arch/x86/mm/maccess.c
> @@ -3,6 +3,8 @@
> #include <linux/uaccess.h>
> #include <linux/kernel.h>
>
> +#include <uapi/asm/vsyscall.h>
> +
> #ifdef CONFIG_X86_64
> bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
> {
> @@ -15,6 +17,9 @@ bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
> if (vaddr < TASK_SIZE_MAX + PAGE_SIZE)
> return false;
>
> + if ((vaddr & PAGE_MASK) == VSYSCALL_ADDR)
> + return false;
> +
> /*
> * Allow everything during early boot before 'x86_virt_bits'
> * is initialized. Needed for instruction decoding in early
Tested-by: Hou Tao <houtao1@...wei.com>
Could you please post a formal patch for the fix ? The patch fixes the
oops when using bpf_probe_read_kernel() or similar bpf helpers [1] to
read from vsyscall address and you can take my tested-by tag if it is
necessary.
[1]:
https://lore.kernel.org/bpf/CABOYnLynjBoFZOf3Z4BhaZkc5hx_kHfsjiW+UWLoB=w33LvScw@mail.gmail.com/
Powered by blists - more mailing lists