From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
Mike Waychison <mikew@google.com>,
Matt Domsch <Matt_Domsch@dell.com>,
<matthew.e.tolentino@intel.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 34/44] efivars: prevent oops on unload when efi is not enabled
Date: Thu, 19 May 2011 17:10:52 -0700 [thread overview]
Message-ID: <1305850262-9575-34-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1305850262-9575-1-git-send-email-gregkh@suse.de>
From: Randy Dunlap <randy.dunlap@oracle.com>
efivars_exit() should check for efi_enabled and not undo
allocations when efi is not enabled. Otherwise there is an Oops
during module unload:
calling efivars_init+0x0/0x1000 [efivars] @ 2810
EFI Variables Facility v0.08 2004-May-17
initcall efivars_init+0x0/0x1000 [efivars] returned 0 after 5120 usecs
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
last sysfs file: /sys/module/firmware_class/initstate
CPU 1
Modules linked in: efivars(-) af_packet tun nfsd lockd nfs_acl auth_rpcgss sunrpc ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables x_tables ipv6 cpufreq_ondemand acpi_cpufreq freq_table mperf binfmt_misc dm_mirror dm_region_hash dm_log dm_multipath scsi_dh dm_mod snd_hda_codec_analog snd_hda_intel snd_hda_codec snd_hwdep mousedev snd_seq joydev snd_seq_device mac_hid evdev snd_pcm usbkbd usbmouse usbhid snd_timer hid tg3 snd sr_mod pcspkr rtc_cmos soundcore cdrom iTCO_wdt processor sg dcdbas i2c_i801 rtc_core iTCO_vendor_support intel_agp snd_page_alloc thermal_sys rtc_lib intel_gtt 8250_pnp button hwmon unix ide_pci_generic ide_core ata_generic pata_acpi ata_piix sd_mod crc_t10dif ext3 jbd mbcache uhci_hcd ohci_hcd ssb mmc_core pcmcia pcmcia_core firmware_class ehci_hcd usbcore [last unloaded: dell_rbu]
Pid: 2812, comm: rmmod Not tainted 2.6.39-rc6 #1 Dell Inc. OptiPlex 745 /0TY565
RIP: 0010:[<ffffffffa06a17f6>] [<ffffffffa06a17f6>] unregister_efivars+0x28/0x12c [efivars]
RSP: 0018:ffff88005eedde98 EFLAGS: 00010283
RAX: ffffffffa06a23fc RBX: ffffffffa06a44c0 RCX: ffff88007c227a50
RDX: 0000000000000000 RSI: 00000055ac13db78 RDI: ffffffffa06a44c0
RBP: ffff88005eeddec8 R08: 0000000000000000 R09: ffff88005eeddd78
R10: ffffffffa06a4220 R11: ffff88005eeddd78 R12: fffffffffffff7d0
R13: 00007fff5a3aaec0 R14: 0000000000000000 R15: ffffffffa06a4508
FS: 00007fa8dcc4a6f0(0000) GS:ffff88007c200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000000 CR3: 000000005d148000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process rmmod (pid: 2812, threadinfo ffff88005eedc000, task ffff88006754b000)
Stack:
ffff88005eeddec8 ffffffffa06a4220 0000000000000000 00007fff5a3aaec0
0000000000000000 0000000000000001 ffff88005eedded8 ffffffffa06a2418
ffff88005eeddf78 ffffffff810d3598 ffffffffa06a4220 0000000000000880
Call Trace:
[<ffffffffa06a2418>] efivars_exit+0x1c/0xc04 [efivars]
[<ffffffff810d3598>] sys_delete_module+0x2d6/0x368
[<ffffffff812d1db9>] ? lockdep_sys_exit_thunk+0x35/0x67
[<ffffffff810fcba1>] ? audit_syscall_entry+0x172/0x1a5
[<ffffffff81575082>] system_call_fastpath+0x16/0x1b
Code: 5c c9 c3 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 ec 08 0f 1f 44 00 00 4c 8b 67 48 48 89 fb 4c 8d 7f 48 49 81 ec 30 08 00 00 <4d> 8b ac 24 30 08 00 00 49 81 ed 30 08 00 00 eb 59 48 89 df 48
RIP [<ffffffffa06a17f6>] unregister_efivars+0x28/0x12c [efivars]
RSP <ffff88005eedde98>
CR2: 0000000000000000
---[ end trace aa99b99090f70baa ]---
Matt apparently removed such a check in 2004 (with no reason given):
* 17 May 2004 - Matt Domsch <Matt_Domsch@dell.com>
* remove check for efi_enabled in exit
but there have been several changes since then.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mike Waychison <mikew@google.com>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: <matthew.e.tolentino@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/firmware/efivars.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 5d1ec68..a2d2f1f 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -827,8 +827,10 @@ err_put:
static void __exit
efivars_exit(void)
{
- unregister_efivars(&__efivars);
- kobject_put(efi_kobj);
+ if (efi_enabled) {
+ unregister_efivars(&__efivars);
+ kobject_put(efi_kobj);
+ }
}
module_init(efivars_init);
--
1.7.4.2
next prev parent reply other threads:[~2011-05-20 0:14 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 0:08 [GIT PATCH] driver core merge for .40 Greg KH
2011-05-20 0:10 ` [PATCH 01/44] device: add dev_WARN_ONCE Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 02/44] efivars: memory leak on error in create_efivars_bin_attributes() Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 03/44] efivars: handle errors from register_efivars() Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 04/44] firmware: Fix grammar in sysfs-firmware-dmi doc Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 05/44] drivers: make device_type const Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 06/44] kernel/ksysfs.c: expose file_caps_enabled in sysfs Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 07/44] HOWTO: sync up Documentaion/ja_JP/HOWTO Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 08/44] uio_netx: Add support for netPLC cards Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 09/44] uio: fix finding mm index for vma Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 10/44] uio: fix allocating minor id for uio device Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 11/44] uio: clean uioinfo when uninstall uio driver Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 12/44] printk: /dev/kmsg - properly support writev() to avoid interleaved printk() lines Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 13/44] kmsg: properly support writev to avoid interleaved printk lines fix Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 14/44] drivers:misc:ti-st: handle delayed tty receive Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 15/44] drivers:misc:ti-st: remove rfkill dependency Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 16/44] driver-core: fix race between device_register and driver_register Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 17/44] drivers/base/core.c: Fixed brace coding style issue Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 18/44] driver core/platform_device_add_data: set platform_data to NULL if !data Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 19/44] driver core/platform_device_add_data: free platform data before overwriting Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 20/44] driver core/platform_device_add_resources: set resource to NULL if !res Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 21/44] driver core/platform_device_add_resources: free resource before overwriting Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 22/44] driver core: let dev_set_drvdata return int instead of void as it can fail Greg Kroah-Hartman
2011-05-20 7:53 ` [22/44] " Milton Miller
2011-05-20 8:01 ` Uwe Kleine-König
2011-05-20 0:10 ` [PATCH 23/44] drivers:base:fix the coding format of memory.c Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 24/44] Add a strtobool function matching semantics of existing in kernel equivalents Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 25/44] debugfs: move to new strtobool Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 26/44] params.c: Use new strtobool function to process boolean inputs Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 27/44] misc: fix ti-st build issues Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 28/44] x86: get_bios_ebda_length() Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 29/44] x86: Better comments for get_bios_ebda() Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 30/44] driver: Google EFI SMI Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 31/44] driver: Google Memory Console Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 32/44] Introduce CONFIG_GOOGLE_FIRMWARE Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 33/44] Allow setting of number of raw devices as a module parameter Greg Kroah-Hartman
2011-05-20 0:10 ` Greg Kroah-Hartman [this message]
2011-05-20 0:10 ` [PATCH 35/44] reboot: disable usermodehelper to prevent fs access Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 36/44] RAW driver: Remove call to kobject_put() Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 37/44] Translated Documentation/email-clients.txt Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 38/44] driver core: Add the device driver-model structures to kerneldoc Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 39/44] driver core: remove the driver-model structures from the documentation Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 40/44] SYSFS: Fix erroneous comments for sysfs_update_group() Greg Kroah-Hartman
2011-05-20 0:10 ` [PATCH 41/44] memory hotplug: Speed up add/remove when blocks are larger than PAGES_PER_SECTION Greg Kroah-Hartman
2011-05-20 0:11 ` [PATCH 42/44] drivers/base/memory.c: fix warning due to "memory hotplug: Speed up add/remove when blocks are larger than PAGES_PER_SECTION" Greg Kroah-Hartman
2011-05-20 0:11 ` [PATCH 43/44] sysfs: remove "last sysfs file:" line from the oops messages Greg Kroah-Hartman
2011-05-20 0:11 ` [PATCH 44/44] debugfs: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1305850262-9575-34-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=Matt_Domsch@dell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.e.tolentino@intel.com \
--cc=mikew@google.com \
--cc=randy.dunlap@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox