: NULL pointer deref in fs/sysfs/group.c:create_files -- sysctl related?
Subsystems (2)
Trying to boot a freshly built 3.4-rc1 (x86_64) kernel I'm getting the following trace (server is HP Proliant G4):
[ 0.986317] BUG: unable to handle kernel NULL pointer dereference at (null) [ 0.990542] IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.993693] PGD 0 [ 0.994682] Oops: 0000 [#1] SMP [ 0.996198] CPU 0 [ 0.996198] Modules linked in: [ 0.996198] [ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 [ 0.996198] RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 [ 0.996198] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 [ 0.996198] RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 [ 0.996198] RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 [ 0.996198] R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 [ 0.996198] R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 [ 0.996198] FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 [ 0.996198] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 0.996198] CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 [ 0.996198] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 0.996198] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 0.996198] Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) [ 0.996198] Stack: [ 0.996198] ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 [ 0.996198] ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 [ 0.996198] 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be [ 0.996198] Call Trace: [ 0.996198] [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [ 0.996198] [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [ 0.996198] [<ffffffff81377d3d>] device_add+0x46d/0x6a0 [ 0.996198] [<ffffffff81377891>] ? device_private_init+0x51/0x90 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 0.996198] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 0.996198] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 0.996198] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 0.996198] [<ffffffff815f3714>] kernel_thread_helper+0x4/0x10 [ 0.996198] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373 [ 0.996198] [<ffffffff815f3710>] ? gs_change+0xb/0xb [ 0.996198] Code: ff 85 c0 0f 85 bc 00 00 00 4c 8b 6d c8 4d 85 ed 74 15 41 8b 45 00 85 c0 0f 84 0b 01 00 00 f0 41 ff 45 00 4c 8b 6d c8 49 8b 5e 10 <48> 8b 03 48 85 c0 74 71 45 31 e4 eb 44 49 8b 46 08 48 85 c0 74 [ 0.996198] RIP [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP <ffff88019485fd70> [ 0.996198] CR2: 0000000000000000 [ 1.131357] ---[ end trace 319c95c486d7d9cd ]--- [ 1.133676] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 1.133677]
Short objdump analysis gives me:ffffffff811525f0 <internal_create_group>:
ffffffff811525f0: 55 push %rbp
ffffffff811525f1: 48 89 e5 mov %rsp,%rbp
ffffffff811525f4: 41 57 push %r15
ffffffff811525f6: 41 89 f7 mov %esi,%r15d
ffffffff811525f9: 41 56 push %r14
ffffffff811525fb: 49 89 d6 mov %rdx,%r14
ffffffff811525fe: 41 55 push %r13
ffffffff81152600: 41 54 push %r12
ffffffff81152602: 53 push %rbx
ffffffff81152603: 48 83 ec 28 sub $0x28,%rsp
ffffffff81152607: 48 89 7d b8 mov %rdi,-0x48(%rbp)
ffffffff8115260b: 48 85 ff test %rdi,%rdi
ffffffff8115260e: 0f 84 5b 01 00 00 je ffffffff8115276f <internal_create_group+0x17f>
ffffffff81152614: 85 f6 test %esi,%esi
ffffffff81152616: 0f 84 48 01 00 00 je ffffffff81152764 <internal_create_group+0x174>
ffffffff8115261c: 48 8b 55 b8 mov -0x48(%rbp),%rdx
ffffffff81152620: b8 ea ff ff ff mov $0xffffffea,%eax
ffffffff81152625: 48 83 7a 30 00 cmpq $0x0,0x30(%rdx)
ffffffff8115262a: 0f 84 dd 00 00 00 je ffffffff8115270d <internal_create_group+0x11d>
ffffffff81152630: 49 8b 36 mov (%r14),%rsi
ffffffff81152633: 48 85 f6 test %rsi,%rsi
ffffffff81152636: 0f 84 e4 00 00 00 je ffffffff81152720 <internal_create_group+0x130>
ffffffff8115263c: 48 8d 55 c8 lea -0x38(%rbp),%rdx
ffffffff81152640: 48 8b 7d b8 mov -0x48(%rbp),%rdi
ffffffff81152644: e8 37 e9 ff ff callq ffffffff81150f80 <sysfs_create_subdir>
ffffffff81152649: 85 c0 test %eax,%eax
ffffffff8115264b: 0f 85 bc 00 00 00 jne ffffffff8115270d <internal_create_group+0x11d>
ffffffff81152651: 4c 8b 6d c8 mov -0x38(%rbp),%r13
ffffffff81152655: 4d 85 ed test %r13,%r13
ffffffff81152658: 74 15 je ffffffff8115266f <internal_create_group+0x7f>
ffffffff8115265a: 41 8b 45 00 mov 0x0(%r13),%eax
ffffffff8115265e: 85 c0 test %eax,%eax
ffffffff81152660: 0f 84 0b 01 00 00 je ffffffff81152771 <internal_create_group+0x181>
ffffffff81152666: f0 41 ff 45 00 lock incl 0x0(%r13)
ffffffff8115266b: 4c 8b 6d c8 mov -0x38(%rbp),%r13
ffffffff8115266f: 49 8b 5e 10 mov 0x10(%r14),%rbx
ffffffff81152673: 48 8b 03 mov (%rbx),%rax
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ffffffff81152676: 48 85 c0 test %rax,%rax
ffffffff81152679: 74 71 je ffffffff811526ec <internal_create_group+0xfc>
ffffffff8115267b: 45 31 e4 xor %r12d,%r12d
ffffffff8115267e: eb 44 jmp ffffffff811526c4 <internal_create_group+0xd4>
ffffffff81152680: 49 8b 46 08 mov 0x8(%r14),%rax
ffffffff81152684: 48 85 c0 test %rax,%rax
ffffffff81152687: 74 56 je ffffffff811526df <internal_create_group+0xef>
ffffffff81152689: 44 89 e2 mov %r12d,%edxwhich matches (by comparing objdump with gcc -S fs/sysfs/group.c output):
static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,
const struct attribute_group *grp, int update)
{
struct attribute *const* attr;
int error = 0, i;
for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
umode_t mode = 0;
/* in update mode, we're changing the permissions or
* visibility. Do this by first removing then
* re-adding (if required) the file */
if (update)
sysfs_hash_and_remove(dir_sd, NULL, (*attr)->name);
if (grp->is_visible) {
mode = grp->is_visible(kobj, *attr, i);
if (!mode)
continue;
}
error = sysfs_add_file_mode(dir_sd, *attr, SYSFS_KOBJ_ATTR,
(*attr)->mode | mode);
if (unlikely(error))
break;
}
if (error)
remove_files(dir_sd, kobj, grp);
return error;
}I've not verified for sure, but from my understanding it must be grp->attrs that is NULL and causes *attr test to explode.
Any immediate idea what it could be? (config attached)
Thanks,
Bruno
CONFIG_64BIT=yCONFIG_X86_64=yCONFIG_X86=yCONFIG_INSTRUCTION_DECODER=yCONFIG_OUTPUT_FORMAT="elf64-x86-64"CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"CONFIG_GENERIC_CMOS_UPDATE=yCONFIG_CLOCKSOURCE_WATCHDOG=yCONFIG_GENERIC_CLOCKEVENTS=yCONFIG_ARCH_CLOCKSOURCE_DATA=yCONFIG_GENERIC_CLOCKEVENTS_BROADCAST=yCONFIG_LOCKDEP_SUPPORT=yCONFIG_STACKTRACE_SUPPORT=yCONFIG_HAVE_LATENCYTOP_SUPPORT=yCONFIG_MMU=yCONFIG_NEED_DMA_MAP_STATE=yCONFIG_NEED_SG_DMA_LENGTH=yCONFIG_GENERIC_ISA_DMA=yCONFIG_GENERIC_BUG=yCONFIG_GENERIC_BUG_RELATIVE_POINTERS=yCONFIG_GENERIC_HWEIGHT=yCONFIG_ARCH_MAY_HAVE_PC_FDC=yCONFIG_RWSEM_XCHGADD_ALGORITHM=yCONFIG_ARCH_HAS_CPU_IDLE_WAIT=yCONFIG_GENERIC_CALIBRATE_DELAY=yCONFIG_GENERIC_TIME_VSYSCALL=yCONFIG_ARCH_HAS_CPU_RELAX=yCONFIG_ARCH_HAS_DEFAULT_IDLE=yCONFIG_ARCH_HAS_CACHE_LINE_SIZE=yCONFIG_ARCH_HAS_CPU_AUTOPROBE=yCONFIG_HAVE_SETUP_PER_CPU_AREA=yCONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=yCONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=yCONFIG_ARCH_HIBERNATION_POSSIBLE=yCONFIG_ARCH_SUSPEND_POSSIBLE=yCONFIG_ZONE_DMA32=yCONFIG_AUDIT_ARCH=yCONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=yCONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=yCONFIG_HAVE_INTEL_TXT=yCONFIG_X86_64_SMP=yCONFIG_X86_HT=yCONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11" CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"CONFIG_HAVE_IRQ_WORK=yCONFIG_IRQ_WORK=yCONFIG_EXPERIMENTAL=yCONFIG_INIT_ENV_ARG_LIMIT=32CONFIG_CROSS_COMPILE=""CONFIG_LOCALVERSION="-x86_64"CONFIG_HAVE_KERNEL_GZIP=yCONFIG_HAVE_KERNEL_BZIP2=yCONFIG_HAVE_KERNEL_LZMA=yCONFIG_HAVE_KERNEL_XZ=yCONFIG_HAVE_KERNEL_LZO=yCONFIG_KERNEL_GZIP=yCONFIG_DEFAULT_HOSTNAME="(none)"CONFIG_SWAP=yCONFIG_SYSVIPC=yCONFIG_SYSVIPC_SYSCTL=yCONFIG_POSIX_MQUEUE=yCONFIG_POSIX_MQUEUE_SYSCTL=yCONFIG_HAVE_GENERIC_HARDIRQS=yCONFIG_GENERIC_HARDIRQS=yCONFIG_GENERIC_IRQ_PROBE=yCONFIG_GENERIC_IRQ_SHOW=yCONFIG_GENERIC_PENDING_IRQ=yCONFIG_IRQ_FORCED_THREADING=yCONFIG_SPARSE_IRQ=yCONFIG_TREE_RCU=yCONFIG_RCU_FANOUT=64CONFIG_IKCONFIG=yCONFIG_IKCONFIG_PROC=yCONFIG_LOG_BUF_SHIFT=17CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=yCONFIG_CGROUPS=yCONFIG_CPUSETS=yCONFIG_PROC_PID_CPUSET=yCONFIG_CGROUP_CPUACCT=yCONFIG_RESOURCE_COUNTERS=yCONFIG_CGROUP_MEM_RES_CTLR=yCONFIG_CGROUP_SCHED=yCONFIG_FAIR_GROUP_SCHED=yCONFIG_NAMESPACES=yCONFIG_UTS_NS=yCONFIG_IPC_NS=yCONFIG_PID_NS=yCONFIG_NET_NS=yCONFIG_MM_OWNER=yCONFIG_BLK_DEV_INITRD=yCONFIG_INITRAMFS_SOURCE=""CONFIG_RD_GZIP=yCONFIG_RD_BZIP2=yCONFIG_RD_LZMA=yCONFIG_RD_XZ=yCONFIG_RD_LZO=yCONFIG_SYSCTL=yCONFIG_ANON_INODES=yCONFIG_UID16=yCONFIG_KALLSYMS=yCONFIG_HOTPLUG=yCONFIG_PRINTK=yCONFIG_BUG=yCONFIG_ELF_CORE=yCONFIG_PCSPKR_PLATFORM=yCONFIG_HAVE_PCSPKR_PLATFORM=yCONFIG_BASE_FULL=yCONFIG_FUTEX=yCONFIG_EPOLL=yCONFIG_SIGNALFD=yCONFIG_TIMERFD=yCONFIG_EVENTFD=yCONFIG_SHMEM=yCONFIG_AIO=yCONFIG_HAVE_PERF_EVENTS=yCONFIG_PERF_EVENTS=yCONFIG_VM_EVENT_COUNTERS=yCONFIG_PCI_QUIRKS=yCONFIG_SLUB_DEBUG=yCONFIG_SLUB=yCONFIG_HAVE_OPROFILE=yCONFIG_OPROFILE_NMI_TIMER=yCONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=yCONFIG_HAVE_IOREMAP_PROT=yCONFIG_HAVE_KPROBES=yCONFIG_HAVE_KRETPROBES=yCONFIG_HAVE_OPTPROBES=yCONFIG_HAVE_ARCH_TRACEHOOK=yCONFIG_HAVE_DMA_ATTRS=yCONFIG_USE_GENERIC_SMP_HELPERS=yCONFIG_HAVE_REGS_AND_STACK_ACCESS_API=yCONFIG_HAVE_DMA_API_DEBUG=yCONFIG_HAVE_HW_BREAKPOINT=yCONFIG_HAVE_MIXED_BREAKPOINTS_REGS=yCONFIG_HAVE_USER_RETURN_NOTIFIER=yCONFIG_HAVE_PERF_EVENTS_NMI=yCONFIG_HAVE_ARCH_JUMP_LABEL=yCONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=yCONFIG_HAVE_ALIGNED_STRUCT_PAGE=yCONFIG_HAVE_CMPXCHG_LOCAL=yCONFIG_HAVE_CMPXCHG_DOUBLE=yCONFIG_ARCH_WANT_OLD_COMPAT_IPC=yCONFIG_SLABINFO=yCONFIG_RT_MUTEXES=yCONFIG_BASE_SMALL=0CONFIG_MODULES=yCONFIG_MODULE_UNLOAD=yCONFIG_MODVERSIONS=yCONFIG_MODULE_SRCVERSION_ALL=yCONFIG_STOP_MACHINE=yCONFIG_BLOCK=yCONFIG_BLK_DEV_BSG=yCONFIG_BLK_DEV_BSGLIB=yCONFIG_BLK_DEV_INTEGRITY=yCONFIG_PARTITION_ADVANCED=yCONFIG_MSDOS_PARTITION=yCONFIG_EFI_PARTITION=yCONFIG_BLOCK_COMPAT=yCONFIG_IOSCHED_NOOP=yCONFIG_IOSCHED_DEADLINE=mCONFIG_IOSCHED_CFQ=yCONFIG_DEFAULT_CFQ=yCONFIG_DEFAULT_IOSCHED="cfq"CONFIG_INLINE_SPIN_UNLOCK_IRQ=yCONFIG_INLINE_READ_UNLOCK=yCONFIG_INLINE_READ_UNLOCK_IRQ=yCONFIG_INLINE_WRITE_UNLOCK=yCONFIG_INLINE_WRITE_UNLOCK_IRQ=yCONFIG_MUTEX_SPIN_ON_OWNER=yCONFIG_ZONE_DMA=yCONFIG_TICK_ONESHOT=yCONFIG_NO_HZ=yCONFIG_HIGH_RES_TIMERS=yCONFIG_GENERIC_CLOCKEVENTS_BUILD=yCONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=yCONFIG_SMP=yCONFIG_X86_MPPARSE=yCONFIG_X86_SUPPORTS_MEMORY_FAILURE=yCONFIG_SCHED_OMIT_FRAME_POINTER=yCONFIG_NO_BOOTMEM=yCONFIG_MCORE2=yCONFIG_X86_INTERNODE_CACHE_SHIFT=6CONFIG_X86_CMPXCHG=yCONFIG_X86_L1_CACHE_SHIFT=6CONFIG_X86_XADD=yCONFIG_X86_WP_WORKS_OK=yCONFIG_X86_INTEL_USERCOPY=yCONFIG_X86_USE_PPRO_CHECKSUM=yCONFIG_X86_P6_NOP=yCONFIG_X86_TSC=yCONFIG_X86_CMPXCHG64=yCONFIG_X86_CMOV=yCONFIG_X86_MINIMUM_CPU_FAMILY=64CONFIG_X86_DEBUGCTLMSR=yCONFIG_CPU_SUP_INTEL=yCONFIG_CPU_SUP_AMD=yCONFIG_CPU_SUP_CENTAUR=yCONFIG_HPET_TIMER=yCONFIG_HPET_EMULATE_RTC=yCONFIG_DMI=yCONFIG_GART_IOMMU=yCONFIG_SWIOTLB=yCONFIG_IOMMU_HELPER=yCONFIG_NR_CPUS=8CONFIG_SCHED_MC=yCONFIG_PREEMPT_NONE=yCONFIG_X86_LOCAL_APIC=yCONFIG_X86_IO_APIC=yCONFIG_X86_MCE=yCONFIG_X86_MCE_INTEL=yCONFIG_X86_MCE_THRESHOLD=yCONFIG_X86_THERMAL_VECTOR=yCONFIG_MICROCODE=yCONFIG_MICROCODE_INTEL=yCONFIG_MICROCODE_OLD_INTERFACE=yCONFIG_X86_MSR=yCONFIG_X86_CPUID=yCONFIG_ARCH_PHYS_ADDR_T_64BIT=yCONFIG_ARCH_DMA_ADDR_T_64BIT=yCONFIG_DIRECT_GBPAGES=yCONFIG_ARCH_SPARSEMEM_ENABLE=yCONFIG_ARCH_SPARSEMEM_DEFAULT=yCONFIG_ARCH_SELECT_MEMORY_MODEL=yCONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000CONFIG_SELECT_MEMORY_MODEL=yCONFIG_SPARSEMEM_MANUAL=yCONFIG_SPARSEMEM=yCONFIG_HAVE_MEMORY_PRESENT=yCONFIG_SPARSEMEM_EXTREME=yCONFIG_SPARSEMEM_VMEMMAP_ENABLE=yCONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=yCONFIG_SPARSEMEM_VMEMMAP=yCONFIG_HAVE_MEMBLOCK=yCONFIG_HAVE_MEMBLOCK_NODE_MAP=yCONFIG_ARCH_DISCARD_MEMBLOCK=yCONFIG_PAGEFLAGS_EXTENDED=yCONFIG_SPLIT_PTLOCK_CPUS=4CONFIG_COMPACTION=yCONFIG_MIGRATION=yCONFIG_PHYS_ADDR_T_64BIT=yCONFIG_ZONE_DMA_FLAG=1CONFIG_BOUNCE=yCONFIG_VIRT_TO_BUS=yCONFIG_DEFAULT_MMAP_MIN_ADDR=4096CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=yCONFIG_TRANSPARENT_HUGEPAGE=yCONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=yCONFIG_X86_RESERVE_LOW=64CONFIG_MTRR=yCONFIG_X86_PAT=yCONFIG_ARCH_USES_PG_UNCACHED=yCONFIG_ARCH_RANDOM=yCONFIG_CC_STACKPROTECTOR=yCONFIG_HZ_100=yCONFIG_HZ=100CONFIG_SCHED_HRTICK=yCONFIG_KEXEC=yCONFIG_PHYSICAL_START=0x1000000CONFIG_PHYSICAL_ALIGN=0x1000000CONFIG_CMDLINE_BOOL=yCONFIG_CMDLINE="vga=normal slub_debug=ZP"CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=yCONFIG_ACPI=yCONFIG_ACPI_PROCFS=yCONFIG_ACPI_PROCFS_POWER=yCONFIG_ACPI_PROC_EVENT=yCONFIG_ACPI_AC=yCONFIG_ACPI_BUTTON=yCONFIG_ACPI_FAN=yCONFIG_ACPI_DOCK=yCONFIG_ACPI_PROCESSOR=yCONFIG_ACPI_IPMI=mCONFIG_ACPI_THERMAL=yCONFIG_ACPI_BLACKLIST_YEAR=0CONFIG_X86_PM_TIMER=yCONFIG_ACPI_HED=mCONFIG_ACPI_APEI=yCONFIG_CPU_FREQ=yCONFIG_CPU_FREQ_TABLE=yCONFIG_CPU_FREQ_STAT=yCONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=yCONFIG_CPU_FREQ_GOV_PERFORMANCE=yCONFIG_CPU_FREQ_GOV_USERSPACE=yCONFIG_CPU_FREQ_GOV_ONDEMAND=yCONFIG_X86_PCC_CPUFREQ=mCONFIG_X86_ACPI_CPUFREQ=yCONFIG_CPU_IDLE=yCONFIG_CPU_IDLE_GOV_LADDER=yCONFIG_CPU_IDLE_GOV_MENU=yCONFIG_INTEL_IDLE=yCONFIG_PCI=yCONFIG_PCI_DIRECT=yCONFIG_PCI_MMCONFIG=yCONFIG_PCI_DOMAINS=yCONFIG_PCIEPORTBUS=yCONFIG_PCIEAER=yCONFIG_PCIEASPM=yCONFIG_PCIEASPM_DEFAULT=yCONFIG_ARCH_SUPPORTS_MSI=yCONFIG_PCI_MSI=yCONFIG_PCI_IOAPIC=yCONFIG_PCI_LABEL=yCONFIG_ISA_DMA_API=yCONFIG_AMD_NB=yCONFIG_BINFMT_ELF=yCONFIG_COMPAT_BINFMT_ELF=yCONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=yCONFIG_IA32_EMULATION=yCONFIG_X86_X32=yCONFIG_COMPAT=yCONFIG_COMPAT_FOR_U64_ALIGNMENT=yCONFIG_SYSVIPC_COMPAT=yCONFIG_HAVE_TEXT_POKE_SMP=yCONFIG_NET=yCONFIG_PACKET=yCONFIG_UNIX=yCONFIG_UNIX_DIAG=yCONFIG_INET=yCONFIG_IP_ADVANCED_ROUTER=yCONFIG_IP_MULTIPLE_TABLES=yCONFIG_SYN_COOKIES=yCONFIG_INET_LRO=yCONFIG_TCP_CONG_CUBIC=yCONFIG_DEFAULT_TCP_CONG="cubic"CONFIG_IPV6=yCONFIG_IPV6_MULTIPLE_TABLES=yCONFIG_NETFILTER=yCONFIG_NETFILTER_ADVANCED=yCONFIG_NETFILTER_NETLINK=yCONFIG_NETFILTER_NETLINK_ACCT=yCONFIG_NETFILTER_NETLINK_LOG=yCONFIG_NF_CONNTRACK=yCONFIG_NF_CONNTRACK_FTP=yCONFIG_NF_CT_NETLINK=yCONFIG_NETFILTER_XTABLES=yCONFIG_NETFILTER_XT_TARGET_LOG=yCONFIG_NETFILTER_XT_TARGET_NFLOG=yCONFIG_NETFILTER_XT_MATCH_ADDRTYPE=yCONFIG_NETFILTER_XT_MATCH_COMMENT=yCONFIG_NETFILTER_XT_MATCH_CONNBYTES=yCONFIG_NETFILTER_XT_MATCH_CONNLIMIT=yCONFIG_NETFILTER_XT_MATCH_CONNTRACK=yCONFIG_NETFILTER_XT_MATCH_HELPER=yCONFIG_NETFILTER_XT_MATCH_IPRANGE=yCONFIG_NETFILTER_XT_MATCH_LIMIT=yCONFIG_NETFILTER_XT_MATCH_MULTIPORT=yCONFIG_NETFILTER_XT_MATCH_OWNER=yCONFIG_NETFILTER_XT_MATCH_PKTTYPE=yCONFIG_NETFILTER_XT_MATCH_RECENT=yCONFIG_NETFILTER_XT_MATCH_STATE=yCONFIG_NETFILTER_XT_MATCH_TIME=yCONFIG_NF_DEFRAG_IPV4=yCONFIG_NF_CONNTRACK_IPV4=yCONFIG_IP_NF_IPTABLES=yCONFIG_IP_NF_MATCH_RPFILTER=yCONFIG_IP_NF_FILTER=yCONFIG_IP_NF_TARGET_REJECT=yCONFIG_NF_DEFRAG_IPV6=yCONFIG_NF_CONNTRACK_IPV6=yCONFIG_IP6_NF_IPTABLES=yCONFIG_IP6_NF_MATCH_EUI64=yCONFIG_IP6_NF_MATCH_FRAG=yCONFIG_IP6_NF_MATCH_RPFILTER=yCONFIG_IP6_NF_FILTER=yCONFIG_IP6_NF_TARGET_REJECT=yCONFIG_RPS=yCONFIG_RFS_ACCEL=yCONFIG_XPS=yCONFIG_NETPRIO_CGROUP=yCONFIG_BQL=yCONFIG_HAVE_BPF_JIT=yCONFIG_FIB_RULES=yCONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"CONFIG_DEVTMPFS=yCONFIG_DEVTMPFS_MOUNT=yCONFIG_STANDALONE=yCONFIG_PREVENT_FIRMWARE_BUILD=yCONFIG_FW_LOADER=yCONFIG_FIRMWARE_IN_KERNEL=yCONFIG_EXTRA_FIRMWARE=""CONFIG_PNP=yCONFIG_PNPACPI=yCONFIG_BLK_DEV=yCONFIG_BLK_CPQ_CISS_DA=yCONFIG_BLK_DEV_LOOP=yCONFIG_BLK_DEV_LOOP_MIN_COUNT=8CONFIG_HP_ILO=yCONFIG_HAVE_IDE=yCONFIG_SCSI_MOD=yCONFIG_SCSI=yCONFIG_SCSI_DMA=yCONFIG_SCSI_NETLINK=yCONFIG_BLK_DEV_SD=yCONFIG_CHR_DEV_ST=yCONFIG_BLK_DEV_SR=yCONFIG_BLK_DEV_SR_VENDOR=yCONFIG_CHR_DEV_SG=yCONFIG_SCSI_MULTI_LUN=yCONFIG_SCSI_SCAN_ASYNC=yCONFIG_SCSI_WAIT_SCAN=mCONFIG_SCSI_SPI_ATTRS=yCONFIG_SCSI_FC_ATTRS=yCONFIG_SCSI_ISCSI_ATTRS=yCONFIG_SCSI_LOWLEVEL=yCONFIG_SCSI_HPSA=yCONFIG_LIBFC=yCONFIG_SCSI_QLA_FC=yCONFIG_SCSI_DH=yCONFIG_SCSI_DH_RDAC=yCONFIG_ATA=yCONFIG_ATA_VERBOSE_ERROR=yCONFIG_ATA_ACPI=yCONFIG_SATA_AHCI=yCONFIG_ATA_SFF=yCONFIG_ATA_BMDMA=yCONFIG_ATA_PIIX=yCONFIG_PATA_SERVERWORKS=yCONFIG_PATA_ACPI=yCONFIG_MD=yCONFIG_BLK_DEV_DM=yCONFIG_DM_CRYPT=yCONFIG_DM_MULTIPATH=yCONFIG_FUSION=yCONFIG_FUSION_SPI=yCONFIG_FUSION_MAX_SGE=128CONFIG_NETDEVICES=yCONFIG_NET_CORE=yCONFIG_NETCONSOLE=mCONFIG_NETCONSOLE_DYNAMIC=yCONFIG_NETPOLL=yCONFIG_NET_POLL_CONTROLLER=yCONFIG_ETHERNET=yCONFIG_NET_VENDOR_BROADCOM=yCONFIG_BNX2=yCONFIG_TIGON3=yCONFIG_NET_VENDOR_INTEL=yCONFIG_E1000=yCONFIG_E1000E=yCONFIG_PHYLIB=yCONFIG_BROADCOM_PHY=yCONFIG_INPUT=yCONFIG_INPUT_MOUSEDEV=yCONFIG_INPUT_MOUSEDEV_PSAUX=yCONFIG_INPUT_MOUSEDEV_SCREEN_X=800CONFIG_INPUT_MOUSEDEV_SCREEN_Y=600CONFIG_INPUT_KEYBOARD=yCONFIG_KEYBOARD_ATKBD=yCONFIG_INPUT_MOUSE=yCONFIG_MOUSE_PS2=yCONFIG_MOUSE_PS2_ALPS=yCONFIG_MOUSE_PS2_LOGIPS2PP=yCONFIG_MOUSE_PS2_SYNAPTICS=yCONFIG_MOUSE_PS2_LIFEBOOK=yCONFIG_MOUSE_PS2_TRACKPOINT=yCONFIG_SERIO=yCONFIG_SERIO_I8042=yCONFIG_SERIO_LIBPS2=yCONFIG_VT=yCONFIG_CONSOLE_TRANSLATIONS=yCONFIG_VT_CONSOLE=yCONFIG_HW_CONSOLE=yCONFIG_VT_HW_CONSOLE_BINDING=yCONFIG_UNIX98_PTYS=yCONFIG_DEVPTS_MULTIPLE_INSTANCES=yCONFIG_SERIAL_8250=yCONFIG_SERIAL_8250_CONSOLE=yCONFIG_FIX_EARLYCON_MEM=yCONFIG_SERIAL_8250_PCI=yCONFIG_SERIAL_8250_PNP=yCONFIG_SERIAL_8250_NR_UARTS=4CONFIG_SERIAL_8250_RUNTIME_UARTS=4CONFIG_SERIAL_CORE=yCONFIG_SERIAL_CORE_CONSOLE=yCONFIG_IPMI_HANDLER=yCONFIG_IPMI_DEVICE_INTERFACE=yCONFIG_IPMI_SI=yCONFIG_IPMI_WATCHDOG=yCONFIG_IPMI_POWEROFF=yCONFIG_NVRAM=mCONFIG_HPET=yCONFIG_HPET_MMAP=yCONFIG_DEVPORT=yCONFIG_I2C=yCONFIG_I2C_BOARDINFO=yCONFIG_I2C_COMPAT=yCONFIG_I2C_HELPER_AUTO=yCONFIG_I2C_ALGOBIT=yCONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=yCONFIG_POWER_SUPPLY=yCONFIG_HWMON=yCONFIG_SENSORS_CORETEMP=yCONFIG_THERMAL=yCONFIG_THERMAL_HWMON=yCONFIG_WATCHDOG=yCONFIG_WATCHDOG_CORE=yCONFIG_HP_WATCHDOG=yCONFIG_HPWDT_NMI_DECODING=yCONFIG_SSB_POSSIBLE=yCONFIG_BCMA_POSSIBLE=yCONFIG_MFD_CORE=yCONFIG_LPC_SCH=yCONFIG_AGP=yCONFIG_AGP_AMD64=yCONFIG_VGA_ARB=yCONFIG_VGA_ARB_MAX_GPUS=2CONFIG_DRM=yCONFIG_DRM_KMS_HELPER=yCONFIG_DRM_LOAD_EDID_FIRMWARE=yCONFIG_DRM_TTM=yCONFIG_DRM_RADEON=yCONFIG_DRM_RADEON_KMS=yCONFIG_FB=yCONFIG_FB_CFB_FILLRECT=yCONFIG_FB_CFB_COPYAREA=yCONFIG_FB_CFB_IMAGEBLIT=yCONFIG_BACKLIGHT_LCD_SUPPORT=yCONFIG_BACKLIGHT_CLASS_DEVICE=yCONFIG_VGA_CONSOLE=yCONFIG_VGACON_SOFT_SCROLLBACK=yCONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128CONFIG_DUMMY_CONSOLE=yCONFIG_FRAMEBUFFER_CONSOLE=yCONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=yCONFIG_LOGO=yCONFIG_LOGO_LINUX_CLUT224=yCONFIG_HID_SUPPORT=yCONFIG_HID=yCONFIG_HID_BATTERY_STRENGTH=yCONFIG_USB_HID=yCONFIG_HID_A4TECH=yCONFIG_HID_APPLE=yCONFIG_HID_BELKIN=yCONFIG_HID_CHERRY=yCONFIG_HID_CHICONY=yCONFIG_HID_CYPRESS=yCONFIG_HID_EZKEY=yCONFIG_HID_KYE=yCONFIG_HID_KENSINGTON=yCONFIG_HID_LOGITECH=yCONFIG_HID_MICROSOFT=yCONFIG_HID_MONTEREY=yCONFIG_USB_SUPPORT=yCONFIG_USB_ARCH_HAS_OHCI=yCONFIG_USB_ARCH_HAS_EHCI=yCONFIG_USB_ARCH_HAS_XHCI=yCONFIG_USB_COMMON=yCONFIG_USB_ARCH_HAS_HCD=yCONFIG_USB=yCONFIG_USB_ANNOUNCE_NEW_DEVICES=yCONFIG_USB_DYNAMIC_MINORS=yCONFIG_USB_EHCI_HCD=yCONFIG_USB_UHCI_HCD=yCONFIG_USB_STORAGE=mCONFIG_RTC_LIB=yCONFIG_RTC_CLASS=yCONFIG_RTC_HCTOSYS=yCONFIG_RTC_HCTOSYS_DEVICE="rtc0"CONFIG_RTC_INTF_SYSFS=yCONFIG_RTC_INTF_PROC=yCONFIG_RTC_INTF_DEV=yCONFIG_RTC_DRV_CMOS=yCONFIG_DMADEVICES=yCONFIG_INTEL_IOATDMA=yCONFIG_DMA_ENGINE=yCONFIG_NET_DMA=yCONFIG_DCA=yCONFIG_X86_PLATFORM_DEVICES=yCONFIG_CLKEVT_I8253=yCONFIG_I8253_LOCK=yCONFIG_CLKBLD_I8253=yCONFIG_IOMMU_API=yCONFIG_IOMMU_SUPPORT=yCONFIG_DMAR_TABLE=yCONFIG_INTEL_IOMMU=yCONFIG_INTEL_IOMMU_DEFAULT_ON=yCONFIG_INTEL_IOMMU_FLOPPY_WA=yCONFIG_FIRMWARE_MEMMAP=yCONFIG_DMIID=yCONFIG_DMI_SYSFS=yCONFIG_DCACHE_WORD_ACCESS=yCONFIG_EXT2_FS=mCONFIG_EXT2_FS_XATTR=yCONFIG_EXT2_FS_POSIX_ACL=yCONFIG_EXT2_FS_SECURITY=yCONFIG_EXT3_FS=yCONFIG_EXT3_FS_XATTR=yCONFIG_EXT3_FS_POSIX_ACL=yCONFIG_EXT3_FS_SECURITY=yCONFIG_JBD=yCONFIG_FS_MBCACHE=yCONFIG_XFS_FS=yCONFIG_XFS_POSIX_ACL=yCONFIG_FS_POSIX_ACL=yCONFIG_EXPORTFS=yCONFIG_FILE_LOCKING=yCONFIG_FSNOTIFY=yCONFIG_INOTIFY_USER=yCONFIG_GENERIC_ACL=yCONFIG_ISO9660_FS=mCONFIG_JOLIET=yCONFIG_ZISOFS=yCONFIG_UDF_FS=mCONFIG_UDF_NLS=yCONFIG_PROC_FS=yCONFIG_PROC_SYSCTL=yCONFIG_PROC_PAGE_MONITOR=yCONFIG_SYSFS=yCONFIG_TMPFS=yCONFIG_TMPFS_POSIX_ACL=yCONFIG_TMPFS_XATTR=yCONFIG_CONFIGFS_FS=mCONFIG_MISC_FILESYSTEMS=yCONFIG_SQUASHFS=yCONFIG_SQUASHFS_XATTR=yCONFIG_SQUASHFS_ZLIB=yCONFIG_SQUASHFS_4K_DEVBLK_SIZE=yCONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3CONFIG_PSTORE=yCONFIG_NETWORK_FILESYSTEMS=yCONFIG_NFS_FS=mCONFIG_NFS_V3=yCONFIG_NFS_V3_ACL=yCONFIG_NFSD=mCONFIG_NFSD_V2_ACL=yCONFIG_NFSD_V3=yCONFIG_NFSD_V3_ACL=yCONFIG_LOCKD=mCONFIG_LOCKD_V4=yCONFIG_NFS_ACL_SUPPORT=mCONFIG_NFS_COMMON=yCONFIG_SUNRPC=mCONFIG_NLS=yCONFIG_NLS_DEFAULT="utf8"CONFIG_NLS_CODEPAGE_437=yCONFIG_NLS_CODEPAGE_850=yCONFIG_NLS_ASCII=yCONFIG_NLS_ISO8859_1=yCONFIG_NLS_ISO8859_15=yCONFIG_NLS_UTF8=yCONFIG_TRACE_IRQFLAGS_SUPPORT=yCONFIG_PRINTK_TIME=yCONFIG_DEFAULT_MESSAGE_LOGLEVEL=4CONFIG_FRAME_WARN=2048CONFIG_MAGIC_SYSRQ=yCONFIG_DEBUG_KERNEL=yCONFIG_DETECT_HUNG_TASK=yCONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0CONFIG_DEBUG_BUGVERBOSE=yCONFIG_DEBUG_MEMORY_INIT=yCONFIG_ARCH_WANT_FRAME_POINTERS=yCONFIG_FRAME_POINTER=yCONFIG_RCU_CPU_STALL_TIMEOUT=60CONFIG_USER_STACKTRACE_SUPPORT=yCONFIG_HAVE_FUNCTION_TRACER=yCONFIG_HAVE_FUNCTION_GRAPH_TRACER=yCONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=yCONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=yCONFIG_HAVE_DYNAMIC_FTRACE=yCONFIG_HAVE_FTRACE_MCOUNT_RECORD=yCONFIG_HAVE_SYSCALL_TRACEPOINTS=yCONFIG_HAVE_C_RECORDMCOUNT=yCONFIG_TRACING_SUPPORT=yCONFIG_HAVE_ARCH_KGDB=yCONFIG_HAVE_ARCH_KMEMCHECK=yCONFIG_STRICT_DEVMEM=yCONFIG_X86_VERBOSE_BOOTUP=yCONFIG_EARLY_PRINTK=yCONFIG_DEBUG_RODATA=yCONFIG_DEBUG_SET_MODULE_RONX=yCONFIG_HAVE_MMIOTRACE_SUPPORT=yCONFIG_IO_DELAY_TYPE_0X80=0CONFIG_IO_DELAY_TYPE_0XED=1CONFIG_IO_DELAY_TYPE_UDELAY=2CONFIG_IO_DELAY_TYPE_NONE=3CONFIG_IO_DELAY_0X80=yCONFIG_DEFAULT_IO_DELAY_TYPE=0CONFIG_OPTIMIZE_INLINING=yCONFIG_DEBUG_STRICT_USER_COPY_CHECKS=yCONFIG_DEFAULT_SECURITY_DAC=yCONFIG_DEFAULT_SECURITY=""CONFIG_ASYNC_TX_DISABLE_PQ_VAL_DMA=yCONFIG_ASYNC_TX_DISABLE_XOR_VAL_DMA=yCONFIG_CRYPTO=yCONFIG_CRYPTO_ALGAPI=yCONFIG_CRYPTO_ALGAPI2=yCONFIG_CRYPTO_AEAD2=yCONFIG_CRYPTO_BLKCIPHER=yCONFIG_CRYPTO_BLKCIPHER2=yCONFIG_CRYPTO_HASH=yCONFIG_CRYPTO_HASH2=yCONFIG_CRYPTO_RNG=yCONFIG_CRYPTO_RNG2=yCONFIG_CRYPTO_PCOMP2=yCONFIG_CRYPTO_MANAGER=yCONFIG_CRYPTO_MANAGER2=yCONFIG_CRYPTO_MANAGER_DISABLE_TESTS=yCONFIG_CRYPTO_GF128MUL=yCONFIG_CRYPTO_WORKQUEUE=yCONFIG_CRYPTO_CRYPTD=yCONFIG_CRYPTO_CBC=yCONFIG_CRYPTO_LRW=yCONFIG_CRYPTO_XTS=yCONFIG_CRYPTO_SHA1=yCONFIG_CRYPTO_SHA256=yCONFIG_CRYPTO_AES=yCONFIG_CRYPTO_AES_X86_64=yCONFIG_CRYPTO_AES_NI_INTEL=yCONFIG_CRYPTO_BLOWFISH=yCONFIG_CRYPTO_BLOWFISH_COMMON=yCONFIG_CRYPTO_BLOWFISH_X86_64=yCONFIG_CRYPTO_SERPENT=yCONFIG_CRYPTO_SERPENT_SSE2_X86_64=yCONFIG_CRYPTO_TWOFISH_COMMON=yCONFIG_CRYPTO_TWOFISH_X86_64=yCONFIG_CRYPTO_TWOFISH_X86_64_3WAY=yCONFIG_CRYPTO_ANSI_CPRNG=yCONFIG_CRYPTO_USER_API=yCONFIG_CRYPTO_USER_API_HASH=yCONFIG_CRYPTO_USER_API_SKCIPHER=yCONFIG_CRYPTO_HW=yCONFIG_HAVE_KVM=yCONFIG_BITREVERSE=yCONFIG_GENERIC_FIND_FIRST_BIT=yCONFIG_GENERIC_PCI_IOMAP=yCONFIG_GENERIC_IOMAP=yCONFIG_GENERIC_IO=yCONFIG_CRC_T10DIF=yCONFIG_CRC_ITU_T=mCONFIG_CRC32=yCONFIG_CRC32_SLICEBY8=yCONFIG_ZLIB_INFLATE=yCONFIG_LZO_DECOMPRESS=yCONFIG_XZ_DEC=yCONFIG_XZ_DEC_X86=yCONFIG_XZ_DEC_POWERPC=yCONFIG_XZ_DEC_IA64=yCONFIG_XZ_DEC_ARM=yCONFIG_XZ_DEC_ARMTHUMB=yCONFIG_XZ_DEC_SPARC=yCONFIG_XZ_DEC_BCJ=yCONFIG_DECOMPRESS_GZIP=yCONFIG_DECOMPRESS_BZIP2=yCONFIG_DECOMPRESS_LZMA=yCONFIG_DECOMPRESS_XZ=yCONFIG_DECOMPRESS_LZO=yCONFIG_HAS_IOMEM=yCONFIG_HAS_IOPORT=yCONFIG_HAS_DMA=yCONFIG_CPU_RMAP=yCONFIG_DQL=yCONFIG_NLATTR=y
Quoted 42 lines · On Mon, 2 Apr 2012 16:27:16 Bruno Prémont wrote:
Trying to boot a freshly built 3.4-rc1 (
x86_64) kernel I'm getting the following trace (server is HP Proliant G4):[ 0.986317] BUG: unable to handle kernel NULL pointer dereference at (null) [ 0.990542] IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.993693] PGD 0 [ 0.994682] Oops: 0000 [#1] SMP [ 0.996198] CPU 0 [ 0.996198] Modules linked in: [ 0.996198] [ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 [ 0.996198] RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 [ 0.996198] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 [ 0.996198] RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 [ 0.996198] RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 [ 0.996198] R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 [ 0.996198] R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 [ 0.996198] FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 [ 0.996198] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 0.996198] CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 [ 0.996198] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 0.996198] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 0.996198] Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) [ 0.996198] Stack: [ 0.996198] ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 [ 0.996198] ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 [ 0.996198] 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be [ 0.996198] Call Trace: [ 0.996198] [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [ 0.996198] [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [ 0.996198] [<ffffffff81377d3d>] device_add+0x46d/0x6a0 [ 0.996198] [<ffffffff81377891>] ? device_private_init+0x51/0x90 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 0.996198] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 0.996198] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 0.996198] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 0.996198] [<ffffffff815f3714>] kernel_thread_helper+0x4/0x10 [ 0.996198] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373
Quoted 8 lines
[ 0.996198] [<ffffffff815f3710>] ? gs_change+0xb/0xb [ 0.996198] Code: ff 85 c0 0f 85 bc 00 00 00 4c 8b 6d c8 4d 85 ed 74 15 41 8b 45 00 85 c0 0f 84 0b 01 00 00 f0 41 ff 45 00 4c 8b 6d c8 49 8b 5e 10 <48> 8b 03 48 85 c0 74 71 45 31 e4 eb 44 49 8b 46 08 48 85 c0 74 [ 0.996198] RIP [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP <ffff88019485fd70> [ 0.996198] CR2: 0000000000000000 [ 1.131357] ---[ end trace 319c95c486d7d9cd ]--- [ 1.133676] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 1.133677]
The patch below works around it and leaves exactly one trace for WARN_ON() matching above BUG.
With it, system boots to userspace.
Thanks,
Bruno
---
fs/sysfs/group.c +2 -1
@@ -32,7 +32,8 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,struct attribute *const * attr;int error =0 , i; -for (i =0 , attr = grp->attrs; *attr && !error; i++, attr++) { +WARN_ON (!grp->attrs); +for (i =0 , attr = grp->attrs; attr && *attr && !error; i++, attr++) {umode_t mode =0 ;/* in update mode, we're changing the permissions or
Quoted 65 lines · Bruno Prémont
Quoted 42 lines · On Mon, 2 Apr 2012 16:27:16 Bruno Prémont wrote:
Trying to boot a freshly built 3.4-rc1 (
x86_64) kernel I'm getting the following trace (server is HP Proliant G4):[ 0.986317] BUG: unable to handle kernel NULL pointer dereference at (null) [ 0.990542] IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.993693] PGD 0 [ 0.994682] Oops: 0000 [#1] SMP [ 0.996198] CPU 0 [ 0.996198] Modules linked in: [ 0.996198] [ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 [ 0.996198] RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 [ 0.996198] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 [ 0.996198] RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 [ 0.996198] RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 [ 0.996198] R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 [ 0.996198] R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 [ 0.996198] FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 [ 0.996198] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 0.996198] CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 [ 0.996198] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 0.996198] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 0.996198] Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) [ 0.996198] Stack: [ 0.996198] ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 [ 0.996198] ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 [ 0.996198] 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be [ 0.996198] Call Trace: [ 0.996198] [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [ 0.996198] [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [ 0.996198] [<ffffffff81377d3d>] device_add+0x46d/0x6a0 [ 0.996198] [<ffffffff81377891>] ? device_private_init+0x51/0x90 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 0.996198] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 0.996198] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 0.996198] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 0.996198] [<ffffffff815f3714>] kernel_thread_helper+0x4/0x10 [ 0.996198] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373Quoted 8 lines
[ 0.996198] [<ffffffff815f3710>] ? gs_change+0xb/0xb [ 0.996198] Code: ff 85 c0 0f 85 bc 00 00 00 4c 8b 6d c8 4d 85 ed 74 15 41 8b 45 00 85 c0 0f 84 0b 01 00 00 f0 41 ff 45 00 4c 8b 6d c8 49 8b 5e 10 <48> 8b 03 48 85 c0 74 71 45 31 e4 eb 44 49 8b 46 08 48 85 c0 74 [ 0.996198] RIP [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP <ffff88019485fd70> [ 0.996198] CR2: 0000000000000000 [ 1.131357] ---[ end trace 319c95c486d7d9cd ]--- [ 1.133676] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 1.133677]The patch below works around it and leaves exactly one trace for
WARN_ON()matching above BUG.
With it, system boots to userspace.Thanks,
Bruno---
fs/sysfs/group.c +0
-0
fs/sysfs/group.c static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj, · line 39
Quoted 9 lines
fs/sysfs/group.c +2
-1@@ -32,7 +32,8 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,struct attribute *const * attr;int error =0 , i; -for (i =0 , attr = grp->attrs; *attr && !error; i++, attr++) { +WARN_ON (!grp->attrs); +for (i =0 , attr = grp->attrs; attr && *attr && !error; i++, attr++) {umode_t mode =0 ;/* in update mode, we're changing the permissions or
Sysfs has not changed in this area from 3.3.
The sysctl in your backtrace looks like left over addresses on the stack.
The backtrack indicates this is something perf related going wonky.
I would suggest you try disabling your perf related options one by one until the broken one shows up. Or possibly just initially disable perf.
This looks like one of those crazy things where something registers with the perf subsystem, and then perf later registers it with sysfs, and whatever was registered did not have set the needed group attrs.
Eric
[adding a few perf people to CC as might originate from perf]
Quoted 78 lines · On Mon, 02 April 2012 Eric W. Biederman wrote:
Quoted 65 lines · Bruno Prémont
Quoted 42 lines · On Mon, 2 Apr 2012 16:27:16 Bruno Prémont wrote:
Trying to boot a freshly built 3.4-rc1 (
x86_64) kernel I'm getting the following trace (server is HP Proliant G4):[ 0.986317] BUG: unable to handle kernel NULL pointer dereference at (null) [ 0.990542] IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.993693] PGD 0 [ 0.994682] Oops: 0000 [#1] SMP [ 0.996198] CPU 0 [ 0.996198] Modules linked in: [ 0.996198] [ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 [ 0.996198] RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 [ 0.996198] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 [ 0.996198] RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 [ 0.996198] RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 [ 0.996198] R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 [ 0.996198] R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 [ 0.996198] FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 [ 0.996198] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 0.996198] CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 [ 0.996198] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 0.996198] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 0.996198] Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) [ 0.996198] Stack: [ 0.996198] ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 [ 0.996198] ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 [ 0.996198] 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be [ 0.996198] Call Trace: [ 0.996198] [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [ 0.996198] [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [ 0.996198] [<ffffffff81377d3d>] device_add+0x46d/0x6a0 [ 0.996198] [<ffffffff81377891>] ? device_private_init+0x51/0x90 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 0.996198] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 0.996198] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 0.996198] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 0.996198] [<ffffffff815f3714>] kernel_thread_helper+0x4/0x10 [ 0.996198] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373Quoted 8 lines
[ 0.996198] [<ffffffff815f3710>] ? gs_change+0xb/0xb [ 0.996198] Code: ff 85 c0 0f 85 bc 00 00 00 4c 8b 6d c8 4d 85 ed 74 15 41 8b 45 00 85 c0 0f 84 0b 01 00 00 f0 41 ff 45 00 4c 8b 6d c8 49 8b 5e 10 <48> 8b 03 48 85 c0 74 71 45 31 e4 eb 44 49 8b 46 08 48 85 c0 74 [ 0.996198] RIP [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP <ffff88019485fd70> [ 0.996198] CR2: 0000000000000000 [ 1.131357] ---[ end trace 319c95c486d7d9cd ]--- [ 1.133676] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 1.133677]The patch below works around it and leaves exactly one trace for
WARN_ON()matching above BUG.
With it, system boots to userspace.Thanks,
Bruno---
fs/sysfs/group.c +0
-0fs/sysfs/group.c static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj, · line 39
Quoted 9 lines
fs/sysfs/group.c +2
-1@@ -32,7 +32,8 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,struct attribute *const * attr;int error =0 , i; -for (i =0 , attr = grp->attrs; *attr && !error; i++, attr++) { +WARN_ON (!grp->attrs); +for (i =0 , attr = grp->attrs; attr && *attr && !error; i++, attr++) {umode_t mode =0 ;/* in update mode, we're changing the permissions or Sysfs has not changed in this area from 3.3.
Quoted 6 lines
The sysctl in your backtrace looks like left over addresses on the stack.
The backtrack indicates this is something perf related going wonky.
I would suggest you try disabling your perf related options one by one until the broken one shows up. Or possibly just initially disable perf.
Well, I didn't enable perf, all perf-related options that are enabled are selected by X86!
Symbol: HAVE_PERF_EVENTS [=y]
Type : boolean
Selected by: X86 [=y]
Symbol: PERF_EVENTS [=y]
Type : boolean
Prompt: Kernel performance events and counters
Defined at init/Kconfig:1157
Depends on: HAVE_PERF_EVENTS [=y]
Location:
-> General setup
-> Kernel Performance Events And Counters Selects: ANON_INODES [=y] && IRQ_WORK [=y]
Selected by: X86 [=y] || KVM [=n] && VIRTUALIZATION [=n] && HAVE_KVM [=y] && PCI [=y] && NET [=y]
Symbol: HAVE_PERF_EVENTS_NMI [=y]
Type : boolean
Selected by: X86 [=y]
Quoted 6 lines
This looks like one of those crazy things where something registers with the perf subsystem, and then perf later registers it with sysfs, and whatever was registered did not have set the needed group attrs.
From quick-reading
kernel/events/core.cwhich containsperf_event_sysfs_init()
and pmu_dev_alloc() and commits from v3.3..v3.4 for that file commit 0c9d42ed4cee2aa1dfc3a260b741baae8615744f (perf, x86: Provide means for disabling userspace RDPMC) by Peter looks like a possible candidate or at least startpoint:
kernel/events/core.c +1 -0
@@ -5505,6 +5505,7 @@ static int pmu_dev_alloc(struct pmu *pmu)if (!pmu->dev) goto out; + pmu->dev->groups = pmu->attr_groups;device_initialize (pmu->dev); ret =dev_set_name (pmu->dev,"%s" , pmu->name);if (ret)
Will try bisecting corresponding merge tomorrow when I have full access to affected system.
Thanks,
Bruno
Quoted 134 lines · Bruno Prémont
[adding a few perf people to CC as might originate from perf]
Quoted 78 lines · On Mon, 02 April 2012 Eric W. Biederman wrote:
Quoted 65 lines · Bruno Prémont
Quoted 42 lines · On Mon, 2 Apr 2012 16:27:16 Bruno Prémont wrote:
Trying to boot a freshly built 3.4-rc1 (
x86_64) kernel I'm getting the following trace (server is HP Proliant G4):[ 0.986317] BUG: unable to handle kernel NULL pointer dereference at (null) [ 0.990542] IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.993693] PGD 0 [ 0.994682] Oops: 0000 [#1] SMP [ 0.996198] CPU 0 [ 0.996198] Modules linked in: [ 0.996198] [ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 [ 0.996198] RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 [ 0.996198] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 [ 0.996198] RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 [ 0.996198] RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 [ 0.996198] R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 [ 0.996198] R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 [ 0.996198] FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 [ 0.996198] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 0.996198] CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 [ 0.996198] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 0.996198] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 0.996198] Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) [ 0.996198] Stack: [ 0.996198] ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 [ 0.996198] ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 [ 0.996198] 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be [ 0.996198] Call Trace: [ 0.996198] [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [ 0.996198] [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [ 0.996198] [<ffffffff81377d3d>] device_add+0x46d/0x6a0 [ 0.996198] [<ffffffff81377891>] ? device_private_init+0x51/0x90 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 0.996198] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 0.996198] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 0.996198] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 0.996198] [<ffffffff815f3714>] kernel_thread_helper+0x4/0x10 [ 0.996198] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373Quoted 8 lines
[ 0.996198] [<ffffffff815f3710>] ? gs_change+0xb/0xb [ 0.996198] Code: ff 85 c0 0f 85 bc 00 00 00 4c 8b 6d c8 4d 85 ed 74 15 41 8b 45 00 85 c0 0f 84 0b 01 00 00 f0 41 ff 45 00 4c 8b 6d c8 49 8b 5e 10<48> 8b 03 48 85 c0 74 71 45 31 e4 eb 44 49 8b 46 08 48 85 c0 74 [ 0.996198] RIP [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP<ffff88019485fd70> [ 0.996198] CR2: 0000000000000000 [ 1.131357] ---[ end trace 319c95c486d7d9cd ]--- [ 1.133676] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 1.133677]The patch below works around it and leaves exactly one trace for
WARN_ON()matching above BUG.
With it, system boots to userspace.Thanks,
Bruno---
fs/sysfs/group.c +0
-0fs/sysfs/group.c static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj, · line 39
Quoted 9 lines
fs/sysfs/group.c +2
-1@@ -32,7 +32,8 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,struct attribute *const * attr;int error =0 , i; -for (i =0 , attr = grp->attrs; *attr&& !error; i++, attr++) { +WARN_ON (!grp->attrs); +for (i =0 , attr = grp->attrs; attr&& *attr&& !error; i++, attr++) {umode_t mode =0 ;/* in update mode, we're changing the permissions or Sysfs has not changed in this area from 3.3.
Quoted 6 lines
The sysctl in your backtrace looks like left over addresses on the stack.
The backtrack indicates this is something perf related going wonky.
I would suggest you try disabling your perf related options one by one until the broken one shows up. Or possibly just initially disable perf.
Well, I didn't enable perf, all perf-related options that are enabled are selected by X86!
Symbol:
HAVE_PERF_EVENTS[=y]
Type : boolean
Selected by: X86 [=y]Symbol:
PERF_EVENTS[=y]
Type : boolean
Prompt: Kernel performance events and counters
Defined at init/Kconfig:1157
Depends on:HAVE_PERF_EVENTS[=y]
Location:-> General setup -> Kernel Performance Events And CountersSelects:
ANON_INODES[=y]&&IRQ_WORK[=y]
Selected by: X86 [=y] || KVM [=n]&& VIRTUALIZATION [=n]&&HAVE_KVM[=y]&& PCI [=y]&& NET [=y]Symbol:
HAVE_PERF_EVENTS_NMI[=y]
Type : boolean
Selected by: X86 [=y]Quoted 3 lines
This looks like one of those crazy things where something registers with the perf subsystem, and then perf later registers it with sysfs, and whatever was registered did not have set the needed group attrs.
From quick-reading
kernel/events/core.cwhich containsperf_event_sysfs_init()
andpmu_dev_alloc()and commits from v3.3..v3.4 for that file commit0c9d42ed4cee2aa1dfc3a260b741baae8615744f(perf, x86: Provide means for disabling userspace RDPMC) by Peter looks like a possible candidate or at least startpoint:kernel/events/core.c +1
-0@@ -5505,6 +5505,7 @@ static int pmu_dev_alloc(struct pmu *pmu)if (!pmu->dev) goto out; + pmu->dev->groups = pmu->attr_groups;device_initialize (pmu->dev); ret =dev_set_name (pmu->dev,"%s" , pmu->name);if (ret)
Quoted 2 lines
Will try bisecting corresponding merge tomorrow when I have full access to affected system.
Perhaps:
641cc93 perf: Adding sysfs group format attribute for pmu device
David
Quoted 135 lines · David Ahern
Quoted 134 lines · Bruno Prémont
[adding a few perf people to CC as might originate from perf]
Quoted 78 lines · On Mon, 02 April 2012 Eric W. Biederman wrote:
Quoted 65 lines · Bruno Prémont
Quoted 42 lines · On Mon, 2 Apr 2012 16:27:16 Bruno Prémont wrote:
Trying to boot a freshly built 3.4-rc1 (
x86_64) kernel I'm getting the following trace (server is HP Proliant G4):[ 0.986317] BUG: unable to handle kernel NULL pointer dereference at (null) [ 0.990542] IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.993693] PGD 0 [ 0.994682] Oops: 0000 [#1] SMP [ 0.996198] CPU 0 [ 0.996198] Modules linked in: [ 0.996198] [ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 [ 0.996198] RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 [ 0.996198] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 [ 0.996198] RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 [ 0.996198] RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 [ 0.996198] R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 [ 0.996198] R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 [ 0.996198] FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 [ 0.996198] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 0.996198] CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 [ 0.996198] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 0.996198] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 0.996198] Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) [ 0.996198] Stack: [ 0.996198] ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 [ 0.996198] ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 [ 0.996198] 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be [ 0.996198] Call Trace: [ 0.996198] [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [ 0.996198] [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [ 0.996198] [<ffffffff81377d3d>] device_add+0x46d/0x6a0 [ 0.996198] [<ffffffff81377891>] ? device_private_init+0x51/0x90 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 0.996198] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 0.996198] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 0.996198] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 0.996198] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 0.996198] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 0.996198] [<ffffffff815f3714>] kernel_thread_helper+0x4/0x10 [ 0.996198] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373Quoted 8 lines
[ 0.996198] [<ffffffff815f3710>] ? gs_change+0xb/0xb [ 0.996198] Code: ff 85 c0 0f 85 bc 00 00 00 4c 8b 6d c8 4d 85 ed 74 15 41 8b 45 00 85 c0 0f 84 0b 01 00 00 f0 41 ff 45 00 4c 8b 6d c8 49 8b 5e 10<48> 8b 03 48 85 c0 74 71 45 31 e4 eb 44 49 8b 46 08 48 85 c0 74 [ 0.996198] RIP [<ffffffff81152673>] internal_create_group+0x83/0x1a0 [ 0.996198] RSP<ffff88019485fd70> [ 0.996198] CR2: 0000000000000000 [ 1.131357] ---[ end trace 319c95c486d7d9cd ]--- [ 1.133676] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 1.133677]The patch below works around it and leaves exactly one trace for
WARN_ON()matching above BUG.
With it, system boots to userspace.Thanks,
Bruno---
fs/sysfs/group.c +0
-0fs/sysfs/group.c static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj, · line 39
Quoted 9 lines
fs/sysfs/group.c +2
-1@@ -32,7 +32,8 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,struct attribute *const * attr;int error =0 , i; -for (i =0 , attr = grp->attrs; *attr&& !error; i++, attr++) { +WARN_ON (!grp->attrs); +for (i =0 , attr = grp->attrs; attr&& *attr&& !error; i++, attr++) {umode_t mode =0 ;/* in update mode, we're changing the permissions or Sysfs has not changed in this area from 3.3.
Quoted 6 lines
The sysctl in your backtrace looks like left over addresses on the stack.
The backtrack indicates this is something perf related going wonky.
I would suggest you try disabling your perf related options one by one until the broken one shows up. Or possibly just initially disable perf.
Well, I didn't enable perf, all perf-related options that are enabled are selected by X86!
Symbol:
HAVE_PERF_EVENTS[=y]
Type : boolean
Selected by: X86 [=y]Symbol:
PERF_EVENTS[=y]
Type : boolean
Prompt: Kernel performance events and counters
Defined at init/Kconfig:1157
Depends on:HAVE_PERF_EVENTS[=y]
Location:-> General setup -> Kernel Performance Events And CountersSelects:
ANON_INODES[=y]&&IRQ_WORK[=y]
Selected by: X86 [=y] || KVM [=n]&& VIRTUALIZATION [=n]&&HAVE_KVM[=y]&& PCI [=y]&& NET [=y]Symbol:
HAVE_PERF_EVENTS_NMI[=y]
Type : boolean
Selected by: X86 [=y]Quoted 3 lines
This looks like one of those crazy things where something registers with the perf subsystem, and then perf later registers it with sysfs, and whatever was registered did not have set the needed group attrs.
From quick-reading
kernel/events/core.cwhich containsperf_event_sysfs_init()andpmu_dev_alloc()and commits from v3.3..v3.4 for that file commit0c9d42ed4cee2aa1dfc3a260b741baae8615744f(perf, x86: Provide means for disabling userspace RDPMC) by Peter looks like a possible candidate or at least startpoint:kernel/events/core.c +1
-0@@ -5505,6 +5505,7 @@ static int pmu_dev_alloc(struct pmu *pmu)if (!pmu->dev) goto out; + pmu->dev->groups = pmu->attr_groups;device_initialize (pmu->dev); ret =dev_set_name (pmu->dev,"%s" , pmu->name);if (ret)
Quoted 7 lines
Quoted 2 lines
Will try bisecting corresponding merge tomorrow when I have full access to affected system.
Perhaps:
641cc93 perf: Adding sysfs group format attribute for pmu deviceDavid
hi,
looks like this is related to a bug just fixed by Peter:
Commit-ID: 7b8e6da46b921d30ac1553cac56d8fb74f0b431d Gitweb:
http://git.kernel.org/tip/7b8e6da46b921d30ac1553cac56d8fb74f0b431d
Author: Peter Zijlstra <[email protected]> AuthorDate: Tue, 27 Mar 2012 16:50:42 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 3 Apr 2012 08:33:38 +0200
perf/x86/p4: Add format attributes
jirka
Quoted 1 line · Bruno Prémont
Quoted 1 line
Quoted 1 line
Quoted 1 line
[ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4
Is this a netburst based space heater?
Peter Zijlstra
maintainerQuoted 4 lines · Peter Zijlstra
Quoted 1 line · Bruno Prémont
Quoted 1 line
Quoted 1 line
Quoted 1 line
[ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4Is this a netburst based space heater?
In particular, does: https://lkml.org/lkml/2012/3/27/182 , sort it?
Ingo, could you pick that one up and route it Linus wards?
Bruno Prémont
Tested-byQuoted 9 lines · On Mon, 02 Apr 2012 23:46:33 Peter Zijlstra wrote:
Quoted 4 lines · Peter Zijlstra
Quoted 1 line · Bruno Prémont
Quoted 1 line
Quoted 1 line
Quoted 1 line
[ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4Is this a netburst based space heater?
In particular, does: https://lkml.org/lkml/2012/3/27/182 , sort it?
Ingo, could you pick that one up and route it Linus wards?
It does sort it!
Quoted 9 lines · Peter Zijlstra
Quoted 4 lines · Peter Zijlstra
Quoted 1 line · Bruno Prémont
Quoted 1 line
Quoted 1 line
Quoted 1 line
[ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4Is this a netburst based space heater?
In particular, does: https://lkml.org/lkml/2012/3/27/182 , sort it?
Ingo, could you pick that one up and route it Linus wards?
Will do - but the underlying generic bug should be fixed as
well: we must not crash just because some attributes are missing in a rarely used sub-driver ...
We should WARN_ON(), etc. - but not crash.
Thanks,
Ingo
PATCH 1/1 Prevent crash on missing sysfs attribute group
Prevent kernel from crashing when a device is being registered with sysfs but has no (aka NULL) group attributes, but warn about it so calling path can get fixed.
This would warn instead of trying NULL pointer deref like:
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 PGD 0 Oops: 0000 [#1] SMP CPU 0 Modules linked in:
Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4
RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) Stack: ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be Call Trace: [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [<ffffffff81377d3d>] device_add+0x46d/0x6a0 ...
---
Quoted 10 lines · On Tue, 3 Apr 2012 08:02:52 +0200 Ingo Molnar wrote:
Quoted 8 lines · Peter Zijlstra
Quoted 4 lines · Peter Zijlstra
Quoted 1 line · Bruno Prémont
Quoted 1 line
Quoted 1 line
Quoted 1 line
[ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4Is this a netburst based space heater?
In particular, does: https://lkml.org/lkml/2012/3/27/182 , sort it?
Quoted 7 lines
Quoted 1 line
Ingo, could you pick that one up and route it Linus wards?
Will do - but the underlying generic bug should be fixed as
well: we must not crash just because some attributes are missing in a rarely used sub-driver ...We should
WARN_ON(), etc. - but not crash.
Greg, is this ok for you or should the check be moved out to calling internal_create_group()?
---
fs/sysfs/group.c +2 -1
@@ -32,7 +32,8 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,struct attribute *const * attr;int error =0 , i; -for (i =0 , attr = grp->attrs; *attr && !error; i++, attr++) { +WARN_ON (!grp->attrs); +for (i =0 , attr = grp->attrs; attr && *attr && !error; i++, attr++) {umode_t mode =0 ;/* in update mode, we're changing the permissions or
Re: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 66 lines · Bruno Prémont
Prevent kernel from crashing when a device is being registered with sysfs but has no (aka NULL) group attributes, but warn about it so calling path can get fixed.
This would warn instead of trying NULL pointer deref like:
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 PGD 0 Oops: 0000 [#1] SMP CPU 0 Modules linked in:Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4
RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) Stack: ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be Call Trace: [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [<ffffffff81377d3d>] device_add+0x46d/0x6a0 ...Signed-off-by Bruno Prémont <[email protected]>---
Quoted 10 lines · On Tue, 3 Apr 2012 08:02:52 +0200 Ingo Molnar wrote:
Quoted 8 lines · Peter Zijlstra
Quoted 4 lines · Peter Zijlstra
Quoted 1 line · Bruno Prémont
Quoted 1 line
Quoted 1 line
Quoted 1 line
[ 0.996198] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4Is this a netburst based space heater?
In particular, does: https://lkml.org/lkml/2012/3/27/182 , sort it?
Quoted 7 lines
Quoted 1 line
Ingo, could you pick that one up and route it Linus wards?
Will do - but the underlying generic bug should be fixed as
well: we must not crash just because some attributes are missing in a rarely used sub-driver ...We should
WARN_ON(), etc. - but not crash.Greg, is this ok for you or should the check be moved out to calling
internal_create_group()?---
fs/sysfs/group.c +0
-0
fs/sysfs/group.c static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj, · line 37
Quoted 7 lines
fs/sysfs/group.c +2
-1@@ -32,7 +32,8 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,struct attribute *const * attr;int error =0 , i; -for (i =0 , attr = grp->attrs; *attr && !error; i++, attr++) { +WARN_ON (!grp->attrs); +for (i =0 , attr = grp->attrs; attr && *attr && !error; i++, attr++) {umode_t mode =0 ;
yeah.
Thanks,
Ingo
Re: [PATCH] Prevent crash on missing sysfs attribute group
In reply to Bruno PrémontQuoted 3 lines · Bruno Prémont
Prevent kernel from crashing when a device is being registered with sysfs but has no (aka NULL) group attributes, but warn about it so calling path can get fixed.
The idea is reasonable but the implementation is horrible.
Quoted 5 lines
Quoted 5 lines
Will do - but the underlying generic bug should be fixed as
well: we must not crash just because some attributes are missing in a rarely used sub-driver ...We should
WARN_ON(), etc. - but not crash.
FIX perf to include sanity checks.
Anything we do in sysfs is just pointless because perf was clever and the offender did not show up in the backtrace.
Right now perf is so bad we just waste everyone's time.
Quoted 2 lines
Greg, is this ok for you or should the check be moved out to calling
internal_create_group()?
Please put changes in internal_create_group where all of the rest of the checks are.
We should do something like:
if (!grp->attrs) {
WARN(1, "sysfs: idiot subsystem did not include attrs for group: %s/%s\n"
kobj->name, grp->name?"":grp->name);
return -EINVAL;
}As it stands your patch is horrible it leaves sysfs in an inconsistent state. Creating the directory and leaving it there. Not returning an error code. It looks like there are all kinds of weird problems that removing the group or updating the group could get into if we go with your patch.
Eric
Quoted 15 lines
---
fs/sysfs/group.c +2
-1@@ -32,7 +32,8 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,struct attribute *const * attr;int error =0 , i; -for (i =0 , attr = grp->attrs; *attr && !error; i++, attr++) { +WARN_ON (!grp->attrs); +for (i =0 , attr = grp->attrs; attr && *attr && !error; i++, attr++) {umode_t mode =0 ;/* in update mode, we're changing the permissions or
Re: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 10 lines · Eric W. Biederman
Nacked-by "Eric W. Biederman" <[email protected]>Quoted 3 lines · Bruno Prémont
Prevent kernel from crashing when a device is being registered with sysfs but has no (aka NULL) group attributes, but warn about it so calling path can get fixed.
The idea is reasonable but the implementation is horrible.
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Will do - but the underlying generic bug should be fixed as
well: we must not crash just because some attributes are missing in a rarely used sub-driver ...We should
WARN_ON(), etc. - but not crash.FIX perf to include sanity checks.
Huh, so put repeated, duplicated, inconsistently applied sanity checks into dozens of sysfs attribute using kernel subsystems?
Major FAIL, dude.
Quoted 10 lines
Anything we do in sysfs is just pointless because perf was clever and the offender did not show up in the backtrace.
Right now perf is so bad we just waste everyone's time.
Quoted 2 lines
Greg, is this ok for you or should the check be moved out to calling
internal_create_group()?Please put changes in
internal_create_groupwhere all of the rest of the checks are.
So you *do* agree that a check in a generic place is useful after all? ;-)
Quoted 7 lines
We should do something like:
if (!grp->attrs) { WARN(1, "sysfs: idiot subsystem did not include attrs for group: %s/%s\n" kobj->name, grp->name?"":grp->name); return -EINVAL; }
Quoted 5 lines
As it stands your patch is horrible it leaves sysfs in an inconsistent state. Creating the directory and leaving it there. Not returning an error code. It looks like there are all kinds of weird problems that removing the group or updating the group could get into if we go with your patch.
This is actually a sensible suggestion. Bruno, mind updating your patch to do something like this? Assuming Greg agrees with putting the check/warning there.
Eric's rant about putting sanit checks at every usage site is just crazy talk.
Thanks,
Ingo
PATCH v2 1/1 Prevent crash on unset sysfs group attributes
Do not let the kernel crash when a device is registered with sysfs while group attributes are not set (aka NULL).
Warn about the offender with some information about the offending device.
This would warn instead of trying NULL pointer deref like:
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 PGD 0 Oops: 0000 [#1] SMP CPU 0 Modules linked in:
Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>]
internal_create_group+0x83/0x1a0 RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) Stack: ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be Call Trace: [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [<ffffffff81377d3d>] device_add+0x46d/0x6a0 ...
---
Quoted 22 lines · On Tue, 3 Apr 2012 09:15:43 Ingo Molnar wrote:
Quoted 5 lines
Quoted 2 lines
Greg, is this ok for you or should the check be moved out to calling
internal_create_group()?Please put changes in
internal_create_groupwhere all of the rest of the checks are.So you *do* agree that a check in a generic place is useful after all? ;-)
Quoted 7 lines
We should do something like:
if (!grp->attrs) { WARN(1, "sysfs: idiot subsystem did not include attrs for group: %s/%s\n" kobj->name, grp->name?"":grp->name); return -EINVAL; }Quoted 5 lines
As it stands your patch is horrible it leaves sysfs in an inconsistent state. Creating the directory and leaving it there. Not returning an error code. It looks like there are all kinds of weird problems that removing the group or updating the group could get into if we go with your patch.
Quoted 3 lines
This is actually a sensible suggestion. Bruno, mind updating your patch to do something like this? Assuming Greg agrees with putting the check/warning there.
Here come a respin with Eric's suggestion.
In my case it would show the following result:
[ 0.975025] ------------[ cut here ]------------ [ 0.977507] WARNING: at /data/kernel/linux-2.6-git/fs/sysfs/group.c:72 internal_create_group+0x18c/0x1f0() [ 0.981932] Hardware name: ProLiant DL360 G4 [ 0.983916] sysfs: attrs not set by subsystem for group: cpu/ [ 0.987030] Modules linked in: [ 0.988664] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #6 [ 0.991639] Call Trace: [ 0.992911] [<ffffffff8104d11a>] warn_slowpath_common+0x7a/0xb0 [ 0.995903] [<ffffffff8104d1f1>] warn_slowpath_fmt+0x41/0x50 [ 0.998593] [<ffffffff8115277c>] internal_create_group+0x18c/0x1f0 [ 1.001366] [<ffffffff8115280e>] sysfs_create_group+0xe/0x10 [ 1.003898] [<ffffffff81376cf6>] device_add_groups+0x46/0x80 [ 1.006955] [<ffffffff81377d8d>] device_add+0x46d/0x6a0 [ 1.009565] [<ffffffff813778e1>] ? device_private_init+0x51/0x90 [ 1.012806] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.015866] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 1.018234] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.021408] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 1.025517] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 1.029102] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 1.031844] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 1.034571] [<ffffffff815f3794>] kernel_thread_helper+0x4/0x10 [ 1.037734] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373 [ 1.040790] [<ffffffff815f3790>] ? gs_change+0xb/0xb [ 1.043354] ---[ end trace 319c95c486d7d9cd ]--- [ 1.045536] ------------[ cut here ]------------ [ 1.047640] WARNING: at /data/kernel/linux-2.6-git/kernel/events/core.c:7144 perf_event_sysfs_init+0x70/0x9a() [ 1.052595] Hardware name: ProLiant DL360 G4 [ 1.055027] Failed to register pmu: cpu, reason -22 [ 1.057720] Modules linked in: [ 1.059284] Pid: 1, comm: swapper/0 Tainted: G W 3.4.0-rc1-x86_64 #6 [ 1.062785] Call Trace: [ 1.064094] [<ffffffff8104d11a>] warn_slowpath_common+0x7a/0xb0 [ 1.067192] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.070305] [<ffffffff8104d1f1>] warn_slowpath_fmt+0x41/0x50 [ 1.073129] [<ffffffff810a7244>] ? pmu_dev_alloc+0xb4/0xe0 [ 1.075771] [<ffffffff81a989e5>] perf_event_sysfs_init+0x70/0x9a [ 1.078878] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 1.081879] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 1.084714] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 1.087754] [<ffffffff815f3794>] kernel_thread_helper+0x4/0x10 [ 1.090639] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373 [ 1.093372] [<ffffffff815f3790>] ? gs_change+0xb/0xb [ 1.096312] ---[ end trace 319c95c486d7d9ce ]---
fs/sysfs/group.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
fs/sysfs/group.c +5 -1
@@ -67,7 +67,11 @@ static int internal_create_group(struct kobject *kobj, int update,/* Updates may happen before the object has been instantiated */ if (unlikely (update && !kobj->sd))return -EINVAL ; - +if (!grp->attrs) { +WARN (1 ,"sysfs: attrs not set by subsystem for group: %s/%s\n" , + kobj->name, grp->name ?"" : grp->name); +return -EINVAL ; + }if (grp->name) { error =sysfs_create_subdir (kobj, grp->name, &sd);if (error)
Re: [PATCH v2] Prevent crash on unset sysfs group attributes
Quoted 108 lines · Bruno Prémont
Do not let the kernel crash when a device is registered with sysfs while group attributes are not set (aka NULL).
Warn about the offender with some information about the offending device.
This would warn instead of trying NULL pointer deref like:
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 PGD 0 Oops: 0000 [#1] SMP CPU 0 Modules linked in:Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 RIP: 0010:[<ffffffff81152673>] [<
ffffffff81152673>]internal_create_group+0x83/0x1a0 RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) Stack: ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be Call Trace: [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [<ffffffff81377d3d>] device_add+0x46d/0x6a0 ...Signed-off-by Bruno Prémont <[email protected]>---
Quoted 22 lines · On Tue, 3 Apr 2012 09:15:43 Ingo Molnar wrote:
Quoted 5 lines
Quoted 2 lines
Greg, is this ok for you or should the check be moved out to calling
internal_create_group()?Please put changes in
internal_create_groupwhere all of the rest of the checks are.So you *do* agree that a check in a generic place is useful after all? ;-)
Quoted 7 lines
We should do something like:
if (!grp->attrs) { WARN(1, "sysfs: idiot subsystem did not include attrs for group: %s/%s\n" kobj->name, grp->name?"":grp->name); return -EINVAL; }Quoted 5 lines
As it stands your patch is horrible it leaves sysfs in an inconsistent state. Creating the directory and leaving it there. Not returning an error code. It looks like there are all kinds of weird problems that removing the group or updating the group could get into if we go with your patch.
Quoted 3 lines
This is actually a sensible suggestion. Bruno, mind updating your patch to do something like this? Assuming Greg agrees with putting the check/warning there.
Here come a respin with Eric's suggestion.
In my case it would show the following result:
[ 0.975025] ------------[ cut here ]------------ [ 0.977507] WARNING: at /data/kernel/linux-2.6-git/fs/sysfs/group.c:72 internal_create_group+0x18c/0x1f0() [ 0.981932] Hardware name: ProLiant DL360 G4 [ 0.983916] sysfs: attrs not set by subsystem for group: cpu/ [ 0.987030] Modules linked in: [ 0.988664] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #6 [ 0.991639] Call Trace: [ 0.992911] [<ffffffff8104d11a>] warn_slowpath_common+0x7a/0xb0 [ 0.995903] [<ffffffff8104d1f1>] warn_slowpath_fmt+0x41/0x50 [ 0.998593] [<ffffffff8115277c>] internal_create_group+0x18c/0x1f0 [ 1.001366] [<ffffffff8115280e>] sysfs_create_group+0xe/0x10 [ 1.003898] [<ffffffff81376cf6>] device_add_groups+0x46/0x80 [ 1.006955] [<ffffffff81377d8d>] device_add+0x46d/0x6a0 [ 1.009565] [<ffffffff813778e1>] ? device_private_init+0x51/0x90 [ 1.012806] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.015866] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 1.018234] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.021408] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 1.025517] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 1.029102] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 1.031844] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 1.034571] [<ffffffff815f3794>] kernel_thread_helper+0x4/0x10 [ 1.037734] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373 [ 1.040790] [<ffffffff815f3790>] ? gs_change+0xb/0xb [ 1.043354] ---[ end trace 319c95c486d7d9cd ]--- [ 1.045536] ------------[ cut here ]------------ [ 1.047640] WARNING: at /data/kernel/linux-2.6-git/kernel/events/core.c:7144 perf_event_sysfs_init+0x70/0x9a() [ 1.052595] Hardware name: ProLiant DL360 G4 [ 1.055027] Failed to register pmu: cpu, reason -22 [ 1.057720] Modules linked in: [ 1.059284] Pid: 1, comm: swapper/0 Tainted: G W 3.4.0-rc1-x86_64 #6 [ 1.062785] Call Trace: [ 1.064094] [<ffffffff8104d11a>] warn_slowpath_common+0x7a/0xb0 [ 1.067192] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.070305] [<ffffffff8104d1f1>] warn_slowpath_fmt+0x41/0x50 [ 1.073129] [<ffffffff810a7244>] ? pmu_dev_alloc+0xb4/0xe0
Quoted 8 lines
[ 1.075771] [<ffffffff81a989e5>] perf_event_sysfs_init+0x70/0x9a [ 1.078878] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 1.081879] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 1.084714] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 1.087754] [<ffffffff815f3794>] kernel_thread_helper+0x4/0x10 [ 1.090639] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373 [ 1.093372] [<ffffffff815f3790>] ? gs_change+0xb/0xb [ 1.096312] ---[ end trace 319c95c486d7d9ce ]---
That looks reasonable to me.
Quoted 20 lines
fs/sysfs/group.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)fs/sysfs/group.c +5
-1@@ -67,7 +67,11 @@ static int internal_create_group(struct kobject *kobj, int update,/* Updates may happen before the object has been instantiated */ if (unlikely (update && !kobj->sd))return -EINVAL ; - +if (!grp->attrs) { +WARN (1 ,"sysfs: attrs not set by subsystem for group: %s/%s\n" , + kobj->name, grp->name ?"" : grp->name); +return -EINVAL ; + }if (grp->name) { error =sysfs_create_subdir (kobj, grp->name, &sd);if (error)
Re: [PATCH v2] Prevent crash on unset sysfs group attributes
In reply to Bruno PrémontQuoted 127 lines · Bruno Prémont
Do not let the kernel crash when a device is registered with sysfs while group attributes are not set (aka NULL).
Warn about the offender with some information about the offending device.
This would warn instead of trying NULL pointer deref like:
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 PGD 0 Oops: 0000 [#1] SMP CPU 0 Modules linked in:Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4 RIP: 0010:[<ffffffff81152673>] [<
ffffffff81152673>]internal_create_group+0x83/0x1a0 RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) Stack: ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be Call Trace: [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [<ffffffff81377d3d>] device_add+0x46d/0x6a0 ...Signed-off-by Bruno Prémont <[email protected]>---
Quoted 22 lines · On Tue, 3 Apr 2012 09:15:43 Ingo Molnar wrote:
Quoted 5 lines
Quoted 2 lines
Greg, is this ok for you or should the check be moved out to calling
internal_create_group()?Please put changes in
internal_create_groupwhere all of the rest of the checks are.So you *do* agree that a check in a generic place is useful after all? ;-)
Quoted 7 lines
We should do something like:
if (!grp->attrs) { WARN(1, "sysfs: idiot subsystem did not include attrs for group: %s/%s\n" kobj->name, grp->name?"":grp->name); return -EINVAL; }Quoted 5 lines
As it stands your patch is horrible it leaves sysfs in an inconsistent state. Creating the directory and leaving it there. Not returning an error code. It looks like there are all kinds of weird problems that removing the group or updating the group could get into if we go with your patch.
Quoted 3 lines
This is actually a sensible suggestion. Bruno, mind updating your patch to do something like this? Assuming Greg agrees with putting the check/warning there.
Here come a respin with Eric's suggestion.
In my case it would show the following result:
[ 0.975025] ------------[ cut here ]------------ [ 0.977507] WARNING: at /data/kernel/linux-2.6-git/fs/sysfs/group.c:72 internal_create_group+0x18c/0x1f0() [ 0.981932] Hardware name: ProLiant DL360 G4 [ 0.983916] sysfs: attrs not set by subsystem for group: cpu/ [ 0.987030] Modules linked in: [ 0.988664] Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #6 [ 0.991639] Call Trace: [ 0.992911] [<ffffffff8104d11a>] warn_slowpath_common+0x7a/0xb0 [ 0.995903] [<ffffffff8104d1f1>] warn_slowpath_fmt+0x41/0x50 [ 0.998593] [<ffffffff8115277c>] internal_create_group+0x18c/0x1f0 [ 1.001366] [<ffffffff8115280e>] sysfs_create_group+0xe/0x10 [ 1.003898] [<ffffffff81376cf6>] device_add_groups+0x46/0x80 [ 1.006955] [<ffffffff81377d8d>] device_add+0x46d/0x6a0 [ 1.009565] [<ffffffff813778e1>] ? device_private_init+0x51/0x90 [ 1.012806] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.015866] [<ffffffff810a7228>] pmu_dev_alloc+0x98/0xe0 [ 1.018234] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.021408] [<ffffffff81a989c0>] perf_event_sysfs_init+0x4b/0x9a [ 1.025517] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 1.029102] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 1.031844] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 1.034571] [<ffffffff815f3794>] kernel_thread_helper+0x4/0x10 [ 1.037734] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373 [ 1.040790] [<ffffffff815f3790>] ? gs_change+0xb/0xb [ 1.043354] ---[ end trace 319c95c486d7d9cd ]--- [ 1.045536] ------------[ cut here ]------------ [ 1.047640] WARNING: at /data/kernel/linux-2.6-git/kernel/events/core.c:7144 perf_event_sysfs_init+0x70/0x9a() [ 1.052595] Hardware name: ProLiant DL360 G4 [ 1.055027] Failed to register pmu: cpu, reason -22 [ 1.057720] Modules linked in: [ 1.059284] Pid: 1, comm: swapper/0 Tainted: G W 3.4.0-rc1-x86_64 #6 [ 1.062785] Call Trace: [ 1.064094] [<ffffffff8104d11a>] warn_slowpath_common+0x7a/0xb0 [ 1.067192] [<ffffffff81a98975>] ? utsname_sysctl_init+0x14/0x14 [ 1.070305] [<ffffffff8104d1f1>] warn_slowpath_fmt+0x41/0x50 [ 1.073129] [<ffffffff810a7244>] ? pmu_dev_alloc+0xb4/0xe0 [ 1.075771] [<ffffffff81a989e5>] perf_event_sysfs_init+0x70/0x9a [ 1.078878] [<ffffffff810002ad>] do_one_initcall+0x3d/0x170 [ 1.081879] [<ffffffff81a85cbd>] kernel_init+0x12d/0x1be [ 1.084714] [<ffffffff81a85505>] ? rdinit_setup+0x28/0x28 [ 1.087754] [<ffffffff815f3794>] kernel_thread_helper+0x4/0x10 [ 1.090639] [<ffffffff81a85b90>] ? start_kernel+0x373/0x373 [ 1.093372] [<ffffffff815f3790>] ? gs_change+0xb/0xb [ 1.096312] ---[ end trace 319c95c486d7d9ce ]---fs/sysfs/group.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)fs/sysfs/group.c +0
-0
fs/sysfs/group.c static int internal_create_group(struct kobject *kobj, int update, · line 74
Quoted 9 lines
fs/sysfs/group.c +5
-1@@ -67,7 +67,11 @@ static int internal_create_group(struct kobject *kobj, int update,/* Updates may happen before the object has been instantiated */ if (unlikely (update && !kobj->sd))return -EINVAL ; - +if (!grp->attrs) { +WARN (1 ,"sysfs: attrs not set by subsystem for group: %s/%s\n" , + kobj->name, grp->name ?"" : grp->name); +return -EINVAL ; + }
Thanks,
Ingo
PATCH 1/1 sysfs: Prevent crash on unset sysfs group attributes
In reply to Bruno PrémontDo not let the kernel crash when a device is registered with sysfs while group attributes are not set (aka NULL).
Warn about the offender with some information about the offending device.
This would warn instead of trying NULL pointer deref like:
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 PGD 0 Oops: 0000 [#1] SMP CPU 0 Modules linked in:
Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4
RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) Stack: ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be Call Trace: [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [<ffffffff81377d3d>] device_add+0x46d/0x6a0 ...
---
Resending with fixed commit description message formatting! Stupid MUA thinks it knows how to wrap lines and that it must reformat whole mail on paste...
fs/sysfs/group.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
fs/sysfs/group.c +5 -1
@@ -67,7 +67,11 @@ static int internal_create_group(struct kobject *kobj, int update,/* Updates may happen before the object has been instantiated */ if (unlikely (update && !kobj->sd))return -EINVAL ; - +if (!grp->attrs) { +WARN (1 ,"sysfs: attrs not set by subsystem for group: %s/%s\n" , + kobj->name, grp->name ?"" : grp->name); +return -EINVAL ; + }if (grp->name) { error =sysfs_create_subdir (kobj, grp->name, &sd);if (error)
Re: [PATCH v2a] sysfs: Prevent crash on unset sysfs group attributes
Quoted 38 lines · Bruno Prémont
Do not let the kernel crash when a device is registered with sysfs while group attributes are not set (aka NULL).
Warn about the offender with some information about the offending device.
This would warn instead of trying NULL pointer deref like:
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff81152673>] internal_create_group+0x83/0x1a0 PGD 0 Oops: 0000 [#1] SMP CPU 0 Modules linked in:Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc1-x86_64 #3 HP ProLiant DL360 G4
RIP: 0010:[<ffffffff81152673>] [<ffffffff81152673>] internal_create_group+0x83/0x1a0 RSP: 0018:ffff88019485fd70 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001 RDX: ffff880192e99908 RSI: ffff880192e99630 RDI: ffffffff81a26c60 RBP: ffff88019485fdc0 R08: 0000000000000000 R09: 0000000000000000 R10: ffff880192e99908 R11: 0000000000000000 R12: ffffffff81a16a00 R13: ffff880192e99908 R14: ffffffff81a16900 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88019bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 0000000000000000 CR3: 0000000001a0c000 CR4: 00000000000007f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process swapper/0 (pid: 1, threadinfo ffff88019485e000, task ffff880194878000) Stack: ffff88019485fdd0 ffff880192da9d60 0000000000000000 ffff880192e99908 ffff880192e995d8 0000000000000001 ffffffff81a16a00 ffff880192da9d60 0000000000000000 0000000000000000 ffff88019485fdd0 ffffffff811527be Call Trace: [<ffffffff811527be>] sysfs_create_group+0xe/0x10 [<ffffffff81376ca6>] device_add_groups+0x46/0x80 [<ffffffff81377d3d>] device_add+0x46d/0x6a0 ...
Quoted 1 line
Signed-off-by Bruno Prémont <[email protected]>
Thanks,
Ingo
Re: [PATCH] Prevent crash on missing sysfs attribute group
In reply to Ingo MolnarQuoted 20 lines · Ingo Molnar
Quoted 10 lines · Eric W. Biederman
Nacked-by "Eric W. Biederman" <[email protected]>Quoted 3 lines · Bruno Prémont
Prevent kernel from crashing when a device is being registered with sysfs but has no (aka NULL) group attributes, but warn about it so calling path can get fixed.
The idea is reasonable but the implementation is horrible.
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Will do - but the underlying generic bug should be fixed as
well: we must not crash just because some attributes are missing in a rarely used sub-driver ...We should
WARN_ON(), etc. - but not crash.FIX perf to include sanity checks.
Quoted 8 lines
Huh, so put repeated, duplicated, inconsistently applied sanity checks into dozens of sysfs attribute using kernel subsystems?
Major FAIL, dude.
Eric's rant about putting sanit checks at every usage site is just crazy talk.
No. I was not talking about every usage site. I was talking about the sites that are don't have a direct call chain to the sysfs methods and instead do something clever that makes backtraces worthless.
In the normal case sysfs registration problems are simple to trace back to their source because the backtrace points a finger at the piece of code that when registering had a problem.
Unfortunately perf is built differently. perf seems to be built to hide who the idiot was who registered the wrong piece of code and despite having a perfectly good backtrace and knowing it was perf the person reporting the original bug still was going to need to do a bisect to find the real culprit of the problem.
So I am asking that since perf is built in a way that actively makes debugging these kinds of problems hard that you please add additional debugging code to perf_pmu_register or some other better location so that simply registering something buggy with perf will show the bug.
Either that or please fix perf events so that a backtrace is worth something.
Thanks,
Eric
Re: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 6 lines · Eric W. Biederman
Quoted 2 lines
Huh, so put repeated, duplicated, inconsistently applied sanity checks into dozens of sysfs attribute using kernel subsystems?
[...]
No. I was not talking about every usage site.
Note, I'm not arguing that this isn't a bug in the P4 PMU driver
- it is clearly a bug and I've applied the fix for it. I'm arguing about the escallation vector that this bug takes - that is unnecessarily disruptive:
You were talking about:
Quoted 1 line
Quoted 1 line
Quoted 1 line
FIX perf to include sanity checks.
and what the PMU drivers do here is not uncommon at all, and the bug (for which I applied the fix and will push to Linus ASAP) is not uncommon either:
Bugs happen and indirections happen too. perf uses a generic PMU driver layer where the lower level layers register themselves. There's at least a dozen similar constructs in the kernel and you suggest that the right solution is to put checks in every one of them, while the nice patch from Bruno could catch it too, in one central place?
If the PMU code used those attributes directly and could crash/misbehave then you'd have a point. But the first thing that makes real use of these objects is sysfs - so it's trivially useful to at minimum have a sanity check there...
Quoted 8 lines
[...] I was talking about the sites that are don't have a direct call chain to the sysfs methods and instead do something clever that makes backtraces worthless.
In the normal case sysfs registration problems are simple to trace back to their source because the backtrace points a finger at the piece of code that when registering had a problem.
You mean the crash backtrace?
I don't think we should spuriously crash the kernel on NULL pointer input to generic facilities, especially when a check is so simple and would catch so many similar patterns of bugs.
That lack of a check escallated a simple missing (and unimportant) attribute into a "box won't boot at all" bug. *That* is not acceptable behavior and robustness from a generic facility, in my book.
In that sense the crash behaves like a BUG_ON().
Thanks,
Ingo
Re: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 22 lines · Ingo Molnar
Quoted 6 lines · Eric W. Biederman
Quoted 2 lines
Huh, so put repeated, duplicated, inconsistently applied sanity checks into dozens of sysfs attribute using kernel subsystems?
[...]
No. I was not talking about every usage site.
Note, I'm not arguing that this isn't a bug in the P4 PMU driver
- it is clearly a bug and I've applied the fix for it. I'm arguing about the escallation vector that this bug takes - that is unnecessarily disruptive:You were talking about:
Quoted 1 line
Quoted 1 line
Quoted 1 line
FIX perf to include sanity checks.
and what the PMU drivers do here is not uncommon at all, and the bug (for which I applied the fix and will push to Linus ASAP) is not uncommon either:
Quoted 6 lines
Bugs happen and indirections happen too. perf uses a generic PMU driver layer where the lower level layers register themselves. There's at least a dozen similar constructs in the kernel and you suggest that the right solution is to put checks in every one of them, while the nice patch from Bruno could catch it too, in one central place?
What is uncommon is that perf_pmu_register is called from an early initcall, and then later a device_init call is used to register the pmu subsystem with sysfs.
That extra delay step is weird. That registering extra early is weird.
How we get from x86_pmu to the variable simply named pmu that is registered I am still in the dark about. There is a lot of weird magic going on in that registration path before these things get to sysfs.
And those extra steps are what make Bruno's patch largely useless for this case.
Quoted 4 lines
If the PMU code used those attributes directly and could crash/misbehave then you'd have a point. But the first thing that makes real use of these objects is sysfs - so it's trivially useful to at minimum have a sanity check there...
If the pmu subsystem is doing odd and peculiar things it should strive to not impose debugging burden on others.
Quoted 10 lines
Quoted 8 lines
[...] I was talking about the sites that are don't have a direct call chain to the sysfs methods and instead do something clever that makes backtraces worthless.
In the normal case sysfs registration problems are simple to trace back to their source because the backtrace points a finger at the piece of code that when registering had a problem.
You mean the crash backtrace?
I mean a backtrace when people try and abuse sysfs by accident. Typically they are backtraces from WARN_ON that I look at. It is common enough and I look a reasonable number of them. Usually they point back to the subsystem and the borked piece of code. In this case the backtrace barely hit the broad side of the barn.
It really irritates me that a stack backtrace is useless for figuring out that this was something in under arch/x86 let alone for figuring out that this was p4 related.
So since the perf pmu event subsystem is extremely atypical I am asking that it be looked at to see if it's structure or sanity checks can be improved so it is more debuggable when people make stupid mistakes.
Eric
Re: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 31 lines · Eric W. Biederman
Quoted 22 lines · Ingo Molnar
Quoted 6 lines · Eric W. Biederman
Quoted 2 lines
Huh, so put repeated, duplicated, inconsistently applied sanity checks into dozens of sysfs attribute using kernel subsystems?
[...]
No. I was not talking about every usage site.
Note, I'm not arguing that this isn't a bug in the P4 PMU driver
- it is clearly a bug and I've applied the fix for it. I'm arguing about the escallation vector that this bug takes - that is unnecessarily disruptive:You were talking about:
Quoted 1 line
Quoted 1 line
Quoted 1 line
FIX perf to include sanity checks.
and what the PMU drivers do here is not uncommon at all, and the bug (for which I applied the fix and will push to Linus ASAP) is not uncommon either:
Quoted 6 lines
Bugs happen and indirections happen too. perf uses a generic PMU driver layer where the lower level layers register themselves. There's at least a dozen similar constructs in the kernel and you suggest that the right solution is to put checks in every one of them, while the nice patch from Bruno could catch it too, in one central place?
Quoted 3 lines
What is uncommon is that
perf_pmu_registeris called from an early initcall, and then later adevice_initcall is used to register the pmu subsystem with sysfs.
This has no relevance to the bug and crash pattern itself whatsoever, so stop blathering about unrelated things.
Not filling out a sysfs object attribute is an *easy* driver level mistake, I've seen it happen on numerous occasions. Not crashing on it in the sysfs layer is an *obvious* debugging helper, and I don't understand why you are even arguing about this.
Thanks,
Ingo
Re: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 33 lines · Ingo Molnar
Quoted 31 lines · Eric W. Biederman
Quoted 28 lines · Ingo Molnar
Quoted 6 lines · Eric W. Biederman
Quoted 2 lines
Huh, so put repeated, duplicated, inconsistently applied sanity checks into dozens of sysfs attribute using kernel subsystems?
[...]
No. I was not talking about every usage site.
Note, I'm not arguing that this isn't a bug in the P4 PMU driver
- it is clearly a bug and I've applied the fix for it. I'm arguing about the escallation vector that this bug takes - that is unnecessarily disruptive:You were talking about:
Quoted 1 line
Quoted 1 line
Quoted 1 line
FIX perf to include sanity checks.
and what the PMU drivers do here is not uncommon at all, and the bug (for which I applied the fix and will push to Linus ASAP) is not uncommon either:
Bugs happen and indirections happen too. perf uses a generic PMU driver layer where the lower level layers register themselves. There's at least a dozen similar constructs in the kernel and you suggest that the right solution is to put checks in every one of them, while the nice patch from Bruno could catch it too, in one central place?
Quoted 6 lines
Quoted 3 lines
What is uncommon is that
perf_pmu_registeris called from an early initcall, and then later adevice_initcall is used to register the pmu subsystem with sysfs.This has no relevance to the bug and crash pattern itself whatsoever, so stop blathering about unrelated things.
Crashing or BUG_ON or WARN_ON has no relevance to how hard it is to debug this. They only have relevance on how hard it is to get the information from a machine that experience this problem.
The call to perf_pmu_register was not in the stack backtrace, because the call to perf_pmu_register happened long ago and we put off registering with sysfs until later.
By the time we got to sysfs there was no information available that would let us know which client of the perf events subsystem it possibly could be. Not enough information when we register with sysfs to blame it on something makes it hard to debug.
Quoted 5 lines
Not filling out a sysfs object attribute is an *easy* driver level mistake, I've seen it happen on numerous occasions. Not crashing on it in the sysfs layer is an *obvious* debugging helper, and I don't understand why you are even arguing about this.
I agree that not filling out some field of something that is expected is an easy driver bug to make. As such I would actually like something to go on the next time someone makes that mistake.
Because the perf pmu subsystem is atypical and has asynchronous registration with respect to sysfs. These kinds of problems are harder to find then they need to be.
The only tools to track this down that were realistically available were git bisect and asking on the list of developers if this bug looked familiar. There was really not enough information at the point of the crash to find which attribute was not properly initialized without being intimately familiar with the perf pmu subsystem.
Having to resort to a git bisect when a few checks extra checks could have caught the culprit red handed and we could have had a the function name where the that started the registration of the sysfs attribute to start debugging with.
Eric
Re: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 5 lines · Eric W. Biederman
Quoted 2 lines
This has no relevance to the bug and crash pattern itself whatsoever, so stop blathering about unrelated things.
Crashing or
BUG_ONorWARN_ONhas no relevance to how hard it is to debug this. [...]
Erm, so you think the difference between a nice WARN_ON() and a machine that *DOES NOT BOOT* is irrelevant?
In which universe? Smoking what kind of drugs?
Seriously, you need a reality check. We settled the BUG_ON() versus WARN_ON() debate about a decade ago, in favor of WARN_ON().
Thanks,
Ingo
Peter Zijlstra
maintainerRe: [PATCH] Prevent crash on missing sysfs attribute group
In reply to Eric W. BiedermanQuoted 7 lines · Eric W. Biederman
So I am asking that since perf is built in a way that actively makes debugging these kinds of problems hard that you please add additional debugging code to
perf_pmu_registeror some other better location so that simply registering something buggy with perf will show the bug.
Is there a convenient helper function that we can use that validates the attribute_group structure? We could use such a function to do the validation at a point where we still know where it came from.
Re: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 11 lines · Peter Zijlstra
Quoted 7 lines · Eric W. Biederman
So I am asking that since perf is built in a way that actively makes debugging these kinds of problems hard that you please add additional debugging code to
perf_pmu_registeror some other better location so that simply registering something buggy with perf will show the bug.Is there a convenient helper function that we can use that validates the
attribute_groupstructure? We could use such a function to do the validation at a point where we still know where it came from.
There isn't but I was just thinking before you sent this that we could really use one.
Eric
Greg KH
maintainerRe: [PATCH] Prevent crash on missing sysfs attribute group
Quoted 10 lines · Eric W. Biederman
Quoted 8 lines · Peter Zijlstra
Quoted 7 lines · Eric W. Biederman
So I am asking that since perf is built in a way that actively makes debugging these kinds of problems hard that you please add additional debugging code to
perf_pmu_registeror some other better location so that simply registering something buggy with perf will show the bug.
Quoted 6 lines
Quoted 3 lines
Is there a convenient helper function that we can use that validates the
attribute_groupstructure? We could use such a function to do the validation at a point where we still know where it came from.There isn't but I was just thinking before you sent this that we could really use one.
Let me look into this some more, the driver core really should be protecting you from doing something like this here, sysfs shouldn't be getting involved (not to say that the patch is incorrect, it isn't, I'll queue it up, but that something more looks to be needed to keep from hitting that problem in the first place.)
thanks,
greg k-h