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-next>] [day] [month] [year] [list]
Message-ID: <20210301074027.GD12822@xsang-OptiPlex-9020>
Date:   Mon, 1 Mar 2021 15:40:27 +0800
From:   kernel test robot <oliver.sang@...el.com>
To:     Sami Tolvanen <samitolvanen@...gle.com>
Cc:     Kees Cook <keescook@...omium.org>,
        LKML <linux-kernel@...r.kernel.org>, lkp@...ts.01.org,
        lkp@...el.com
Subject: [x86, build]  6dafca9780:
 WARNING:at_arch/x86/kernel/ftrace.c:#ftrace_verify_code


Greeting,

FYI, we noticed the following commit (built with clang-13):

commit: 6dafca97803309c3cb5148d449bfa711e41ddef2 ("x86, build: use objtool mcount")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master


in testcase: trinity
version: trinity-x86_64-4d2343bd-1_20210105
with following parameters:

	group: ["group-00", "group-01", "group-02", "group-03", "group-04"]

test-description: Trinity is a linux system call fuzz tester.
test-url: http://codemonkey.org.uk/projects/trinity/


on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 8G

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


+---------------------------------------------------------+------------+------------+
|                                                         | 22c8542d7b | 6dafca9780 |
+---------------------------------------------------------+------------+------------+
| WARNING:at_arch/x86/kernel/ftrace.c:#ftrace_verify_code | 0          | 18         |
| RIP:ftrace_verify_code                                  | 0          | 18         |
| WARNING:at_kernel/trace/ftrace.c:#ftrace_bug            | 0          | 18         |
| RIP:ftrace_bug                                          | 0          | 18         |
+---------------------------------------------------------+------------+------------+


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


[    4.743393] WARNING: CPU: 0 PID: 1 at arch/x86/kernel/ftrace.c:96 ftrace_verify_code (kbuild/src/consumer/arch/x86/kernel/ftrace.c:96) 
[    4.744022] Modules linked in:
[    4.744254] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.11.0-rc2-00022-g6dafca978033 #2
[    4.744827] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[    4.745423] RIP: 0010:ftrace_verify_code (kbuild/src/consumer/arch/x86/kernel/ftrace.c:96) 
[ 4.745776] Code: 03 33 03 8a 4c 24 07 32 4b 04 0f b6 c9 09 c1 74 41 48 c7 c7 a0 30 22 83 be 01 00 00 00 31 d2 b9 01 00 00 00 e8 4e 23 1b 00 90 <0f> 0b 90 bb ea ff ff ff 48 c7 c7 d0 30 22 83 be 01 00 00 00 31 d2
All code
========
   0:	03 33                	add    (%rbx),%esi
   2:	03 8a 4c 24 07 32    	add    0x3207244c(%rdx),%ecx
   8:	4b 04 0f             	rex.WXB add $0xf,%al
   b:	b6 c9                	mov    $0xc9,%dh
   d:	09 c1                	or     %eax,%ecx
   f:	74 41                	je     0x52
  11:	48 c7 c7 a0 30 22 83 	mov    $0xffffffff832230a0,%rdi
  18:	be 01 00 00 00       	mov    $0x1,%esi
  1d:	31 d2                	xor    %edx,%edx
  1f:	b9 01 00 00 00       	mov    $0x1,%ecx
  24:	e8 4e 23 1b 00       	callq  0x1b2377
  29:	90                   	nop
  2a:*	0f 0b                	ud2    		<-- trapping instruction
  2c:	90                   	nop
  2d:	bb ea ff ff ff       	mov    $0xffffffea,%ebx
  32:	48 c7 c7 d0 30 22 83 	mov    $0xffffffff832230d0,%rdi
  39:	be 01 00 00 00       	mov    $0x1,%esi
  3e:	31 d2                	xor    %edx,%edx

Code starting with the faulting instruction
===========================================
   0:	0f 0b                	ud2    
   2:	90                   	nop
   3:	bb ea ff ff ff       	mov    $0xffffffea,%ebx
   8:	48 c7 c7 d0 30 22 83 	mov    $0xffffffff832230d0,%rdi
   f:	be 01 00 00 00       	mov    $0x1,%esi
  14:	31 d2                	xor    %edx,%edx
[    4.747093] RSP: 0000:ffff8881003cbb50 EFLAGS: 00010202
[    4.747472] RAX: 0000000066227969 RBX: ffffffff82204214 RCX: 0000000000000001
[    4.748050] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffffff832230b8
[    4.748568] RBP: 0000000000000001 R08: 00000000a0000002 R09: 0000000040000000
[    4.749081] R10: 0000000000000001 R11: 0000000080000000 R12: 0000000000000000
[    4.749594] R13: 00000000009aa301 R14: 0000000000000001 R15: ffff88810009f9f0
[    4.750110] FS:  0000000000000000(0000) GS:ffff88823fa00000(0000) knlGS:0000000000000000
[    4.750690] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    4.751110] CR2: 0000000000000000 CR3: 0000000002c12000 CR4: 00000000000406b0
[    4.751625] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    4.752145] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[    4.752659] Call Trace:
[    4.754727] ftrace_replace_code (kbuild/src/consumer/arch/x86/kernel/ftrace.c:220) 
[    4.755046] ftrace_modify_all_code (kbuild/src/consumer/kernel/trace/ftrace.c:2691) 
[    4.755378] ftrace_run_update_code (kbuild/src/consumer/kernel/trace/ftrace.c:2770) 
[    4.755709] ftrace_startup (kbuild/src/consumer/kernel/trace/ftrace.c:2897) 
[    4.755997] register_ftrace_function (kbuild/src/consumer/kernel/trace/ftrace.c:7516) 
[    4.756335] arm_kprobe_ftrace (kbuild/src/consumer/kernel/kprobes.c:1049 kbuild/src/consumer/kernel/kprobes.c:1071) 
[    4.756631] enable_kprobe (kbuild/src/consumer/kernel/kprobes.c:2189) 
[    4.756904] enable_trace_kprobe (kbuild/src/consumer/kernel/trace/trace_kprobe.c:381) 
[    4.757220] __ftrace_event_enable_disable (kbuild/src/consumer/kernel/trace/trace_events.c:457) 
[    4.757605] __ftrace_set_clr_event_nolock (kbuild/src/consumer/kernel/trace/trace_events.c:818) 
[    4.758002] trace_array_set_clr_event (kbuild/src/consumer/kernel/trace/trace_events.c:833 kbuild/src/consumer/kernel/trace/trace_events.c:924) 
[    4.758352] test_gen_kprobe_cmd (kbuild/src/consumer/kernel/trace/kprobe_event_gen_test.c:95) 
[    4.758676] ? kprobe_event_cmd_init (kbuild/src/consumer/kernel/trace/trace_kprobe.c:924) 
[    4.759007] ? init_trace_printk (kbuild/src/consumer/kernel/trace/kprobe_event_gen_test.c:176) 
[    4.759310] kprobe_event_gen_test_init (kbuild/src/consumer/kernel/trace/kprobe_event_gen_test.c:179) 
[    4.759654] do_one_initcall (kbuild/src/consumer/init/main.c:1217) 
[    4.759947] ? native_sched_clock (kbuild/src/consumer/arch/x86/kernel/tsc.c:243) 
[    4.760272] ? sched_clock_cpu (kbuild/src/consumer/kernel/sched/clock.c:273 kbuild/src/consumer/kernel/sched/clock.c:382) 
[    4.760571] ? pvclock_clocksource_read (kbuild/src/consumer/arch/x86/kernel/pvclock.c:80) 
[    4.760927] ? __fs_reclaim_release (kbuild/src/consumer/mm/page_alloc.c:4328) 
[    4.761248] ? kvm_sched_clock_read (kbuild/src/consumer/arch/x86/include/asm/preempt.h:84 kbuild/src/consumer/arch/x86/kernel/kvmclock.c:90 kbuild/src/consumer/arch/x86/kernel/kvmclock.c:101) 
[    4.761571] ? sched_clock (kbuild/src/consumer/arch/x86/include/asm/paravirt.h:22 kbuild/src/consumer/arch/x86/kernel/tsc.c:252) 
[    4.761834] ? sched_clock_cpu (kbuild/src/consumer/kernel/sched/clock.c:273 kbuild/src/consumer/kernel/sched/clock.c:382) 
[    4.762138] ? parse_args (kbuild/src/consumer/kernel/params.c:153 kbuild/src/consumer/kernel/params.c:188) 
[    4.762432] do_initcall_level (kbuild/src/consumer/init/main.c:1289) 
[    4.762730] do_initcalls (kbuild/src/consumer/init/main.c:1303) 
[    4.763019] ? rest_init (kbuild/src/consumer/init/main.c:1412) 
[    4.763291] kernel_init_freeable (kbuild/src/consumer/init/main.c:1534) 
[    4.763601] kernel_init (kbuild/src/consumer/init/main.c:1417) 
[    4.763864] ret_from_fork (kbuild/src/consumer/arch/x86/entry/entry_64.S:302) 
[    4.764159] ---[ end trace cde667a4bb4795ca ]---
[    4.764496] ------------[ ftrace bug ]------------
[    4.764847] ftrace failed to modify
[    4.764852] do_sys_open (kbuild/src/consumer/fs/open.c:1186) 
[    4.765483]  actual:   0f:1f:44:00:00
[    4.765784] Setting ftrace call site to call ftrace function
[    4.766193] ftrace record flags: 50000001
[    4.766490]  (1) R
[    4.766490]  expected tramp: ffffffff81037af0
[    4.766959] ------------[ cut here ]------------


To reproduce:

        # build kernel
	cd linux
	cp config-5.11.0-rc2-00022-g6dafca978033 .config
	make HOSTCC=clang-13 CC=clang-13 ARCH=x86_64 olddefconfig prepare modules_prepare bzImage

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



Thanks,
Oliver Sang


View attachment "config-5.11.0-rc2-00022-g6dafca978033" of type "text/plain" (120427 bytes)

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

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

View attachment "trinity" of type "text/plain" (14768 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ