Patch "efivars: pstore: Do not check size when erasing variable" 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

    efivars: pstore: Do not check size when erasing variable

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:
     efivars-pstore-do-not-check-size-when-erasing-variable.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 80a19debc2f2d398cfa57fae97bc99826748a602 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
Date: Sat, 23 Mar 2013 03:49:53 +0000
Subject: efivars: pstore: Do not check size when erasing variable

From: Ben Hutchings <ben@xxxxxxxxxxxxxxx>

commit 80a19debc2f2d398cfa57fae97bc99826748a602 upstream.

In 3.2, unlike mainline, efi_pstore_erase() calls efi_pstore_write()
with a size of 0, as the underlying EFI interface treats a size of 0
as meaning deletion.

This was not taken into account in my backport of commit d80a361d779a
'efi_pstore: Check remaining space with QueryVariableInfo() before
writing data'.  The size check should be omitted when erasing.

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

---
 drivers/firmware/efivars.c |   24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -778,19 +778,21 @@ static int efi_pstore_write(enum pstore_
 
 	spin_lock_irqsave(&efivars->lock, flags);
 
-	/*
-	 * Check if there is a space enough to log.
-	 * size: a size of logging data
-	 * DUMP_NAME_LEN * 2: a maximum size of variable name
-	 */
+	if (size) {
+		/*
+		 * Check if there is a space enough to log.
+		 * size: a size of logging data
+		 * DUMP_NAME_LEN * 2: a maximum size of variable name
+		 */
 
-	status = check_var_size_locked(efivars, PSTORE_EFI_ATTRIBUTES,
-					 size + DUMP_NAME_LEN * 2);
+		status = check_var_size_locked(efivars, PSTORE_EFI_ATTRIBUTES,
+					       size + DUMP_NAME_LEN * 2);
 
-	if (status) {
-		spin_unlock_irqrestore(&efivars->lock, flags);
-		*id = part;
-		return -ENOSPC;
+		if (status) {
+			spin_unlock_irqrestore(&efivars->lock, flags);
+			*id = part;
+			return -ENOSPC;
+		}
 	}
 
 	for (i = 0; i < DUMP_NAME_LEN; i++)


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/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/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/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/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
--
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]