]> www.infradead.org Git - users/jedix/linux-maple.git/commit
WORKAROUND: mas_walk() in RCU mode returns value 0xE per_vma_lock_v1
authorSuren Baghdasaryan <surenb@google.com>
Tue, 29 Nov 2022 06:13:25 +0000 (06:13 +0000)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 4 Jan 2023 20:59:27 +0000 (15:59 -0500)
commit9f4ad814ada8c49fc3d68bb4e2bda92c9b7ac9ac
tree1be52defa84e294df951424a722ceb80c386f007
parent635b4807d28ad8f7c8bdad41c8ed3b43a9ac8b9d
WORKAROUND: mas_walk() in RCU mode returns value 0xE

Mel Gorman reported an issue with mas_walk() occasionally returning 0xE
causing NULL pointer dereference:

[ 3611.890629][T12506] BUG: kernel NULL pointer dereference, address: 000000000000009e
[ 3611.898293][T12506] #PF: supervisor read access in kernel mode
[ 3611.904127][T12506] #PF: error_code(0x0000) - not-present page
[ 3611.909961][T12506] PGD 5022e39067 P4D 5022e39067 PUD 502344b067 PMD 0
[ 3611.916571][T12506] Oops: 0000 [#1] PREEMPT SMP NOPTI
[ 3611.921629][T12506] CPU: 35 PID: 12506 Comm: pft Tainted: G            E 6.1.0-rc6-mm-pervmalock-v2r3 #1 5eb359771d3fe61fee3afacf8357ad1393b861b8
[ 3611.935095][T12506] Hardware name: Dell Inc. PowerEdge R640/0H28RR, BIOS 2.8.2 08/27/2020
[ 3611.943266][T12506] RIP: 0010:lock_vma_under_rcu+0x70/0x140                  # faddr2line matches mm/memory.c:5268

The code causing the crash is vma_is_anonymous() call which accesses
vma->vm_ops. With vm_ops being at offset 0x90 in vm_area_struct, the
vma returned by mas_walk() must be 0xE (0x9e-0x90).
Work around this issue for testing until we figure out why this is
happening.

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
mm/memory.c