Patch "x86/efi: Fix dummy variable buffer allocation" has been added to the 3.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/efi: Fix dummy variable buffer allocation

to the 3.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-efi-fix-dummy-variable-buffer-allocation.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From b35b16d2be61943373f16ceb6184a66da84ab229 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
Date: Sun, 16 Jun 2013 21:27:12 +0100
Subject: x86/efi: Fix dummy variable buffer allocation

From: Ben Hutchings <ben@xxxxxxxxxxxxxxx>

commit b8cb62f82103083a6e8fa5470bfe634a2c06514d upstream.

1. Check for allocation failure
2. Clear the buffer contents, as they may actually be written to flash
3. Don't leak the buffer

Compile-tested only.

[ Tested successfully on my buggy ASUS machine - Matt ]

Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
Signed-off-by: Matt Fleming <matt.fleming@xxxxxxxxx>
Cc: Rui Xiang <rui.xiang@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 arch/x86/platform/efi/efi.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -1020,7 +1020,10 @@ efi_status_t efi_query_variable_store(u3
 		 * that by attempting to use more space than is available.
 		 */
 		unsigned long dummy_size = remaining_size + 1024;
-		void *dummy = kmalloc(dummy_size, GFP_ATOMIC);
+		void *dummy = kzalloc(dummy_size, GFP_ATOMIC);
+
+		if (!dummy)
+			return EFI_OUT_OF_RESOURCES;
 
 		status = efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID,
 					  EFI_VARIABLE_NON_VOLATILE |
@@ -1040,6 +1043,8 @@ efi_status_t efi_query_variable_store(u3
 					 0, dummy);
 		}
 
+		kfree(dummy);
+
 		/*
 		 * The runtime code may now have triggered a garbage collection
 		 * run, so check the variable info again


Patches currently in stable-queue which might be from ben@xxxxxxxxxxxxxxx are

queue-3.4/ecryptfs-fix-memory-leakage-in-keystore.c.patch
queue-3.4/alsa-hda-conexant-correct-vendor-ids-for-new-codecs.patch
queue-3.4/regulator-max8997-use-uv-in-voltage_map_desc.patch
queue-3.4/dm-bufio-avoid-a-possible-__vmalloc-deadlock.patch
queue-3.4/setfacl-removes-part-of-acl-when-setting-posix-acls-to-samba.patch
queue-3.4/dm-thin-fix-discard-corruption.patch
queue-3.4/nfsv4.1-handle-nfs4err_delay-when-resetting-the-nfsv4.1-session.patch
queue-3.4/cifs-fix-error-handling-in-cifs_push_mandatory_locks.patch
queue-3.4/dm-mpath-fix-race-condition-between-multipath_dtr-and-pg_init_done.patch
queue-3.4/efi-be-more-paranoid-about-available-space-when-creating-variables.patch
queue-3.4/intel_idle-don-t-register-cpu-notifier-if-we-are-not-running.patch
queue-3.4/efi_pstore-check-remaining-space-with-queryvariableinfo-before-writing-data.patch
queue-3.4/x86-sandy-bridge-mark-arrays-in-__init-functions-as-__initconst.patch
queue-3.4/pci-shpchp-use-per-slot-workqueues-to-avoid-deadlock.patch
queue-3.4/misc-hpilo-remove-pci_disable_device.patch
queue-3.4/x86-efi-fix-dummy-variable-buffer-allocation.patch
queue-3.4/nfsv4.1-fix-a-race-in-pnfs-layoutcommit.patch
queue-3.4/nfsd-don-t-run-get_file-if-nfs4_preprocess_stateid_op-return-error.patch
queue-3.4/alsa-hda-add-conexant-cx20755-20756-20757-codec-ids.patch
queue-3.4/n_gsm-flow-control-handling-in-mux-driver.patch
queue-3.4/alsa-hda-add-inverted-internal-mic-quirk-for-lenovo-ideapad-u310.patch
queue-3.4/nfs-nfs_getaclargs.acl_len-is-a-size_t.patch
queue-3.4/nfsv4-wait-on-recovery-for-async-session-errors.patch
queue-3.4/zram-avoid-invalid-memory-access-in-zram_exit.patch
queue-3.4/x86-fix-build-error-and-kconfig-for-ia32_emulation-and-binfmt.patch
queue-3.4/n_gsm-replace-kfree_skb-w-appropriate-dev_-versions.patch
queue-3.4/x86-build-icc-remove-uninitialized_var-from-compiler-intel.h.patch
queue-3.4/rtl8192cu-fix-unbalanced-irq-enable-in-error-path-of-rtl92cu_hw_init.patch
queue-3.4/floppy-properly-handle-failure-on-add_disk-loop.patch
queue-3.4/efivars-fix-check-for-config_efi_vars_pstore_default_disable.patch
queue-3.4/tty-serial-imx-don-t-reinit-clock-in-imx_setup_ufcr.patch
queue-3.4/nfsv4.1-integer-overflow-in-decode_cb_sequence_args.patch
queue-3.4/x86-build-pass-in-additional-mno-mmx-mno-sse-options.patch
queue-3.4/cifs-delay-super-block-destruction-until-all-cifsfileinfo-objects-are-gone.patch
queue-3.4/alsa-hda-add-inverted-internal-mic-quirk-for-lenovo-s205.patch
queue-3.4/zram-destroy-all-devices-on-error-recovery-path-in-zram_init.patch
queue-3.4/regulator-max8998-ensure-enough-delay-time-for-max8998_set_voltage_buck_time_sel.patch
queue-3.4/nfsd4-fix-xdr-decoding-of-large-non-write-compounds.patch
queue-3.4/char-n_gsm-remove-message-filtering-for-contipated-dlci.patch
queue-3.4/zram-fix-deadlock-bug-in-partial-read-write.patch
queue-3.4/can-c_can-set-reserved-bit-in-ifx_mask2-to-1-on-write.patch
queue-3.4/nfsv4.1-don-t-decode-skipped-layoutgets.patch
queue-3.4/dm-snapshot-add-missing-module-aliases.patch
queue-3.4/ptrace-x86-partly-fix-set_task_blockstep-update_debugctlmsr-logic.patch
queue-3.4/perf-fix-perf-ring-buffer-memory-ordering.patch
queue-3.4/zram-avoid-access-beyond-the-zram-device.patch
queue-3.4/efivars-pstore-do-not-check-size-when-erasing-variable.patch
queue-3.4/efivars-disable-external-interrupt-while-holding-efivars-lock.patch
queue-3.4/n_gsm-avoid-accessing-freed-memory-during-cmd_fcoff-condition.patch
queue-3.4/ptrace-x86-introduce-set_task_blockstep-helper.patch
queue-3.4/alsa-hda-add-support-for-cx20952.patch
queue-3.4/ubi-erase-free-peb-with-bitflip-in-ec-header.patch
queue-3.4/i82975x_edac-fix-dimm-label-initialization.patch
queue-3.4/x86-get_unmapped_area-access-mmap_legacy_base-through-mm_struct-member.patch
queue-3.4/input-synaptics-adjust-threshold-for-treating-position-values-as-negative.patch
queue-3.4/x86-efi-implement-efi_no_storage_paranoia-parameter.patch
queue-3.4/zram-allow-request-end-to-coincide-with-disksize.patch
queue-3.4/alsa-hda-fix-oops-caused-by-recent-commit-fix-internal-mic-for-lenovo-ideapad-u300s.patch
queue-3.4/efivars-add-module-parameter-to-disable-use-as-a-pstore-backend.patch
queue-3.4/x86-efi-check-max_size-only-if-it-is-non-zero.patch
queue-3.4/md-raid10-fix-enough-function-for-detecting-if-array-is-failed.patch
queue-3.4/fs-cachefiles-add-support-for-large-files-in-filesystem-caching.patch
queue-3.4/x86-apic-disable-i-o-apic-before-shutdown-of-the-local-apic.patch
queue-3.4/i915-ensure-that-vga-plane-is-disabled.patch
queue-3.4/alsa-hda-add-stereo-dmic-fixup-for-acer-aspire-one-522.patch
queue-3.4/staging-zram-fix-access-of-null-pointer.patch
queue-3.4/mac80211-introduce-ieee80211_hw_teardown_aggr_on_bar_fail.patch
queue-3.4/modify-uefi-anti-bricking-code.patch
queue-3.4/efi-export-efi_query_variable_store-for-efivars.ko.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]