general protection fault: perf_prepare_sample

Severity

Panic/crash

Found by

perf_fuzzer: Vince Weaver

First Seen

4.20-rc5

Most recently Seen

4.20-rc5

Reproducible

No

Found On

haswell

Linux-kernel Mailing List Report

4 December 2018 -- perf: perf_fuzzer triggers GPF in perf_prepare_sample

Introduced by

Fixed by

?

Kernel Splat

  1. *** perf_fuzzer 0.32-rc0 *** by Vince Weaver
    
            Linux version 4.20.0-rc5 x86_64
            Processor: Intel 6/60/3
    
            Stopping after 30000
            Watchdog enabled with timeout 60s
            Will auto-exit if signal storm detected
            Seeding RNG from time 1543899043
    
            To reproduce, try:
                    echo 1 > /proc/sys/kernel/nmi_watchdog
                    echo 0 > /proc/sys/kernel/perf_event_paranoid
                    echo 1000 > /proc/sys/kernel/perf_event_max_sample_rate
                    ./perf_fuzzer -s 30000 -r 1543899043
    
            Fuzzing the following syscalls: mmap perf_event_open close read write ioctl fork prctl poll 
            Also attempting the following: signal-handler-on-overflow busy-instruction-loop accessing-perf-proc-and-sys-files trashing-the-mmap-page 
    
            Pid=13475, sleeping 1s
    
    ==================================================
    Starting fuzzing at 2018-12-03 23:50:44
    ==================================================
    Cannot open /sys/kernel/tracing/kprobe_events
    Iteration 10000, 113929 syscalls in 4.77 s (23.903 k syscalls/s)
            Open attempts: 106125  Successful: 901  Currently open: 2
                    EPERM : 9
                    ENOENT : 506
                    E2BIG : 9281
                    EBADF : 7328
                    EACCES : 4197
                    EINVAL : 83838
                    EOVERFLOW : 2
                    EOPNOTSUPP : 63
                    Trinity Type (Normal 156/26335)(Sampling 13/21214)(Global 677/26754)(Random 55/26423)
                    Type (Hardware 217/14886)(software 320/14236)(tracepoint 50/14233)(Cache 49/13240)(cpu 230/14300)(breakpoint 8/14154)(kprobe 0/808)(msr 9/839)(power 0/923)(uncore_imc 1/847)(uncore_cbox_0 2/816)(uncore_cbox_1 5/850)(uncore_cbox_2 0/863)(uncore_cbox_3 3/877)(uncore_arb 5/803)(cstate_core 1/833)(cstate_pkg 1/927)(i915 0/804)(#18 0/8)(>19 0/10878)
            Close:  899/899 Successful
            Read:   778/863 Successful
            Write:  0/815 Successful
            Ioctl:  276/887 Successful: (ENABLE 65/65)(DISABLE 47/47)(REFRESH 9/61)(RESET 78/78)(PERIOD 3/58)(SET_OUTPUT 2/73)(SET_FILTER 0/71)(ID 60/60)(SET_BPF 0/56)(PAUSE_OUTPUT 12/68)(QUERY_BPF 0/57)(MOD_ATTR 0/65)(#12 0/0)(#13 0/0)(#14 0/0)(>14 0/128)
            Mmap:   438/1070 Successful: (MMAP 438/1070)(TRASH 88/149)(READ 75/76)(UNMAP 437/985)(AUX 0/114)(AUX_READ 0/0)
            Prctl:  933/933 Successful
            Fork:   440/440 Successful
            Poll:   852/931 Successful
            Access: 114/911 Successful
            Overflows: 0  Recursive: 0
            SIGIOs due to RT signal queue full: 0
    Iteration 20000, 127761 syscalls in 4.33 s (29.523 k syscalls/s)
            Open attempts: 119707  Successful: 944  Currently open: 45
                    EPERM : 15
                    ENOENT : 577
                    E2BIG : 10589
                    EBADF : 8208
                    EACCES : 4610
                    UNKNOWN 19 : 1
                    EINVAL : 94690
                    EOVERFLOW : 4
                    EOPNOTSUPP : 69
                    Trinity Type (Normal 155/29912)(Sampling 17/29936)(Global 729/29741)(Random 43/30118)
                    Type (Hardware 228/16741)(software 340/16262)(tracepoint 43/16087)(Cache 54/15053)(cpu 241/15908)(breakpoint 14/15922)(kprobe 0/916)(msr 3/910)(power 2/1072)(uncore_imc 1/963)(uncore_cbox_0 4/909)(uncore_cbox_1 2/967)(uncore_cbox_2 6/924)(uncore_cbox_3 1/977)(uncore_arb 1/899)(cstate_core 1/904)(cstate_pkg 3/1036)(i915 0/945)(#18 0/8)(>19 0/12304)
            Close:  901/901 Successful
            Read:   814/885 Successful
            Write:  0/913 Successful
            Ioctl:  279/915 Successful: (ENABLE 70/70)(DISABLE 66/66)(REFRESH 5/48)(RESET 67/67)(PERIOD 5/70)(SET_OUTPUT 6/62)(SET_FILTER 0/68)(ID 55/55)(SET_BPF 0/88)(PAUSE_OUTPUT 5/68)(QUERY_BPF 0/67)(MOD_ATTR 0/56)(#12 0/0)(#13 0/0)(#14 0/0)(>14 0/130)
            Mmap:   499/1115 Successful: (MMAP 499/1115)(TRASH 96/149)(READ 98/103)(UNMAP 496/1004)(AUX 0/119)(AUX_READ 0/0)
            Prctl:  891/891 Successful
            Fork:   471/471 Successful
            Poll:   906/918 Successful
            Access: 108/927 Successful
            Overflows: 1  Recursive: 0
            SIGIOs due to RT signal queue full: 0
    [45050.698745] general protection fault: 0000 [#1] SMP PTI
    [45050.698745] CPU: 5 PID: 13475 Comm: perf_fuzzer Tainted: G        W         4.20.0-rc5 #124
    [45050.698746] Hardware name: LENOVO 10AM000AUS/SHARKBAY, BIOS FBKT72AUS 01/26/2014
    [45050.698746] RIP: 0010:perf_prepare_sample+0x82/0x4a0
    [45050.698746] Code: 06 4c 89 ea 4c 89 e6 e8 3c 54 ff ff 40 f6 c5 01 0f 85 28 01 00 00 40 f6 c5 20 74 1c 48 85 ed 0f 89 04 01 00 00 49 8b 44 24 70 <48> 8b 00 8d 04 c5 08 00 00 00 66 01 43 06 f7 c5 00 04 00 00 74 41
    [45050.698747] RSP: 0000:ffffc900206bfb00 EFLAGS: 00010082
    [45050.698747] RAX: dead000000000200 RBX: ffffc900206bfb58 RCX: 000000000000001f
    [45050.698747] RDX: 0000000000000000 RSI: 0000000025bbf56f RDI: 0000000000000000
    [45050.698748] RBP: 8000000000000275 R08: 0000000000000002 R09: 00000000000215c0
    [45050.698748] R10: 00008b25b2e2f5c8 R11: 0000000000000000 R12: ffffc900206bfc40
    [45050.698748] R13: ffff8880cf6d7800 R14: ffffc900206bfb98 R15: ffff88811ab4f420
    [45050.698748] FS:  00007fab66133500(0000) GS:ffff88811ab40000(0000) knlGS:0000000000000000
    [45050.698749] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [45050.698749] CR2: 00007fab66133480 CR3: 00000000811aa004 CR4: 00000000001607e0
    [45050.698749] DR0: 0000000000000000 DR1: 000000008e8e8000 DR2: 0000000000000000
    [45050.698749] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
    [45050.698750] Call Trace:
    [45050.698750]  intel_pmu_drain_bts_buffer+0x151/0x220
    [45050.698750]  ? mem_cgroup_commit_charge+0x7a/0x510
    [45050.698750]  ? wp_page_copy+0x39e/0x650
    [45050.698750]  ? reuse_swap_page+0x129/0x340
    [45050.698751]  ? _raw_spin_unlock+0xa/0x10
    [45050.698751]  ? do_wp_page+0x30f/0x4d0
    [45050.698751]  ? finish_mkwrite_fault+0x140/0x140
    [45050.698751]  ? __handle_mm_fault+0xb22/0x12c0
    [45050.698751]  intel_pmu_handle_irq+0x6d/0x160
    [45050.698752]  perf_event_nmi_handler+0x2d/0x50
    [45050.698752]  nmi_handle+0x63/0x110
    [45050.698752]  default_do_nmi+0x4e/0x100
    [45050.698752]  do_nmi+0x112/0x170
    [45050.698752]  nmi+0x8b/0xd4
    [45050.698753] RIP: 0033:0x558a6a6366c3
    [45050.698753] Code: 01 d0 48 c1 e0 06 48 89 c2 48 8d 05 cf 93 23 00 48 8b 04 02 48 85 c0 74 11 8b 45 f8 3b 45 f4 75 05 8b 45 fc eb 16 83 45 f8 01 <83> 45 fc 01 81 7d fc 9f 86 01 00 7e 96 b8 ff ff ff ff c9 c3 55 48
    [45050.698753] RSP: 002b:00007ffc9f521660 EFLAGS: 00000246
    [45050.698754] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000030
    [45050.698754] RDX: 000000000000e740 RSI: 00007ffc9f521634 RDI: 00007fab6612c740
    [45050.698754] RBP: 00007ffc9f521670 R08: 00007fab6612c1f0 R09: 00007fab6612c240
    [45050.698754] R10: 00007fab661337d0 R11: 0000000000000246 R12: 0000558a6a6364c0
    [45050.698755] R13: 00007ffc9f523ad0 R14: 0000000000000000 R15: 0000000000000000
    [45050.698755] Modules linked in: intel_rapl x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec_hdmi snd_hda_intel coretemp tpm_tis snd_hda_codec snd_hda_core kvm_intel tpm_tis_core i915 snd_hwdep kvm tpm snd_pcm rng_core wmi_bmof mei_me sg iosf_mbi irqbypass drm_kms_helper evdev crct10dif_pclmul drm mei iTCO_wdt i2c_algo_bit iTCO_vendor_support snd_timer pcc_cpufreq crc32_pclmul ghash_clmulni_intel aesni_intel snd video aes_x86_64 crypto_simd cryptd glue_helper soundcore pcspkr wmi button binfmt_misc ip_tables x_tables autofs4 sr_mod sd_mod cdrom ahci libahci ehci_pci xhci_pci libata xhci_hcd ehci_hcd lpc_ich mfd_core crc32c_intel scsi_mod e1000e i2c_i801 usbcore usb_common fan thermal[45051.027024] ---[ end trace 9565944010fbdf23 ]---
    [45051.027024] RIP: 0010:perf_prepare_sample+0x82/0x4a0
    [45051.027025] Code: 06 4c 89 ea 4c 89 e6 e8 3c 54 ff ff 40 f6 c5 01 0f 85 28 01 00 00 40 f6 c5 20 74 1c 48 85 ed 0f 89 04 01 00 00 49 8b 44 24 70 <48> 8b 00 8d 04 c5 08 00 00 00 66 01 43 06 f7 c5 00 04 00 00 74 41
    [45051.027025] RSP: 0000:ffffc900206bfb00 EFLAGS: 00010082
    [45051.027025] RAX: dead000000000200 RBX: ffffc900206bfb58 RCX: 000000000000001f
    [45051.027025] RDX: 0000000000000000 RSI: 0000000025bbf56f RDI: 0000000000000000
    [45051.027026] RBP: 8000000000000275 R08: 0000000000000002 R09: 00000000000215c0
    [45051.027026] R10: 00008b25b2e2f5c8 R11: 0000000000000000 R12: ffffc900206bfc40
    [45051.027026] R13: ffff8880cf6d7800 R14: ffffc900206bfb98 R15: ffff88811ab4f420
    [45051.027027] FS:  00007fab66133500(0000) GS:ffff88811ab40000(0000) knlGS:0000000000000000
    [45051.027027] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [45051.027027] CR2: 00007fab66133480 CR3: 00000000811aa004 CR4: 00000000001607e0
    [45051.027027] DR0: 0000000000000000 DR1: 000000008e8e8000 DR2: 0000000000000000
    [45051.027027] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
    [45051.027028] Kernel panic - not syncing: Fatal exception in interrupt
    [45051.027051] Kernel Offset: disabled
    [45051.149441] ---[ end Kernel panic - not syncing: Fatal exception in interrupt]---
    

Back to perf_fuzzer bugs found