All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <oliver.sang@intel.com>
To: <linux+lkp@weissschuh.net>
Cc: <oe-lkp@lists.linux.dev>, <lkp@intel.com>, <oliver.sang@intel.com>
Subject: [thomas-weissschuh:b4/sysfs-const-bin_attr-misc-drivers] [misc] 6b727c4363: BUG:kernel_NULL_pointer_dereference,address
Date: Tue, 17 Dec 2024 21:45:42 +0800	[thread overview]
Message-ID: <202412172123.51ce950b-lkp@intel.com> (raw)



Hello,

kernel test robot noticed "BUG:kernel_NULL_pointer_dereference,address" on:

commit: 6b727c4363e9f98ba2473be67b1b369ea3bec764 ("misc: c2port: Calculate bin_attribute size through group callback")
https://git.kernel.org/cgit/linux/kernel/git/thomas.weissschuh/linux.git b4/sysfs-const-bin_attr-misc-drivers

in testcase: boot

config: i386-randconfig-052-20241216
compiler: gcc-11
test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 4G

(please refer to attached dmesg/kmsg for entire log/backtrace)


+------------------------------------------------+------------+------------+
|                                                | c6b7c45fb4 | 6b727c4363 |
+------------------------------------------------+------------+------------+
| BUG:kernel_NULL_pointer_dereference,address    | 0          | 18         |
| Oops                                           | 0          | 18         |
| EIP:c2port_bin_attr_size                       | 0          | 18         |
| Kernel_panic-not_syncing:Fatal_exception       | 0          | 18         |
+------------------------------------------------+------------+------------+


If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202412172123.51ce950b-lkp@intel.com


[    8.459997][    T1] BUG: kernel NULL pointer dereference, address: 00000002
[    8.460915][    T1] #PF: supervisor read access in kernel mode
[    8.461649][    T1] #PF: error_code(0x0000) - not-present page
[    8.461772][    T1] *pdpt = 0000000000000000 *pde = f000ff53f000ff53
[    8.461772][    T1] Oops: Oops: 0000 [#1] SMP
[    8.461772][    T1] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Tainted: G                T  6.13.0-rc2-00367-g6b727c4363e9-dirty #1 c98edbedbb6969f633ed5a9f353ab3662886b9bd
[    8.461772][    T1] Tainted: [T]=RANDSTRUCT
[    8.461772][    T1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[ 8.461772][ T1] EIP: c2port_bin_attr_size (drivers/misc/c2port/core.c:883)
[ 8.461772][ T1] Code: 8b 45 f0 e8 b6 43 75 00 89 d8 e8 d9 fd ff ff 8d 65 f4 89 f8 5b 5e 5f 5d c3 55 89 e5 81 fa 00 70 41 83 75 12 8b 40 40 8b 50 28 <0f> b7 42 02 0f b7 12 0f af c2 eb 03 8b 42 14 5d c3 55 89 e5 53 85
All code
========
   0:	8b 45 f0             	mov    -0x10(%rbp),%eax
   3:	e8 b6 43 75 00       	call   0x7543be
   8:	89 d8                	mov    %ebx,%eax
   a:	e8 d9 fd ff ff       	call   0xfffffffffffffde8
   f:	8d 65 f4             	lea    -0xc(%rbp),%esp
  12:	89 f8                	mov    %edi,%eax
  14:	5b                   	pop    %rbx
  15:	5e                   	pop    %rsi
  16:	5f                   	pop    %rdi
  17:	5d                   	pop    %rbp
  18:	c3                   	ret
  19:	55                   	push   %rbp
  1a:	89 e5                	mov    %esp,%ebp
  1c:	81 fa 00 70 41 83    	cmp    $0x83417000,%edx
  22:	75 12                	jne    0x36
  24:	8b 40 40             	mov    0x40(%rax),%eax
  27:	8b 50 28             	mov    0x28(%rax),%edx
  2a:*	0f b7 42 02          	movzwl 0x2(%rdx),%eax		<-- trapping instruction
  2e:	0f b7 12             	movzwl (%rdx),%edx
  31:	0f af c2             	imul   %edx,%eax
  34:	eb 03                	jmp    0x39
  36:	8b 42 14             	mov    0x14(%rdx),%eax
  39:	5d                   	pop    %rbp
  3a:	c3                   	ret
  3b:	55                   	push   %rbp
  3c:	89 e5                	mov    %esp,%ebp
  3e:	53                   	push   %rbx
  3f:	85                   	.byte 0x85

Code starting with the faulting instruction
===========================================
   0:	0f b7 42 02          	movzwl 0x2(%rdx),%eax
   4:	0f b7 12             	movzwl (%rdx),%edx
   7:	0f af c2             	imul   %edx,%eax
   a:	eb 03                	jmp    0xf
   c:	8b 42 14             	mov    0x14(%rdx),%eax
   f:	5d                   	pop    %rbp
  10:	c3                   	ret
  11:	55                   	push   %rbp
  12:	89 e5                	mov    %esp,%ebp
  14:	53                   	push   %rbx
  15:	85                   	.byte 0x85
[    8.461772][    T1] EAX: 854ecd80 EBX: 00000000 ECX: 00000000 EDX: 00000000
[    8.461772][    T1] ESI: 83416fa8 EDI: 8197699b EBP: 801ffdb4 ESP: 801ffdb4
[    8.461772][    T1] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010246
[    8.461772][    T1] CR0: 80050033 CR2: 00000002 CR3: 037fa000 CR4: 000406b0
[    8.461772][    T1] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[    8.461772][    T1] DR6: fffe0ff0 DR7: 00000400
[    8.461772][    T1] Call Trace:
[ 8.461772][ T1] ? show_regs (arch/x86/kernel/dumpstack.c:478)
[ 8.461772][ T1] ? __die_body (arch/x86/kernel/dumpstack.c:421)
[ 8.461772][ T1] ? __die (arch/x86/kernel/dumpstack.c:435)
[ 8.461772][ T1] ? page_fault_oops (arch/x86/mm/fault.c:712)
[ 8.461772][ T1] ? kernelmode_fixup_or_oops+0x46/0x4e
[ 8.461772][ T1] ? __bad_area_nosemaphore+0x2b/0x1c6
[ 8.461772][ T1] ? __lock_release+0xb8/0x165
[ 8.461772][ T1] ? kernfs_activate (fs/kernfs/dir.c:1410)
[ 8.461772][ T1] ? bad_area_nosemaphore (arch/x86/mm/fault.c:835)
[ 8.461772][ T1] ? do_user_addr_fault (arch/x86/mm/fault.c:1280 (discriminator 1))
[ 8.461772][ T1] ? exc_page_fault (arch/x86/include/asm/irqflags.h:26 arch/x86/include/asm/irqflags.h:87 arch/x86/include/asm/irqflags.h:147 arch/x86/mm/fault.c:1489 arch/x86/mm/fault.c:1539)
[ 8.461772][ T1] ? pvclock_clocksource_read_nowd (arch/x86/mm/fault.c:1494)
[ 8.461772][ T1] ? handle_exception (arch/x86/entry/entry_32.S:1055)
[ 8.461772][ T1] ? als_lux0_input_data_show (drivers/misc/c2port/core.c:879)
[ 8.461772][ T1] ? kernfs_path_from_node_locked (fs/kernfs/dir.c:178)
[ 8.461772][ T1] ? pvclock_clocksource_read_nowd (arch/x86/mm/fault.c:1494)
[ 8.461772][ T1] ? c2port_bin_attr_size (drivers/misc/c2port/core.c:883)
[ 8.461772][ T1] ? pvclock_clocksource_read_nowd (arch/x86/mm/fault.c:1494)
[ 8.461772][ T1] ? c2port_bin_attr_size (drivers/misc/c2port/core.c:883)
[ 8.461772][ T1] create_files (fs/sysfs/group.c:102)
[ 8.461772][ T1] internal_create_group (fs/sysfs/group.c:183)
[ 8.461772][ T1] internal_create_groups (fs/sysfs/group.c:224)
[ 8.461772][ T1] sysfs_create_groups (fs/sysfs/group.c:250)
[ 8.461772][ T1] device_add_attrs (drivers/base/core.c:2812 drivers/base/core.c:2876)
[ 8.461772][ T1] ? sysfs_do_create_link (fs/sysfs/symlink.c:80)
[ 8.461772][ T1] device_add (drivers/base/core.c:3619)
[ 8.461772][ T1] ? kfree_const (mm/util.c:44)
[ 8.461772][ T1] device_create_groups_vargs (drivers/base/core.c:4392)
[ 8.461772][ T1] device_create (drivers/base/core.c:4435)
[ 8.461772][ T1] c2port_device_register (drivers/misc/c2port/core.c:928)
[ 8.461772][ T1] duramar2150_c2port_init (drivers/misc/c2port/c2port-duramar2150.c:127)
[ 8.461772][ T1] ? c2port_init (drivers/misc/c2port/c2port-duramar2150.c:119)
[ 8.461772][ T1] do_one_initcall (init/main.c:1266)
[ 8.461772][ T1] do_initcalls (init/main.c:1327 init/main.c:1344)
[ 8.461772][ T1] ? irq_to_desc (kernel/irq/irqdesc.c:452)
[ 8.461772][ T1] kernel_init_freeable (init/main.c:1579)
[ 8.461772][ T1] ? rest_init (init/main.c:1458)
[ 8.461772][ T1] kernel_init (init/main.c:1468)
[ 8.461772][ T1] ret_from_fork (arch/x86/kernel/process.c:153)
[ 8.461772][ T1] ? rest_init (init/main.c:1458)
[ 8.461772][ T1] ret_from_fork_asm (arch/x86/entry/entry_32.S:737)
[ 8.461772][ T1] entry_INT80_32 (arch/x86/entry/entry_32.S:942)
[    8.461772][    T1] Modules linked in:
[    8.461772][    T1] CR2: 0000000000000002
[    8.461772][    T1] ---[ end trace 0000000000000000 ]---
[ 8.461772][ T1] EIP: c2port_bin_attr_size (drivers/misc/c2port/core.c:883)
[ 8.461772][ T1] Code: 8b 45 f0 e8 b6 43 75 00 89 d8 e8 d9 fd ff ff 8d 65 f4 89 f8 5b 5e 5f 5d c3 55 89 e5 81 fa 00 70 41 83 75 12 8b 40 40 8b 50 28 <0f> b7 42 02 0f b7 12 0f af c2 eb 03 8b 42 14 5d c3 55 89 e5 53 85
All code
========
   0:	8b 45 f0             	mov    -0x10(%rbp),%eax
   3:	e8 b6 43 75 00       	call   0x7543be
   8:	89 d8                	mov    %ebx,%eax
   a:	e8 d9 fd ff ff       	call   0xfffffffffffffde8
   f:	8d 65 f4             	lea    -0xc(%rbp),%esp
  12:	89 f8                	mov    %edi,%eax
  14:	5b                   	pop    %rbx
  15:	5e                   	pop    %rsi
  16:	5f                   	pop    %rdi
  17:	5d                   	pop    %rbp
  18:	c3                   	ret
  19:	55                   	push   %rbp
  1a:	89 e5                	mov    %esp,%ebp
  1c:	81 fa 00 70 41 83    	cmp    $0x83417000,%edx
  22:	75 12                	jne    0x36
  24:	8b 40 40             	mov    0x40(%rax),%eax
  27:	8b 50 28             	mov    0x28(%rax),%edx
  2a:*	0f b7 42 02          	movzwl 0x2(%rdx),%eax		<-- trapping instruction
  2e:	0f b7 12             	movzwl (%rdx),%edx
  31:	0f af c2             	imul   %edx,%eax
  34:	eb 03                	jmp    0x39
  36:	8b 42 14             	mov    0x14(%rdx),%eax
  39:	5d                   	pop    %rbp
  3a:	c3                   	ret
  3b:	55                   	push   %rbp
  3c:	89 e5                	mov    %esp,%ebp
  3e:	53                   	push   %rbx
  3f:	85                   	.byte 0x85

Code starting with the faulting instruction
===========================================
   0:	0f b7 42 02          	movzwl 0x2(%rdx),%eax
   4:	0f b7 12             	movzwl (%rdx),%edx
   7:	0f af c2             	imul   %edx,%eax
   a:	eb 03                	jmp    0xf
   c:	8b 42 14             	mov    0x14(%rdx),%eax
   f:	5d                   	pop    %rbp
  10:	c3                   	ret
  11:	55                   	push   %rbp
  12:	89 e5                	mov    %esp,%ebp
  14:	53                   	push   %rbx
  15:	85                   	.byte 0x85


The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20241217/202412172123.51ce950b-lkp@intel.com



-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


                 reply	other threads:[~2024-12-17 13:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202412172123.51ce950b-lkp@intel.com \
    --to=oliver.sang@intel.com \
    --cc=linux+lkp@weissschuh.net \
    --cc=lkp@intel.com \
    --cc=oe-lkp@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.