Greetings,
0day kernel testing robot got the below dmesg and the first bad commit is
https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/kprobes-x86-Do-...
commit cca5328fff71092ac073c929dcc659f5c24fcb57
Author: Masami Hiramatsu <mhiramat(a)kernel.org>
AuthorDate: Tue Jul 25 23:54:49 2017 +0900
Commit: 0day robot <fengguang.wu(a)intel.com>
CommitDate: Thu Jul 27 04:20:04 2017 +0800
kprobes/x86: Do not jump-optimize kprobes on irq entry code
Since the kernel segment registers are not prepared at the
entry of irq-entry code, if a kprobe on such code is
jump-optimized, accessing per-cpu variables may cause
kernel panic.
However, if the kprobe is not optimized, it kicks int3
exception and set segment registers correctly.
This checks probe-address and if it is in irq-entry code,
it prohibits optimizing such kprobes. This means we can
continuously probing such interrupt handlers by kprobes
but it is not optimized anymore.
Signed-off-by: Masami Hiramatsu <mhiramat(a)kernel.org>
Reported-by: Francis Deslauriers <francis.deslauriers(a)efficios.com>
Tested-by: Francis Deslauriers <francis.deslauriers(a)efficios.com>
6602ec8ef2 Merge branch 'x86/syscall'
cca5328fff kprobes/x86: Do not jump-optimize kprobes on irq entry code
cca5328fff kprobes/x86: Do not jump-optimize kprobes on irq entry code
+------------------------------------------+------------+------------+------------+
| | 6602ec8ef2 | cca5328fff | cca5328fff |
+------------------------------------------+------------+------------+------------+
| boot_successes | 37 | 4 | 4 |
| boot_failures | 0 | 11 | 11 |
| BUG:unable_to_handle_kernel | 0 | 11 | 11 |
| Oops:#[##] | 0 | 11 | 11 |
| EIP:__do_softirq | 0 | 11 | 11 |
| Kernel_panic-not_syncing:Fatal_exception | 0 | 11 | 11 |
+------------------------------------------+------------+------------+------------+
[ 45.891147] Freeing unused kernel memory: 1208K
[ 45.894442] Write protecting the kernel text: 15172k
[ 45.897757] Write protecting the kernel read-only data: 6568k
[ 45.899314] NX-protecting the kernel data: 13500k
[ 45.903478] kernel tried to execute NX-protected page - exploit attempt? (uid: 0)
[ 45.905493] BUG: unable to handle kernel paging request at c1ed113d
[ 45.907011] IP: __do_softirq+0x0/0x937
[ 45.908056] *pdpt = 0000000002aa5001 *pde = 000000000e352063
[ 45.908064] *pte = 8000000001ed1161
[ 45.909446]
[ 45.911096] Oops: 0011 [#1] PREEMPT
[ 45.912104] Modules linked in:
[ 45.912990] CPU: 0 PID: 1 Comm: swapper Not tainted 4.13.0-rc1-00476-gcca5328f #1
[ 45.914919] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.9.3-20161025_171302-gandalf 04/01/2014
[ 45.917378] task: cf48c040 task.stack: cf48e000
[ 45.918606] EIP: __do_softirq+0x0/0x937
[ 45.919624] EFLAGS: 00210086 CPU: 0
[ 45.920594] EAX: cf48fdec EBX: cf48fdec ECX: 00000001 EDX: 00000001
[ 45.922105] ESI: cf48fe20 EDI: c1ed113d EBP: cf48fdf4 ESP: cf423ffc
[ 45.923602] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
[ 45.924967] CR0: 80050033 CR2: c1ed113d CR3: 02aa8000 CR4: 001406f0
[ 45.926433] Call Trace:
[ 45.927254] <SOFTIRQ>
[ 45.928028] ? do_softirq_own_stack+0x52/0x74
[ 45.929189] </SOFTIRQ>
[ 45.929989] ? irq_exit+0xd1/0x1c8
[ 45.930952] ? common_interrupt+0x36/0x3c
[ 45.950944] ? lock_acquire+0x2b0/0x37a
[ 45.952008] ? __change_page_attr_set_clr+0x65/0x372
[ 45.953259] ? _raw_spin_lock+0x60/0x100
[ 45.954311] ? __change_page_attr_set_clr+0x65/0x372
[ 45.955585] ? __change_page_attr_set_clr+0x65/0x372
[ 45.956878] ? mutex_unlock+0x27/0x37
[ 45.957867] ? vm_unmap_aliases+0x333/0x349
[ 45.959028] ? change_page_attr_set_clr+0x2c0/0x7cd
[ 45.960231] ? set_memory_nx+0x47/0x5a
[ 45.961271] ? setup_arch+0x292/0x164e
[ 45.962309] ? set_pages_nx+0x30/0x40
[ 45.963339] ? mark_rodata_ro+0x16c/0x190
[ 45.964439] ? rest_init+0x453/0x453
[ 45.965435] ? kernel_init+0x66/0x235
[ 45.966475] ? ret_from_fork+0x19/0x24
[ 45.967465] Code: ff 13 83 05 10 15 ac c2 01 83 15 14 15 ac c2 00 83 c3 0c 83 3b 00 75
e0 83 05 18 15 ac c2 01 83 15 1c 15 ac c2 00 e9 41 fd ff ff <55> 89 e5 57 56 53 83
ec 20 a1 40 f3 6d c2 83 05 80 40 af c2 01
[ 45.972047] EIP: __do_softirq+0x0/0x937 SS:ESP: 0068:cf423ffc
[ 45.973423] CR2: 00000000c1ed113d
[ 45.974376] ---[ end trace 5676b89fab0f2fbb ]---
[ 45.975563] Kernel panic - not syncing: Fatal exception
# HH:MM RESULT GOOD BAD
GOOD_BUT_DIRTY DIRTY_NOT_BAD
git bisect start 51e09adedfe4b7452dd284ab6b058a234be9649d
520eccdfe187591a51ea9ab4c1a024ae4d0f68d9 --
git bisect bad 7db2e4ee44df8b814356674309a0545e513888c3 # 06:26 B 0 11 24 0
Merge
'linux-review/Matt-Brown/powerpc-lib-sstep-Add-cmpb-instruction-emulation/20170726-040048'
into devel-spot-201707280347
git bisect good 2f788d78b871ae4d64e20f0303d5e099d12a1b2d # 06:40 G 11 0 0 0
Merge 'linux-review/Jan-Glauber/Cavium-ARM64-uncore-PMU-support/20170727-053306'
into devel-spot-201707280347
git bisect bad 43b5d3ce3bfb8cea1c1ef8a6f00f5108ef1e93d1 # 06:54 B 0 11 24 0
Merge
'linux-review/Tonghao-Zhang/drivers-net-Fix-ptr_ret-cocci-warnings/20170726-173642'
into devel-spot-201707280347
git bisect bad f11df8a9142aaab75c9ed6dde1834a4219ce5bfe # 07:13 B 0 7 20 0
Merge
'linux-review/Jeff-Layton/ceph-make-kcephfs-use-errseq_t-for-writeback-error-reporting/20170727-031817'
into devel-spot-201707280347
git bisect good d9b282859fb6b3166ef9098b0278bb3cd31547d5 # 07:26 G 11 0 0 0
Merge
'linux-review/Shaokun-Zhang/Add-HiSilicon-SoC-uncore-Performance-Monitoring-Unit-driver/20170727-042522'
into devel-spot-201707280347
git bisect bad 54d6fb643519ac3f9b690acb74f4dda49d95881f # 07:37 B 0 4 17 0
Merge
'linux-review/Thierry-Escande/v4l2-Add-support-for-go2001-PCI-codec-driver/20170727-033126'
into devel-spot-201707280347
git bisect bad 8c2ccb03a4a4bdbabd6bad07df11ad3a88b177b5 # 07:54 B 0 2 15 0
Merge
'linux-review/Masami-Hiramatsu/kprobes-x86-Do-not-jump-optimize-kprobes-on-irq-entry-code/20170727-041957'
into devel-spot-201707280347
git bisect bad cca5328fff71092ac073c929dcc659f5c24fcb57 # 08:13 B 0 2 15 0
kprobes/x86: Do not jump-optimize kprobes on irq entry code
# first bad commit: [cca5328fff71092ac073c929dcc659f5c24fcb57] kprobes/x86: Do not
jump-optimize kprobes on irq entry code
git bisect good 6602ec8ef2244e2d75d2a3b2e10f09469b9e319f # 08:34 G 33 0 0 0
Merge branch 'x86/syscall'
# extra tests with CONFIG_DEBUG_INFO_REDUCED
git bisect bad cca5328fff71092ac073c929dcc659f5c24fcb57 # 08:52 B 0 11 24 0
kprobes/x86: Do not jump-optimize kprobes on irq entry code
# extra tests on HEAD of linux-devel/devel-spot-201707280347
git bisect bad 51e09adedfe4b7452dd284ab6b058a234be9649d # 08:52 B 0 25 50 8
0day head guard for 'devel-spot-201707280347'
# extra tests on tree/branch
linux-review/Masami-Hiramatsu/kprobes-x86-Do-not-jump-optimize-kprobes-on-irq-entry-code/20170727-041957
git bisect bad cca5328fff71092ac073c929dcc659f5c24fcb57 # 08:52 B 0 11 25 0
kprobes/x86: Do not jump-optimize kprobes on irq entry code
# extra tests with first bad commit reverted
git bisect good c5f19e45449e6de96a66e2ba11e393276cd0cc0e # 09:11 G 11 0 0 0
Revert "kprobes/x86: Do not jump-optimize kprobes on irq entry code"
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/lkp Intel Corporation