Re: [PATCH bpf-next v8 10/10] selftests/bpf: Add test for race in btf_try_get_module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 14, 2022 at 8:41 AM Kumar Kartikeya Dwivedi
<memxor@xxxxxxxxx> wrote:
>
> This adds a complete test case to ensure we never take references to
> modules not in MODULE_STATE_LIVE, which can lead to UAF, and it also
> ensures we never access btf->kfunc_set_tab in an inconsistent state.
>
> The test uses userfaultfd to artificially widen the race.
>
> When run on an unpatched kernel, it leads to the following splat:
>
> [root@(none) bpf]# ./test_progs -t bpf_mod_race/ksym
> [   55.498171] BUG: unable to handle page fault for address: fffffbfff802548b                                                                      [   55.499206] #PF: supervisor read access in kernel mode
> [   55.499855] #PF: error_code(0x0000) - not-present page
> [   55.500555] PGD a4fa9067 P4D a4fa9067 PUD a4fa5067 PMD 1b44067 PTE 0
> [   55.501499] Oops: 0000 [#1] PREEMPT SMP KASAN NOPTI
> [   55.502195] CPU: 0 PID: 83 Comm: kworker/0:2 Tainted: G           OE     5.16.0-rc4+ #151                                                       [   55.503388] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ArchLinux 1.15.0-1 04/01/2014

The commit log was messed up in a few places.
I've cleaned it up while applying.
Thanks!



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux