Skip to contentSkip to conversation

BUG: Bad page map

DISCUSSION Andreas Schwab 2 participants 4 messages Dec 10, 2018 – Dec 11, 2018 RISC-V

lore
Share & tools
lore
#0 lore raw

This looks like a serious bug, especially without any swap defined.

swap_info_get: Bad swap file entry 4000000000ec9611

BUG: Bad page map in process struct-ret-3.ex  pte:764b08c0 pmd:6e2fac01
addr:00000000aa2a0c10 vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffe4
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Not tainted 4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
Disabling lock debugging due to kernel taint
swap_info_get: Bad swap file entry 4000000000d38671
BUG: Bad page map in process struct-ret-3.ex  pte:69c338c0 pmd:6e2fac01
addr:00000000368d7802 vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffe5
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 4000000000f82139
BUG: Bad page map in process struct-ret-3.ex  pte:7c109cc0 pmd:6e2fac01
addr:000000005d95fff2 vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffe6
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 4000000000fef7d9
BUG: Bad page map in process struct-ret-3.ex  pte:7f7becc0 pmd:6e2fac01
addr:000000001eee406f vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffe7
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 40000000012cd199
BUG: Bad page map in process struct-ret-3.ex  pte:9668ccc0 pmd:6e2fac01
addr:000000007af7568b vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffec
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 400000000122f109
BUG: Bad page map in process struct-ret-3.ex  pte:917884c0 pmd:6e2fac01
addr:00000000fb140cbb vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffed
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 400000000126d2e1
BUG: Bad page map in process struct-ret-3.ex  pte:936970c0 pmd:6e2fac01
addr:0000000096011bef vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffee
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 4000000000f23849
BUG: Bad page map in process struct-ret-3.ex  pte:791c24c0 pmd:6e2fac01
addr:000000006948a5ce vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffef
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 400000000134adf9
BUG: Bad page map in process struct-ret-3.ex  pte:9a56fcc0 pmd:6e2fac01
addr:00000000667b031e vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3fffff4
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 4000000000fc0fe9
BUG: Bad page map in process struct-ret-3.ex  pte:7e07f4c0 pmd:6e2fac01
addr:000000006fc86206 vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3fffff5
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 4000000000f484b1
BUG: Bad page map in process struct-ret-3.ex  pte:7a4258c0 pmd:6e2fac01
addr:00000000807001b4 vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3fffff6
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
swap_info_get: Bad swap file entry 4000000000fcdfd1
BUG: Bad page map in process struct-ret-3.ex  pte:7e6fe8c0 pmd:6e2fac01
addr:000000000ac58442 vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3fffff7
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Tainted: G    B             4.20.0-rc5-00011-g3b8e7421e0 #44
Call Trace:
[<ffffffe000f2ac9c>] walk_stackframe+0x0/0xa4
[<ffffffe000f2ae9c>] show_stack+0x2a/0x34
[<ffffffe00146541e>] dump_stack+0x62/0x7c
[<ffffffe000ffe97a>] print_bad_pte+0x146/0x18e
[<ffffffe000fff6d4>] unmap_page_range+0x2d2/0x5ea
[<ffffffe000fffa1a>] unmap_single_vma+0x2e/0x40
[<ffffffe000fffb50>] unmap_vmas+0x42/0x7a
[<ffffffe001005a9e>] exit_mmap+0x7e/0x106
[<ffffffe000f2d8c8>] mmput.part.3+0x26/0xa4
[<ffffffe000f2d966>] mmput+0x20/0x28
[<ffffffe000f32232>] do_exit+0x23c/0x826
[<ffffffe000f32876>] do_group_exit+0x2a/0x82
[<ffffffe000f328e6>] __wake_up_parent+0x0/0x22
[<ffffffe000f29bd6>] ret_from_syscall+0x0/0xe
BUG: Bad rss-counter state mm:00000000e8bbd9eb idx:1 val:12
BUG: Bad rss-counter state mm:00000000e8bbd9eb idx:2 val:-12

Andreas.

Signature · 8 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#1 lore raw

Hello Andreas

Quoted 7 lines · Andreas Schwab

This looks like a serious bug, especially without any swap defined.

swap_info_get: Bad swap file entry 4000000000ec9611

BUG: Bad page map in process struct-ret-3.ex  pte:764b08c0 pmd:6e2fac01
addr:00000000aa2a0c10 vm_flags:00100173 anon_vma:00000000dc561e1a mapping:          (null) index:3ffffe4
file:          (null) fault:          (null) mmap:          (null) readpage:          (null)
CPU: 2 PID: 13693 Comm: struct-ret-3.ex Not tainted 4.20.0-rc5-00011-g3b8e7421e0 #44

Can you give us some guidance on how to reproduce this? Was this on hardware or software (QEMU)? Could you post the kernel tree that you were using?

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#2 lore raw

Stef O'Rear <[email protected]> has a patch for this issue. Stef, please post it here.

Andreas.

Signature · 8 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#3 lore raw
In reply to Paul Walmsley

This is the reproducer:

#include <sys/mman.h>

int
main (void)
{
char *a = mmap (0, 4096, PROT_READ | PROT_WRITE,

		  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

++*a;
mprotect (a, 4096, PROT_NONE);
}

Andreas.

Signature · 8 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv