Skip to contentSkip to conversation

2.6.10: PREEMPT SMP

Oops Xavier Bestel 2 participants 2 messages Jan 31, 2005 – Feb 4, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I just got this Oops with 2.6.10 (debian/sid stock kernel).

Kernel is tainted by VMWare, but it wasn't used (machine powered on remotely and used just to run gaim though ssh). I can perhaps try to reproduce it without it though if you need.

Xav

Jan 31 14:08:01 bip kernel: c01c1447
Jan 31 14:08:01 bip kernel: PREEMPT SMP
Jan 31 14:08:01 bip kernel: Modules linked in: vmnet vmmon ipv6 lp thermal fan button processor ac battery nfs lockd sunrpc eth1394 af_packet eepro100 e100 ohci1394 ieee1394 snd_ens1371 snd_rawmidi snd_seq_device snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd soundcore snd_page_alloc gameport uhci_hcd usbcore pci_hotplug
via_agp agpgart parport_pc parport floppy pcspkr rtc ext2 reiserfs tsdev mousedev evdev capability commoncap ide_cd cdrom psmouse via686a eeprom i2c_sensor i2c_isa i2c_viapro i2c_core 8139too mii ext3 jbd mbcache ide_generic via82cxxx trm290 triflex slc90e66 sis5513 siimage serverworks sc1200 rz1000 piix pdc202xx_old opti621 ns87415 hpt366 ide_disk hpt34x generic cy82c693 cs5530 cs5520 cmd64x atiixp amd74xx alim15x3 aec62xx pdc202xx_new ide_core unix fbcon font bitblit vesafb cfbcopyarea cfbimgblt cfbfillrect
Jan 31 14:08:01 bip kernel: CPU:    1
Jan 31 14:08:01 bip kernel: EIP:    0060:[__rb_rotate_left+7/64]    Tainted: P      VLI
Jan 31 14:08:01 bip kernel: EFLAGS: 00010286   (2.6.10-1-686-smp)
Jan 31 14:08:01 bip kernel: EIP is at __rb_rotate_left+0x7/0x40
Jan 31 14:08:01 bip kernel: eax: f1b8da60   ebx: da7f38e0   ecx: f58864a0   edx: 00000000
Jan 31 14:08:01 bip kernel: esi: f58864a0   edi: f1b8da60   ebp: c03b17a4   esp: eaa93ea0
Jan 31 14:08:01 bip kernel: ds: 007b   es: 007b   ss: 0068
Jan 31 14:08:01 bip kernel: Process cron (pid: 8568, threadinfo=eaa92000 task=f5b65a20)
Jan 31 14:08:01 bip kernel: Stack: c01c154f f58864a0 c03b17a4 da7f38e0 f1b8da6c f1b8da60 da7f38e0 c01a6d07
Jan 31 14:08:01 bip kernel:        da7f38e0 c03b17a4 eaa93f40 00000008 eaa93f4b ffffffea c01a6dfc 00000008
Jan 31 14:08:01 bip kernel:        ffffffff 00000000 0000000b 00000013 00000000 eaa93f40 ffffffff f60d20e0
Jan 31 14:08:01 bip kernel: Call Trace:
Jan 31 14:08:01 bip kernel:  [rb_insert_color+143/240] rb_insert_color+0x8f/0xf0
Jan 31 14:08:01 bip kernel:  [key_user_lookup+215/272] key_user_lookup+0xd7/0x110
Jan 31 14:08:01 bip kernel:  [key_alloc+92/800] key_alloc+0x5c/0x320
Jan 31 14:08:01 bip kernel:  [keyring_alloc+64/144] keyring_alloc+0x40/0x90
Jan 31 14:08:01 bip kernel:  [alloc_uid_keyring+74/192] alloc_uid_keyring+0x4a/0xc0
Jan 31 14:08:01 bip kernel:  [alloc_uid+199/384] alloc_uid+0xc7/0x180
Jan 31 14:08:01 bip kernel:  [set_user+19/144] set_user+0x13/0x90
Jan 31 14:08:01 bip kernel:  [sys_setuid+179/336] sys_setuid+0xb3/0x150
Jan 31 14:08:01 bip kernel:  [sysenter_past_esp+82/117] sysenter_past_esp+0x52/0x75
#1 lore raw
Quoted 5 lines · Xavier Bestel

I just got this Oops with 2.6.10 (debian/sid stock kernel).

Kernel is tainted by VMWare, but it wasn't used (machine powered on remotely and used just to run gaim though ssh). I can perhaps try to reproduce it without it though if you need.

Hmmm... I see it involves the key stuff I wrote.

I don't think it can be a problem with preemption interfering with the key management code accessing the key tree; every access to the tree outside of the bootup initialisation is made with the appropriate spinlock held - and that disables preemption.

It seems unlikely to be a double free... keys aren't freed the moment their usage count reaches zero; a separate daemon is enlisted to go through the tree when there's something to dispose of and extract and free all unused keys.

However, it's not impossible that there's a race there that I can't see (though it doesn't look likely). Are you willing to try patching your kernel with something? If so, if you can look through security/keys/key.c, and every time you see a line saying:

	kmem_cache_free(key_jar, key);

insert this line before it:

	memset(key, 0xbb, sizeof(*key);

This will corrupt the memory that held the dead key before freeing it. Then if something is touching a dead key, the pattern 0xbbbbbbbb or similar will crop up in a register or on the stack, and the kernel will very likely crash.

David