Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

linux - Kernel Oops dump: why is the stack data missing?

I wanted to see what the kernel Oops dump looks like, so I just embedded a NULL deference in a simple module and tried to trigger it. However, unlike most of the examples online (e.g. this one), my oops message did not include the data on the stack. Is it because that I didn't configure the kernel correctly, or is it because some specific type of error won't have the Stack information in the oops message? My environment: Ubuntu 18.04.5 LTS + Linux v5.9.

kernel: [1585687.978117] BUG: kernel NULL pointer dereference, address: 0000000000000000
kernel: [1585687.978122] #PF: supervisor write access in kernel mode
kernel: [1585687.978126] #PF: error_code(0x0002) - not-present page
kernel: [1585687.978129] PGD 0 P4D 0 
kernel: [1585687.978137] Oops: 0002 [#5] SMP PTI
kernel: [1585687.978144] CPU: 3 PID: 28365 Comm: cat Tainted: G      D    OE     5.9.0+ #1
kernel: [1585687.978148] Hardware name: LENOVO 90HV001MUS/36EB, BIOS O3QKT3DA 05/29/2020
kernel: [1585687.978156] RIP: 0010:scull_read1+0x9/0x1b [scull]
kernel: [1585687.978162] Code: 00 00 00 00 eb f7 0f 1f 44 00 00 55 48 89 e5 5d c3 0f 1f 44 00 00 55 48 89 e5 b8 00 00 00 00 5d c3 0f 1f 44 00 00 55 48 89 e5 <c7> 04 25 00 00 00 00 00 00 00 00 b8 00 00 00 00 5d c3 0f 1f 44 00
kernel: [1585687.978167] RSP: 0018:ffffb42781e3fea0 EFLAGS: 00010282
kernel: [1585687.978172] RAX: ffffffffc0dd808a RBX: 0000000000020000 RCX: ffffb42781e3fef0
kernel: [1585687.978176] RDX: 0000000000020000 RSI: 00007ff8c902e000 RDI: ffff8c987eec0000
kernel: [1585687.978179] RBP: ffffb42781e3fea0 R08: 0000000000000000 R09: ffff8c987e3d0340
kernel: [1585687.978182] R10: ffffb42781e3fe68 R11: 0000000000000000 R12: 0000000000000000
kernel: [1585687.978186] R13: 00007ff8c902e000 R14: ffffb42781e3fef0 R15: ffff8c987eec0000
kernel: [1585687.978190] FS:  00007ff8c9050540(0000) GS:ffff8c99a6580000(0000) knlGS:0000000000000000
kernel: [1585687.978194] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: [1585687.978198] CR2: 0000000000000000 CR3: 0000000004076004 CR4: 00000000003706e0
kernel: [1585687.978201] Call Trace:
kernel: [1585687.978212]  vfs_read+0xa7/0x190
kernel: [1585687.978219]  ksys_read+0xa7/0xe0
kernel: [1585687.978225]  __x64_sys_read+0x1a/0x20
kernel: [1585687.978233]  do_syscall_64+0x37/0x80
kernel: [1585687.978239]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
kernel: [1585687.978243] RIP: 0033:0x7ff8c8b59151
kernel: [1585687.978249] Code: fe ff ff 48 8d 3d 3f 9b 0a 00 48 83 ec 08 e8 66 4a 02 00 66 0f 1f 44 00 00 48 8d 05 91 08 2e 00 8b 00 85 c0 75 13 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 57 f3 c3 0f 1f 44 00 00 41 54 55 49 89 d4 53
kernel: [1585687.978253] RSP: 002b:00007ffd8d944b88 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
kernel: [1585687.978258] RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007ff8c8b59151
kernel: [1585687.978261] RDX: 0000000000020000 RSI: 00007ff8c902e000 RDI: 0000000000000003
kernel: [1585687.978264] RBP: 0000000000020000 R08: 00000000ffffffff R09: 0000000000000000
kernel: [1585687.978268] R10: 0000000000000022 R11: 0000000000000246 R12: 00007ff8c902e000
kernel: [1585687.978271] R13: 0000000000000003 R14: 00007ff8c902e00f R15: 0000000000020000
kernel: [1585687.978276] Modules linked in: scull(OE) btrfs blake2b_generic xor zstd_compress raid6_pq ufs qnx4 hfsplus hfs minix ntfs msdos jfs xfs libcrc32c cpuid rfcomm ccm cmac bnep nls_iso8859_1 snd_sof_pci iwlmvm snd_sof_intel_byt snd_sof_intel_ipc snd_sof_intel_hda_common snd_soc_hdac_hda mac80211 snd_sof_xtensa_dsp intel_rapl_msr snd_sof_intel_hda snd_sof mei_hdcp snd_hda_codec_hdmi intel_rapl_common snd_hda_ext_core snd_hda_codec_realtek snd_soc_acpi_intel_match snd_hda_codec_generic x86_pkg_temp_thermal intel_powerclamp snd_soc_acpi ledtrig_audio snd_soc_core coretemp btusb i915 libarc4 snd_compress btrtl ac97_bus btbcm snd_pcm_dmaengine btintel kvm_intel bluetooth kvm iwlwifi crct10dif_pclmul crc32_pclmul snd_hda_intel snd_intel_dspcfg snd_hda_codec ghash_clmulni_intel snd_hda_core aesni_intel crypto_simd cryptd glue_helper snd_hwdep efi_pstore rapl snd_pcm drm_kms_helper intel_cstate input_leds wmi_bmof snd_seq_midi intel_wmi_thunderbolt snd_seq_midi_event cec snd_rawmidi snd_seq drm
kernel: [1585687.978402]  ecdh_generic ecc cfg80211 snd_seq_device i2c_algo_bit fb_sys_fops snd_timer syscopyarea sysfillrect mei_me snd sysimgblt mei acpi_tad acpi_pad mac_hid soundcore sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_logitech_hidpp hid_logitech_dj hid_generic uas usbhid usb_storage hid ahci e1000e libahci wmi video [last unloaded: scull]
kernel: [1585687.978463] CR2: 0000000000000000
kernel: [1585687.978469] ---[ end trace 3350b6a415ac3a6e ]---
kernel: [1585688.081953] RIP: 0010:0xffffffffc0de4093
kernel: [1585688.081956] Code: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc <cc> cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
kernel: [1585688.081957] RSP: 0018:ffffb42781e6fea0 EFLAGS: 00010282
kernel: [1585688.081958] RAX: ffffffffc0de408a RBX: 0000000000020000 RCX: ffffb42781e6fef0
kernel: [1585688.081959] RDX: 0000000000020000 RSI: 00007f3e58367000 RDI: ffff8c987efdfe00
kernel: [1585688.081960] RBP: ffffb42781e6fea0 R08: 0000000000000000 R09: ffff8c9875710340
kernel: [1585688.081961] R10: ffffb42781e6fe68 R11: 0000000000000000 R12: 0000000000000000
kernel: [1585688.081962] R13: 00007f3e58367000 R14: ffffb42781e6fef0 R15: ffff8c987efdfe00
kernel: [1585688.081963] FS:  00007ff8c9050540(0000) GS:ffff8c99a6580000(0000) knlGS:0000000000000000
kernel: [1585688.081964] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: [1585688.081965] CR2: 0000000000000000 CR3: 0000000004076004 CR4: 00000000003706e0
question from:https://stackoverflow.com/questions/65948146/kernel-oops-dump-why-is-the-stack-data-missing

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...