2018-06-26 01:14:41

by kernel test robot

[permalink] [raw]
Subject: [lkp-robot] [bisect done] ef1433f717 [ 7.049860] BUG: unable to handle kernel NULL pointer dereference at 0000004c


Greetings,

0day kernel testing robot got the below dmesg and the first bad commit is

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

commit ef1433f717a2c63747a519d86965d73ff9bd08b3
Author: Kishon Vijay Abraham I <[email protected]>
AuthorDate: Mon Apr 2 18:59:35 2018 +0530
Commit: Lorenzo Pieralisi <[email protected]>
CommitDate: Fri May 18 16:40:50 2018 +0100

PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry

In order to be able to provide correct driver_data for pci_epf device,
a separate configfs entry for each pci_epf_device_id table entry in
pci_epf_driver is required.

Add support to create configfs entry for each pci_epf_device_id
table entry here.

Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Tested-by: Gustavo Pimentel <[email protected]>

ecc57efe9d misc: pci_endpoint_test: Use pci_irq_vector function
ef1433f717 PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry
f5b7769eb0 Revert "debugfs: inode: debugfs_create_dir uses mode permission from parent"
0468ba62dc Add linux-next specific files for 20180613
+--------------------------------------------------------------+------------+------------+------------+---------------+
| | ecc57efe9d | ef1433f717 | f5b7769eb0 | next-20180613 |
+--------------------------------------------------------------+------------+------------+------------+---------------+
| boot_successes | 42 | 0 | 0 | 0 |
| boot_failures | 4 | 15 | 19 | 57 |
| WARNING:at_arch/x86/include/asm/pgtable.h:#do_anonymous_page | 4 | | | |
| EIP:do_anonymous_page | 4 | | | |
| WARNING:at_arch/x86/include/asm/pgtable.h:#change_pte_range | 2 | | | |
| EIP:change_pte_range | 2 | | | |
| BUG:unable_to_handle_kernel | 0 | 15 | 19 | 57 |
| Oops:#[##] | 0 | 15 | 19 | 57 |
| EIP:__pci_epf_register_driver | 0 | 15 | 19 | 57 |
| Kernel_panic-not_syncing:Fatal_exception | 0 | 15 | 19 | 57 |
+--------------------------------------------------------------+------------+------------+------------+---------------+

[ 7.004551] crc32c: self tests passed, processed 225944 bytes in 114627 nsec
[ 7.022096] crc32_combine: 8373 self tests passed
[ 7.038149] crc32c_combine: 8373 self tests passed
[ 7.038731] cpqphp: Compaq Hot Plug PCI Controller Driver version: 0.9.8
[ 7.039375] switchtec: loaded.
[ 7.049860] BUG: unable to handle kernel NULL pointer dereference at 0000004c
[ 7.050604] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
[ 7.051110] Oops: 0002 [#1] PREEMPT SMP
[ 7.051443] Modules linked in:
[ 7.051711] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.17.0-rc1-00005-gef1433f #1
[ 7.052364] EIP: __pci_epf_register_driver+0x8c/0xc0
[ 7.052791] EFLAGS: 00210202 CPU: 0
[ 7.053097] EAX: 41a78114 EBX: 41790220 ECX: 41a78114 EDX: 41a78114
[ 7.053632] ESI: 41a780c0 EDI: 41a78114 EBP: 40031f08 ESP: 40031ef8
[ 7.054170] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 7.054631] CR0: 80050033 CR2: 0000004c CR3: 01b5f000 CR4: 001406f0
[ 7.055171] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[ 7.055704] DR6: fffe0ff0 DR7: 00000400
[ 7.056037] Call Trace:
[ 7.056255] ? pci_epf_init+0x28/0x28
[ 7.056573] ? pci_epf_test_init+0x2d/0x4a
[ 7.056928] ? do_one_initcall+0x41/0x1a0
[ 7.057278] ? parse_args+0x189/0x2a0
[ 7.057601] ? kernel_init_freeable+0x19f/0x219
[ 7.057999] ? rest_init+0x1e0/0x1e0
[ 7.058309] ? kernel_init+0x8/0xf0
[ 7.058612] ? ret_from_fork+0x2e/0x38
[ 7.058946] Code: d2 b8 60 80 a7 41 e8 b4 ec 4a 00 8b 7e 58 8b 4d f0 b8 48 00 00 00 89 fa e8 72 d6 fa ff 84 c0 74 1b 8b 45 f0 c7 46 58 48 00 00 00 <89> 3d 4c 00 00 00 a3 48 00 00 00 c7 07 48 00 00 00 b8 60 80 a7
[ 7.059742] EIP: __pci_epf_register_driver+0x8c/0xc0 SS:ESP: 0068:40031ef8
[ 7.059742] CR2: 000000000000004c
[ 7.059742] ---[ end trace 7624867efb8b23bc ]---
[ 7.059742] Kernel panic - not syncing: Fatal exception

# HH:MM RESULT GOOD BAD GOOD_BUT_DIRTY DIRTY_NOT_BAD
git bisect start 0468ba62dc097465dfee1e65f83a171985653d15 29dcea88779c856c7dc92040a0c01233263101d4 --
git bisect bad 1aaccb5fa0eac996adde53538ca4b87a0b229ab7 # 18:45 B 0 2 16 0 Merge tag 'rtc-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
git bisect good af6c5d5e01ad9f2c9ca38cccaae6b5d67ddd241f # 19:09 G 11 0 0 0 Merge branch 'for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
git bisect bad 68abbe729567cef128b2c2141f2ed2567f3b8372 # 19:18 B 0 11 27 2 Merge branch 'akpm' (patches from Andrew)
git bisect good da315f6e03988a7127680bbc26e1028991b899b8 # 19:30 G 11 0 0 0 Merge tag 'fuse-update-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse
git bisect bad a1cdde8c411dbde19863e5104a4a1f218dd07b89 # 19:39 B 0 11 25 0 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
git bisect good c0ab85267e25e34ce8b7e4429f0ef01fa0795b80 # 19:52 G 11 0 0 0 Merge tag 'microblaze-v4.18-rc1' of git://git.monstr.eu/linux-2.6-microblaze
git bisect good 3036bc45364f98515a2c446d7fac2c34dcfbeff4 # 20:03 G 11 0 0 0 Merge tag 'media/v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
git bisect bad 3a3869f1c443383ef8354ffa0e5fb8df65d8b549 # 20:14 B 0 11 25 0 Merge tag 'pci-v4.18-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
git bisect good 13fbadcd512c225c907d6e8147fb48a88114bf03 # 20:26 G 11 0 0 0 Merge branch 'pci/sparc'
git bisect bad 741f8e7ecc2c6414cff442ec8eb07dcfe4481533 # 20:34 B 0 11 25 0 Merge branch 'lorenzo/pci/hv'
git bisect good f03c7aa4598b78f9f0f6883f1e410f67968f74b9 # 20:46 G 11 0 0 0 Merge branch 'lorenzo/pci/dwc'
git bisect bad bf79d7d0997abfab40b421a0360adcc4fdbda0a4 # 20:53 B 0 11 27 2 Merge branch 'lorenzo/pci/endpoint'
git bisect good ecc57efe9d0d958c8a3a43a4430bf19319e74728 # 21:15 G 11 0 0 4 misc: pci_endpoint_test: Use pci_irq_vector function
git bisect good d792b32688c65841aef256e5870f0e25ed69ed9c # 21:29 G 11 0 0 2 Merge branch 'lorenzo/pci/dwc-fixes'
git bisect bad ef1433f717a2c63747a519d86965d73ff9bd08b3 # 21:38 B 0 11 26 1 PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry
# first bad commit: [ef1433f717a2c63747a519d86965d73ff9bd08b3] PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry
git bisect good ecc57efe9d0d958c8a3a43a4430bf19319e74728 # 21:44 G 31 0 0 4 misc: pci_endpoint_test: Use pci_irq_vector function
# extra tests with debug options
git bisect bad ef1433f717a2c63747a519d86965d73ff9bd08b3 # 21:54 B 0 11 25 0 PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry
# extra tests on HEAD of linux-next/master
git bisect bad 0468ba62dc097465dfee1e65f83a171985653d15 # 21:54 B 0 57 74 0 Add linux-next specific files for 20180613
# extra tests on tree/branch linus/master
git bisect bad f5b7769eb0400ec5217a47e41148a9f816ca1f9f # 22:04 B 0 9 23 0 Revert "debugfs: inode: debugfs_create_dir uses mode permission from parent"
# extra tests with first bad commit reverted
git bisect good 283f585ecca0621330650302d51bc5a5af090157 # 22:17 G 11 0 0 0 Revert "PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry"
# extra tests on tree/branch linux-next/master
git bisect bad 0468ba62dc097465dfee1e65f83a171985653d15 # 22:17 B 0 57 74 0 Add linux-next specific files for 20180613

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/lkp Intel Corporation


Attachments:
(No filename) (8.70 kB)
dmesg-openwrt-lkp-hsw01-105:20180613213746:i386-randconfig-x0-06131729:4.17.0-rc1-00005-gef1433f:1.gz (7.83 kB)
dmesg-vm-kbuild-yocto-i386-42:20180613211310:i386-randconfig-x0-06131729:4.17.0-rc1-00004-gecc57ef:2.gz (12.35 kB)
reproduce-openwrt-lkp-hsw01-105:20180613213746:i386-randconfig-x0-06131729:4.17.0-rc1-00005-gef1433f:1 (973.00 B)
config-4.17.0-rc1-00005-gef1433f (95.71 kB)
Download all attachments

2018-06-27 01:21:15

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [lkp-robot] [bisect done] ef1433f717 [ 7.049860] BUG: unable to handle kernel NULL pointer dereference at 0000004c

On Tue, Jun 26, 2018 at 09:10:07AM +0800, kernel test robot wrote:
>
> Greetings,
>
> 0day kernel testing robot got the below dmesg and the first bad commit is
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>
> commit ef1433f717a2c63747a519d86965d73ff9bd08b3
> Author: Kishon Vijay Abraham I <[email protected]>
> AuthorDate: Mon Apr 2 18:59:35 2018 +0530
> Commit: Lorenzo Pieralisi <[email protected]>
> CommitDate: Fri May 18 16:40:50 2018 +0100
>
> PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry
>
> In order to be able to provide correct driver_data for pci_epf device,
> a separate configfs entry for each pci_epf_device_id table entry in
> pci_epf_driver is required.
>
> Add support to create configfs entry for each pci_epf_device_id
> table entry here.
>
> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
> Signed-off-by: Lorenzo Pieralisi <[email protected]>
> Tested-by: Gustavo Pimentel <[email protected]>

From the .config below:

# CONFIG_PCI_ENDPOINT_CONFIGFS is not set

From include/linux/pci-ep-cfs.h:

#ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
...
#else
static inline struct config_group *pci_ep_cfs_add_epf_group(const char *name)
{
return 0;
}

From ef1433f717a2:

+ id = driver->id_table;
+ while (id->name[0]) {
+ group = pci_ep_cfs_add_epf_group(id->name);
+ mutex_lock(&pci_epf_mutex);
+ list_add_tail(&group->group_entry, &driver->epf_group);

Obviously group == 0 and the list_add_tail() is a NULL pointer
dereference.

Looks like we need either some sort of #ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
in __pci_epf_register_driver() and pci_epf_unregister_driver(), or
higher-level interfaces and corresponding stubs that add/remove all
the IDs.

Bjorn

2018-06-27 10:29:06

by Lorenzo Pieralisi

[permalink] [raw]
Subject: Re: [lkp-robot] [bisect done] ef1433f717 [ 7.049860] BUG: unable to handle kernel NULL pointer dereference at 0000004c

On Tue, Jun 26, 2018 at 04:15:01PM -0500, Bjorn Helgaas wrote:
> On Tue, Jun 26, 2018 at 09:10:07AM +0800, kernel test robot wrote:
> >
> > Greetings,
> >
> > 0day kernel testing robot got the below dmesg and the first bad commit is
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >
> > commit ef1433f717a2c63747a519d86965d73ff9bd08b3
> > Author: Kishon Vijay Abraham I <[email protected]>
> > AuthorDate: Mon Apr 2 18:59:35 2018 +0530
> > Commit: Lorenzo Pieralisi <[email protected]>
> > CommitDate: Fri May 18 16:40:50 2018 +0100
> >
> > PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry
> >
> > In order to be able to provide correct driver_data for pci_epf device,
> > a separate configfs entry for each pci_epf_device_id table entry in
> > pci_epf_driver is required.
> >
> > Add support to create configfs entry for each pci_epf_device_id
> > table entry here.
> >
> > Signed-off-by: Kishon Vijay Abraham I <[email protected]>
> > Signed-off-by: Lorenzo Pieralisi <[email protected]>
> > Tested-by: Gustavo Pimentel <[email protected]>
>
> From the .config below:
>
> # CONFIG_PCI_ENDPOINT_CONFIGFS is not set
>
> From include/linux/pci-ep-cfs.h:
>
> #ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
> ...
> #else
> static inline struct config_group *pci_ep_cfs_add_epf_group(const char *name)
> {
> return 0;
> }
>
> From ef1433f717a2:
>
> + id = driver->id_table;
> + while (id->name[0]) {
> + group = pci_ep_cfs_add_epf_group(id->name);
> + mutex_lock(&pci_epf_mutex);
> + list_add_tail(&group->group_entry, &driver->epf_group);
>
> Obviously group == 0 and the list_add_tail() is a NULL pointer
> dereference.
>
> Looks like we need either some sort of #ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
> in __pci_epf_register_driver() and pci_epf_unregister_driver(), or
> higher-level interfaces and corresponding stubs that add/remove all
> the IDs.

Yes, probably augment pci_ep_cfs_add_epf_group() to take a driver
pointer so that adding a group is a NOP on !CONFIG_PCI_ENDPOINT_CONFIGFS.

Kishon can you please post a fix as soon as you can, thanks.

Lorenzo

2018-06-27 13:27:17

by Kishon Vijay Abraham I

[permalink] [raw]
Subject: Re: [lkp-robot] [bisect done] ef1433f717 [ 7.049860] BUG: unable to handle kernel NULL pointer dereference at 0000004c



On Wednesday 27 June 2018 03:56 PM, Lorenzo Pieralisi wrote:
> On Tue, Jun 26, 2018 at 04:15:01PM -0500, Bjorn Helgaas wrote:
>> On Tue, Jun 26, 2018 at 09:10:07AM +0800, kernel test robot wrote:
>>>
>>> Greetings,
>>>
>>> 0day kernel testing robot got the below dmesg and the first bad commit is
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>
>>> commit ef1433f717a2c63747a519d86965d73ff9bd08b3
>>> Author: Kishon Vijay Abraham I <[email protected]>
>>> AuthorDate: Mon Apr 2 18:59:35 2018 +0530
>>> Commit: Lorenzo Pieralisi <[email protected]>
>>> CommitDate: Fri May 18 16:40:50 2018 +0100
>>>
>>> PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry
>>>
>>> In order to be able to provide correct driver_data for pci_epf device,
>>> a separate configfs entry for each pci_epf_device_id table entry in
>>> pci_epf_driver is required.
>>>
>>> Add support to create configfs entry for each pci_epf_device_id
>>> table entry here.
>>>
>>> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
>>> Signed-off-by: Lorenzo Pieralisi <[email protected]>
>>> Tested-by: Gustavo Pimentel <[email protected]>
>>
>> From the .config below:
>>
>> # CONFIG_PCI_ENDPOINT_CONFIGFS is not set
>>
>> From include/linux/pci-ep-cfs.h:
>>
>> #ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
>> ...
>> #else
>> static inline struct config_group *pci_ep_cfs_add_epf_group(const char *name)
>> {
>> return 0;
>> }
>>
>> From ef1433f717a2:
>>
>> + id = driver->id_table;
>> + while (id->name[0]) {
>> + group = pci_ep_cfs_add_epf_group(id->name);
>> + mutex_lock(&pci_epf_mutex);
>> + list_add_tail(&group->group_entry, &driver->epf_group);
>>
>> Obviously group == 0 and the list_add_tail() is a NULL pointer
>> dereference.
>>
>> Looks like we need either some sort of #ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
>> in __pci_epf_register_driver() and pci_epf_unregister_driver(), or
>> higher-level interfaces and corresponding stubs that add/remove all
>> the IDs.
>
> Yes, probably augment pci_ep_cfs_add_epf_group() to take a driver
> pointer so that adding a group is a NOP on !CONFIG_PCI_ENDPOINT_CONFIGFS.
>
> Kishon can you please post a fix as soon as you can, thanks.

sure, I'll try to post before this week.

Thanks
Kishon