Borislav Petkov
b49777c656
EDAC, mc_sysfs: Fix freeing bus' name
commit 12e26969b32c79018165d52caff3762135614aa1 upstream.
I get the splat below when modprobing/rmmoding EDAC drivers. It happens
because bus->name is invalid after bus_unregister() has run. The Code: section
below corresponds to:
.loc 1 1108 0
movq 672(%rbx), %rax # mci_1(D)->bus, mci_1(D)->bus
.loc 1 1109 0
popq %rbx #
.loc 1 1108 0
movq (%rax), %rdi # _7->name,
jmp kfree #
and %rax has some funky stuff 2030203020312030 which looks a lot like
something walked over it.
Fix that by saving the name ptr before doing stuff to string it points to.
general protection fault: 0000 [#1] SMP
Modules linked in: ...
CPU: 4 PID: 10318 Comm: modprobe Tainted: G I EN 3.12.51-11-default+ #48
Hardware name: HP ProLiant DL380 G7, BIOS P67 05/05/2011
task: ffff880311320280 ti: ffff88030da3e000 task.ti: ffff88030da3e000
RIP: 0010:[<ffffffffa019da92>] [<ffffffffa019da92>] edac_unregister_sysfs+0x22/0x30 [edac_core]
RSP: 0018:ffff88030da3fe28 EFLAGS: 00010292
RAX: 2030203020312030 RBX: ffff880311b4e000 RCX: 000000000000095c
RDX: 0000000000000001 RSI: ffff880327bb9600 RDI: 0000000000000286
RBP: ffff880311b4e750 R08: 0000000000000000 R09: ffffffff81296110
R10: 0000000000000400 R11: 0000000000000000 R12: ffff88030ba1ac68
R13: 0000000000000001 R14: 00000000011b02f0 R15: 0000000000000000
FS: 00007fc9bf8f5700(0000) GS:ffff8801a7c40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000403c90 CR3: 000000019ebdf000 CR4: 00000000000007e0
Stack:
Call Trace:
i7core_unregister_mci.isra.9
i7core_remove
pci_device_remove
__device_release_driver
driver_detach
bus_remove_driver
pci_unregister_driver
i7core_exit
SyS_delete_module
system_call_fastpath
0x7fc9bf426536
Code: 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 53 48 89 fb e8 52 2a 1f e1 48 8b bb a0 02 00 00 e8 46 59 1f e1 48 8b 83 a0 02 00 00 5b <48> 8b 38 e9 26 9a fe e0 66 0f 1f 44 00 00 66 66 66 66 90 48 8b
RIP [<ffffffffa019da92>] edac_unregister_sysfs+0x22/0x30 [edac_core]
RSP <ffff88030da3fe28>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Fixes: 7a623c0390 ("edac: rewrite the sysfs code to use struct device")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03 15:07:17 -08:00
..
2016-01-08 01:01:41 +01:00
2016-03-03 15:07:10 -08:00
2016-02-17 12:31:03 -08:00
2016-02-17 12:30:55 -08:00
2016-02-17 12:31:06 -08:00
2016-03-03 15:07:16 -08:00
2015-12-22 11:42:30 -08:00
2015-12-09 13:13:06 -06:00
2015-12-12 16:43:44 -08:00
2016-03-03 15:07:15 -08:00
2016-01-04 21:46:45 -05:00
2015-12-24 02:11:37 +01:00
2016-02-17 12:31:05 -08:00
2016-01-07 11:09:36 +05:30
2016-03-03 15:07:17 -08:00
2015-11-11 10:21:34 -08:00
2016-03-03 15:07:09 -08:00
2015-11-24 15:25:46 -08:00
2015-12-17 15:48:29 +01:00
2016-03-03 15:07:10 -08:00
2016-02-17 12:31:06 -08:00
2016-03-03 15:07:16 -08:00
2015-12-18 08:19:52 -08:00
2016-02-25 12:01:23 -08:00
2016-03-03 15:07:14 -08:00
2015-12-19 12:00:37 +01:00
2015-11-06 17:50:42 -08:00
2016-02-25 12:01:17 -08:00
2016-03-03 15:07:10 -08:00
2016-02-25 12:01:21 -08:00
2016-02-25 12:01:22 -08:00
2016-03-03 15:07:14 -08:00
2015-12-15 13:24:21 -05:00
2015-11-05 13:15:12 -08:00
2015-12-29 08:28:32 -07:00
2015-11-04 14:03:04 +05:30
2016-03-03 15:07:14 -08:00
2016-03-03 15:07:14 -08:00
2015-12-16 00:16:58 +01:00
2015-11-12 07:06:18 -05:00
2015-11-06 14:22:15 -08:00
2016-03-03 15:07:13 -08:00
2016-03-03 15:07:16 -08:00
2016-02-17 12:30:56 -08:00
2016-03-03 15:07:13 -08:00
2015-11-10 18:11:41 -08:00
2015-11-08 16:24:43 -05:00
2016-02-25 12:01:21 -08:00
2015-12-22 10:12:04 -07:00
2015-12-09 09:08:36 -06:00
2015-12-12 16:07:25 +01:00
2016-02-17 12:30:56 -08:00
2015-11-04 14:47:13 -08:00
2016-02-25 12:01:14 -08:00
2015-12-14 11:31:20 +01:00
2016-02-25 12:01:23 -08:00
2015-11-06 10:23:50 -08:00
2015-12-12 02:31:11 +01:00
2015-11-11 09:16:10 -08:00
2015-11-05 13:15:12 -08:00
2015-11-26 17:44:28 +02:00
2015-12-20 13:39:29 +01:00
2016-03-03 15:07:12 -08:00
2016-02-25 12:01:17 -08:00
2015-11-17 02:12:46 +09:00
2015-11-25 23:48:12 +01:00
2016-03-03 15:07:10 -08:00
2015-11-04 22:15:15 -08:00
2016-02-25 12:01:14 -08:00
2016-02-25 12:01:16 -08:00
2015-11-23 16:38:40 -08:00
2016-02-25 12:01:14 -08:00
2016-03-03 15:07:10 -08:00
2015-11-04 21:50:37 -08:00
2015-12-04 08:38:42 -07:00
2015-12-07 17:28:10 +02:00
2015-12-09 12:57:13 +02:00
2015-12-07 17:28:11 +02:00
2015-11-04 22:15:15 -08:00
2015-11-05 12:28:15 -08:00
2015-11-23 09:00:09 +01:00
2015-12-18 12:24:52 -08:00
2015-11-04 22:15:15 -08:00
2015-11-16 15:22:28 -07:00