From: Paul Menzel <pmenzel+linux-pci@molgen.mpg.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: NULL pointer dereference in msi_set_mask_bit
Date: Wed, 18 Jul 2018 18:37:46 +0200 [thread overview]
Message-ID: <178bb701-56af-06cf-4836-1a26e74f2b07@molgen.mpg.de> (raw)
In-Reply-To: <alpine.DEB.2.21.1807181722020.1568@nanos.tec.linutronix.de>
[-- Attachment #1.1: Type: text/plain, Size: 4419 bytes --]
[I removed the folks from the unrelated patches.]
Dear Thomas,
On 07/18/18 17:39, Thomas Gleixner wrote:
> On Wed, 18 Jul 2018, Paul Menzel wrote:
>> On 07/18/18 17:02, Thomas Gleixner wrote:
>>>>> 93.885: [ 23.020572] BUG: unable to handle kernel NULL pointer dereference at 000000000000003c
>>>>> 93.885: [ 23.029011] PGD 0 P4D 0
>>>>> 93.885: [ 23.031670] Oops: 0000 [#1] SMP NOPTI
>>>>> 93.885: [ 23.035455] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.18.0-rc5+ #1
>>>>> 93.885: [ 23.042079] Hardware name: MSI MS-7A37/B350M MORTAR (MS-7A37), BIOS 1.G1 05/17/2018
>>>>> 93.886: [ 23.049868] RIP: 0010:msi_set_mask_bit+0xe/0x70
>>>
>>>>> 93.913: [ 23.049868] Code: 00 53 48 89 fb e8 12 f8 ff ff 48 89 df 5b e9 c9 fe ff ff 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 53 48 8b 47 10 48 8b 58 10 <f6> 43 3c 01 74 3c 8b 15 2e 85 21 01 31 c0 85 d2 75 25 8b 43 38 48
>>>
>>> f6 43 3c 01 testb $0x1,0x3c(%rbx)
>>>
>>> That's:
>>>
>>> if (desc->msi_attrib.is_msix)
>>
>> Is there a tool to translate that?
>
> That tool is called brain :)
>
> Seriously, what you can do is run the 'Code: ...' line through
> scripts/decodecode and that will show you the disassembly. Now staring at
> msi_set_mask_bit() makes it pretty obvious which part it is and the offset of
> msi_attrib in msi_desc is 0x3c, which matches the BUG: line above. You can
> figure that out by counting or by using pahole.
>
> Of course if you have the vmlinux around then scripts/faddr2line is what
> you want to use.
Thank you for the explanation. I’ll keep that in mind for the future.
>>>>> 93.957: [ 23.049880] RSP: 0018:ffff9e8e5e803f78 EFLAGS: 00010046
>>>>> 93.957: [ 23.049881] RAX: ffff9e8e45919000 RBX: 0000000000000000 RCX: 0000000000000000
>>>>> 93.958: [ 23.049882] RDX: ffff9e8e45919000 RSI: 0000000000000001 RDI: ffff9e8e45919098
>>>>> 93.958: [ 23.049882] RBP: ffff9e8e45919098 R08: 0000000000000000 R09: 0000000000000000
>>>>> 93.958: [ 23.049882] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9e8e45919000
>>>>> 93.958: [ 23.049883] R13: 0000000000000027 R14: 0000000000000000 R15: 0000000000000000
>>>>> 93.959: [ 23.049884] FS: 0000000000000000(0000) GS:ffff9e8e5e800000(0000) knlGS:0000000000000000
>>>>> 93.959: [ 23.049884] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>>>> 93.959: [ 23.049885] CR2: 000000000000003c CR3: 00000003fc5a4000 CR4: 00000000003406f0
>>>>> 93.959: [ 23.049885] Call Trace:
>>>>> 93.959: [ 23.049887] <IRQ>
>>>>> 93.960: [ 23.049889] __irq_move_irq+0x3c/0x70
>>>>> 93.960: [ 23.049892] apic_ack_irq+0x2b/0x30
>>>>> 93.960: [ 23.049893] handle_edge_irq+0x7d/0x1d0
>>>>> 93.960: [ 23.049895] handle_irq+0x1f/0x30
>>>>> 93.960: [ 23.049898] do_IRQ+0x41/0xc0
>>>>> 93.960: [ 23.049899] common_interrupt+0xf/0xf
>>>>> 93.961: [ 23.049900] </IRQ>
>>>
>>> and desc comes from irq_data->common->msi_desc
>>>
>>> I have no idea how that can happen for an MSI interrupt.
>>>
>>> Paul, is this reproducible?
>>
>> No, unfortunately not. I only hit this once, since I attached the serial
>> console.
>
> Bah. Could you please enable GENERIC_IRQ_DEBUGFS and after a successful
> boot up provide me the content of all files in /sys/kernel/debug/irq/ and
> its subfolders?
Sure, please find them attached. `7zr x sys-kernel-debug-irq.7z` should
extract it.
```
$ sudo ls -R /sys/kernel/debug/irq/
/sys/kernel/debug/irq/:
domains irqs
/sys/kernel/debug/irq/domains:
AMD-IR-0 AMD-IR-MSI-0-2 default IO-APIC-IR-0 IO-APIC-IR-1 PCI-MSI-2 VECTOR
/sys/kernel/debug/irq/irqs:
0 11 14 24 27 3 32 35 38 40 43 46 49 51 54 6 9
1 12 15 25 28 30 33 36 39 41 44 47 5 52 55 7
10 13 2 26 29 31 34 37 4 42 45 48 50 53 56 8
```
> I assume you have irqbalanced running, right?
Yes, I do.
```
$ systemctl status irqbalance
● irqbalance.service - irqbalance daemon
Loaded: loaded (/lib/systemd/system/irqbalance.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-07-18 18:26:05 CEST; 5min ago
Main PID: 491 (irqbalance)
Tasks: 2 (limit: 4915)
Memory: 1.4M
CGroup: /system.slice/irqbalance.service
└─491 /usr/sbin/irqbalance --foreground
Jul 18 18:26:05 tokeiihto systemd[1]: Started irqbalance daemon.
```
Kind regards,
Paul
[-- Attachment #1.2: sys-kernel-debug-irq.7z --]
[-- Type: application/x-7z-compressed, Size: 362 bytes --]
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5174 bytes --]
next prev parent reply other threads:[~2018-07-18 16:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-18 13:28 Paul Menzel
2018-07-18 14:06 ` Bjorn Helgaas
2018-07-18 15:02 ` Thomas Gleixner
2018-07-18 15:12 ` Paul Menzel
2018-07-18 15:27 ` Marc Zyngier
2018-07-18 15:39 ` Thomas Gleixner
2018-07-18 16:37 ` Paul Menzel [this message]
2018-07-18 19:00 ` Thomas Gleixner
2018-07-18 20:05 ` Paul Menzel
2018-07-19 8:55 ` Paul Menzel
2018-07-19 13:48 ` Thomas Gleixner
2018-07-19 13:56 ` Paul Menzel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178bb701-56af-06cf-4836-1a26e74f2b07@molgen.mpg.de \
--to=pmenzel+linux-pci@molgen.mpg.de \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®