lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220427005108.GA11323@xsang-OptiPlex-9020>
Date:   Wed, 27 Apr 2022 08:51:08 +0800
From:   kernel test robot <oliver.sang@...el.com>
To:     "Eric W. Biederman" <ebiederm@...ssion.com>
Cc:     0day robot <lkp@...el.com>, LKML <linux-kernel@...r.kernel.org>,
        lkp@...ts.01.org, Oleg Nesterov <oleg@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>, rjw@...ysocki.net,
        mingo@...nel.org, vincent.guittot@...aro.org,
        dietmar.eggemann@....com, rostedt@...dmis.org, mgorman@...e.de,
        bigeasy@...utronix.de, Will Deacon <will@...nel.org>,
        tj@...nel.org, linux-pm@...r.kernel.org
Subject: [ptrace]  [confidence: ] 7d3fafb751:
 BUG:sleeping_function_called_from_invalid_context_at_arch/x86/entry/common.c



Greeting,

FYI, we noticed the following commit (built with gcc-11):

commit: 7d3fafb75102c0e8d5282487c2822d0f3b301aa9 ("[RFC][PATCH] ptrace: Don't change __state")
url: https://github.com/intel-lab-lkp/linux/commits/Eric-W-Biederman/ptrace-Don-t-change-__state/20220421-045703
base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git b253435746d9a4a701b5f09211b9c14d3370d0da
patch link: https://lore.kernel.org/lkml/875yn3zdag.fsf_-_@email.froward.int.ebiederm.org

in testcase: boot

on test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 4G

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):


+------------------------------------------------------------------------------+------------+------------+
|                                                                              | b253435746 | 7d3fafb751 |
+------------------------------------------------------------------------------+------------+------------+
| boot_successes                                                               | 29         | 4          |
| boot_failures                                                                | 0          | 35         |
| BUG:sleeping_function_called_from_invalid_context_at_arch/x86/entry/common.c | 0          | 35         |
| BUG:scheduling_while_atomic                                                  | 0          | 32         |
| WARNING:at_arch/x86/include/asm/uaccess.h:#__do_sys_waitid                   | 0          | 16         |
| EIP:__do_sys_waitid                                                          | 0          | 16         |
| WARNING:at_lib/usercopy.c:#_copy_to_user                                     | 0          | 33         |
| EIP:_copy_to_user                                                            | 0          | 33         |
| WARNING:at_lib/usercopy.c:#_copy_from_user                                   | 0          | 16         |
| EIP:_copy_from_user                                                          | 0          | 16         |
| WARNING:at_fs/read_write.c:#vfs_write                                        | 0          | 16         |
| EIP:vfs_write                                                                | 0          | 16         |
| WARNING:at_arch/x86/include/asm/uaccess.h:#fault_in_readable                 | 0          | 16         |
| EIP:fault_in_readable                                                        | 0          | 16         |
| WARNING:at_arch/x86/include/asm/uaccess.h:#strncpy_from_user                 | 0          | 17         |
| EIP:strncpy_from_user                                                        | 0          | 17         |
| WARNING:at_lib/iov_iter.c:#__import_iovec                                    | 0          | 6          |
| EIP:__import_iovec                                                           | 0          | 6          |
| WARNING:at_lib/iov_iter.c:#copyin                                            | 0          | 5          |
| EIP:copyin                                                                   | 0          | 5          |
| WARNING:at_fs/read_write.c:#vfs_read                                         | 0          | 12         |
| EIP:vfs_read                                                                 | 0          | 12         |
| WARNING:at_arch/x86/include/asm/uaccess.h:#fault_in_writeable                | 0          | 12         |
| EIP:fault_in_writeable                                                       | 0          | 12         |
| WARNING:at_net/core/skbuff.c:#skb_release_head_state                         | 0          | 4          |
| EIP:skb_release_head_state                                                   | 0          | 4          |
| WARNING:at_arch/x86/kernel/fpu/signal.c:#copy_fpstate_to_sigframe            | 0          | 24         |
| EIP:copy_fpstate_to_sigframe                                                 | 0          | 24         |
| WARNING:at_arch/x86/include/asm/uaccess.h:#__setup_frame                     | 0          | 24         |
| EIP:__setup_frame                                                            | 0          | 24         |
| WARNING:at_arch/x86/kernel/signal.c:#__do_sys_sigreturn                      | 0          | 7          |
| EIP:__do_sys_sigreturn                                                       | 0          | 7          |
| WARNING:at_arch/x86/kernel/fpu/signal.c:#fpu__restore_sig                    | 0          | 7          |
| EIP:fpu__restore_sig                                                         | 0          | 7          |
| WARNING:at_kernel/futex/core.c:#get_futex_key                                | 0          | 2          |
| EIP:get_futex_key                                                            | 0          | 2          |
| Kernel_panic-not_syncing:Attempted_to_kill_init!exitcode=                    | 0          | 19         |
| WARNING:at_mm/highmem.c:#__kmap_local_pfn_prot                               | 0          | 9          |
| EIP:__kmap_local_pfn_prot                                                    | 0          | 9          |
| WARNING:at_arch/x86/include/asm/uaccess.h:#do_sys_poll                       | 0          | 6          |
| EIP:do_sys_poll                                                              | 0          | 6          |
| WARNING:at_lib/iov_iter.c:#copyout                                           | 0          | 2          |
| EIP:copyout                                                                  | 0          | 2          |
| kernel_BUG_at_mm/vmalloc.c                                                   | 0          | 14         |
| invalid_opcode:#[##]                                                         | 0          | 14         |
| EIP:__get_vm_area_node                                                       | 0          | 14         |
| Kernel_panic-not_syncing:Fatal_exception_in_interrupt                        | 0          | 14         |
| WARNING:at_lib/iov_iter.c:#import_single_range                               | 0          | 1          |
| EIP:import_single_range                                                      | 0          | 1          |
+------------------------------------------------------------------------------+------------+------------+


If you fix the issue, kindly add following tag
Reported-by: kernel test robot <oliver.sang@...el.com>



[    7.186422][    C0] BUG: sleeping function called from invalid context at arch/x86/entry/common.c:161
[    7.186426][    C0] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: init
[    7.186427][    C0] preempt_count: 7ffffffe, expected: 0
[    7.186430][    C0] CPU: 0 PID: 1 Comm: init Not tainted 5.18.0-rc3-00017-g7d3fafb75102 #1
[    7.186433][    C0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[    7.186434][    C0] Call Trace:
[    7.186436][    C0]  ? show_stack+0x3d/0x45
[    7.186446][    C0]  dump_stack_lvl+0x34/0x44
[    7.186452][    C0]  dump_stack+0xd/0x10
[    7.186454][    C0]  __might_resched.cold+0x9c/0xad
[    7.186460][    C0]  __might_sleep+0x33/0x80
[    7.186464][    C0]  __might_fault+0x28/0x40
[    7.186468][    C0]  __do_fast_syscall_32+0x25/0x100
[    7.186473][    C0]  do_fast_syscall_32+0x29/0x80
[    7.186476][    C0]  do_SYSENTER_32+0x15/0x40
[    7.186479][    C0]  entry_SYSENTER_32+0x98/0xf1
[    7.186484][    C0] EIP: 0xb7f7c589
[    7.186486][    C0] Code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d 76 00 58 b8 77 00 00 00 cd 80 90 8d 76
[    7.186488][    C0] EAX: ffffffda EBX: 00000007 ECX: 00000056 EDX: 00000000
[    7.186490][    C0] ESI: 00000000 EDI: b7ef9ff4 EBP: bfd21140 ESP: bfd21140
[    7.186491][    C0] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000202
[    7.186496][    C0] BUG: scheduling while atomic: init/1/0x7fffffff
[    7.186498][    C0] Modules linked in:
[    7.186500][    C0] CPU: 0 PID: 1 Comm: init Tainted: G        W         5.18.0-rc3-00017-g7d3fafb75102 #1
[    7.186502][    C0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[    7.186502][    C0] Call Trace:
[    7.186503][    C0]  ? show_stack+0x3d/0x45
[    7.186506][    C0]  dump_stack_lvl+0x34/0x44
[    7.186508][    C0]  dump_stack+0xd/0x10
[    7.186511][    C0]  __schedule_bug.cold+0x49/0x57
[    7.186514][    C0]  __schedule+0x642/0x780
[    7.186516][    C0]  ? wait_task_inactive+0xaa/0x1c0
[    7.186519][    C0]  schedule+0x49/0xc0
[    7.186521][    C0]  exit_to_user_mode_prepare+0x11a/0x180
[    7.186525][    C0]  syscall_exit_to_user_mode+0x1b/0x40
[    7.186527][    C0]  __do_fast_syscall_32+0x65/0x100
[    7.186530][    C0]  do_fast_syscall_32+0x29/0x80
[    7.186532][    C0]  do_SYSENTER_32+0x15/0x40
[    7.186535][    C0]  entry_SYSENTER_32+0x98/0xf1
[    7.186538][    C0] EIP: 0xb7f7c589
[    7.186539][    C0] Code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d 76 00 58 b8 77 00 00 00 cd 80 90 8d 76
[    7.186540][    C0] EAX: 00000000 EBX: 00000007 ECX: 00000056 EDX: 00000000
[    7.186542][    C0] ESI: 00000000 EDI: b7ef9ff4 EBP: bfd211a8 ESP: bfd21140
[    7.186543][    C0] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000202
[    7.188748][    C0] ------------[ cut here ]------------
[    7.188750][    C0] WARNING: CPU: 0 PID: 1 at arch/x86/kernel/fpu/signal.c:206 copy_fpstate_to_sigframe+0x1b8/0x2c0
[    7.188758][    C0] Modules linked in:
[    7.188761][    C0] CPU: 0 PID: 1 Comm: init Tainted: G        W         5.18.0-rc3-00017-g7d3fafb75102 #1
[    7.188763][    C0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[    7.188764][    C0] EIP: copy_fpstate_to_sigframe+0x1b8/0x2c0
[    7.188767][    C0] Code: 0b 8b 40 04 8b 55 b4 e8 ce 13 96 00 64 ff 0d d4 06 1e cf eb b3 8d 74 26 00 90 3b bb 80 10 00 00 75 86 eb aa 8d b6 00 00 00 00 <0f> 0b e9 92 fe ff ff 90 39 75 b0 0f 84 c7 00 00 00 8b 55 b0 8b 45
[    7.188769][    C0] EAX: 000003b4 EBX: c114f600 ECX: c114e540 EDX: 00000000
[    7.188771][    C0] ESI: bfd20e00 EDI: fffffd28 EBP: c1139ea0 ESP: c1139e4c
[    7.188772][    C0] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00010246
[    7.188776][    C0] CR0: 80050033 CR2: b7e2bb60 CR3: 02f8e000 CR4: 000406f0
[    7.188778][    C0] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[    7.188779][    C0] DR6: fffe0ff0 DR7: 00000400
[    7.188780][    C0] Call Trace:
[    7.188783][    C0]  ? kmem_cache_free+0x280/0x2c0
[    7.188787][    C0]  ? bigsmp_ioapic_phys_id_map+0x80/0x80
[    7.188791][    C0]  ? kvm_guest_apic_eoi_write+0x29/0x40
[    7.188794][    C0]  ? sysvec_reschedule_ipi+0x70/0x100
[    7.188800][    C0]  get_sigframe+0x161/0x280
[    7.188807][    C0]  __setup_frame+0x3c/0x200
[    7.188810][    C0]  ? sysvec_reboot+0x40/0x40
[    7.188813][    C0]  handle_signal+0xea/0x180
[    7.188816][    C0]  arch_do_signal_or_restart+0xaa/0xc0
[    7.188819][    C0]  exit_to_user_mode_prepare+0x135/0x180
[    7.188823][    C0]  syscall_exit_to_user_mode+0x1b/0x40
[    7.188825][    C0]  __do_fast_syscall_32+0x65/0x100
[    7.188829][    C0]  do_fast_syscall_32+0x29/0x80
[    7.188831][    C0]  do_SYSENTER_32+0x15/0x40
[    7.188834][    C0]  entry_SYSENTER_32+0x98/0xf1
[    7.188839][    C0] EIP: 0xb7f7c589
[    7.188840][    C0] Code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d 76 00 58 b8 77 00 00 00 cd 80 90 8d 76
[    7.188842][    C0] EAX: 00000000 EBX: 00004201 ECX: 00000056 EDX: 00000000
[    7.188843][    C0] ESI: bfd211cc EDI: b7ef9ff4 EBP: bfd211e8 ESP: bfd21170
[    7.188845][    C0] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000212
[    7.188847][    C0] ---[ end trace 0000000000000000 ]---



To reproduce:

        # build kernel
	cd linux
	cp config-5.18.0-rc3-00017-g7d3fafb75102 .config
	make HOSTCC=gcc-11 CC=gcc-11 ARCH=i386 olddefconfig prepare modules_prepare bzImage modules
	make HOSTCC=gcc-11 CC=gcc-11 ARCH=i386 INSTALL_MOD_PATH=<mod-install-dir> modules_install
	cd <mod-install-dir>
	find lib/ | cpio -o -H newc --quiet | gzip > modules.cgz


        git clone https://github.com/intel/lkp-tests.git
        cd lkp-tests
        bin/lkp qemu -k <bzImage> -m modules.cgz job-script # job-script is attached in this email

        # if come across any failure that blocks the test,
        # please remove ~/.lkp and /lkp dir to run from a clean state.



-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



View attachment "config-5.18.0-rc3-00017-g7d3fafb75102" of type "text/plain" (141846 bytes)

View attachment "job-script" of type "text/plain" (4593 bytes)

Download attachment "dmesg.xz" of type "application/x-xz" (14360 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ