From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: akpm@linux-foundation.org, "Jens Axboe" <axboe@kernel.dk>,
"Arnd Bergmann" <arnd@arndb.de>
Subject: [66/75] block: avoid using uninitialized value in from queue_var_store
Date: Mon, 22 Apr 2013 15:25:59 +0100 [thread overview]
Message-ID: <lsq.1366640759.63236268@decadent.org.uk> (raw)
In-Reply-To: <lsq.1366640759.151900666@decadent.org.uk>
3.2.44-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <arnd@arndb.de>
commit c678ef5286ddb5cf70384ad5af286b0afc9b73e1 upstream.
As found by gcc-4.8, the QUEUE_SYSFS_BIT_FNS macro creates functions
that use a value generated by queue_var_store independent of whether
that value was set or not.
block/blk-sysfs.c: In function 'queue_store_nonrot':
block/blk-sysfs.c:244:385: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
Unlike most other such warnings, this one is not a false positive,
writing any non-number string into the sysfs files indeed has
an undefined result, rather than returning an error.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
block/blk-sysfs.c | 2 ++
1 file changed, 2 insertions(+)
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -200,6 +200,8 @@ queue_store_##name(struct request_queue
unsigned long val; \
ssize_t ret; \
ret = queue_var_store(&val, page, count); \
+ if (ret < 0) \
+ return ret; \
if (neg) \
val = !val; \
\
next prev parent reply other threads:[~2013-04-22 14:25 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 14:25 [00/75] 3.2.44-rc1 review Ben Hutchings
2013-04-22 14:25 ` [08/75] USB: io_ti: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [38/75] tracing: Fix possible NULL pointer dereferences Ben Hutchings
2013-04-22 14:25 ` [63/75] msi-wmi: Fix memory leak Ben Hutchings
2013-04-22 14:25 ` [69/75] fbcon: fix locking harder Ben Hutchings
2013-04-22 14:25 ` [50/75] hugetlbfs: add swap entry check in follow_hugetlb_page() Ben Hutchings
2013-04-22 14:25 ` [41/75] kobject: fix kset_find_obj() race with concurrent last kobject_put() Ben Hutchings
2013-04-22 14:25 ` [02/75] USB: serial: fix hang when opening port Ben Hutchings
2013-04-22 14:25 ` [31/75] ASoC: wm8903: Fix the bypass to HP/LINEOUT when no DAC or ADC is running Ben Hutchings
2013-04-22 14:25 ` [19/75] rt2x00: rt2x00pci_regbusy_read() - only print register access failure once Ben Hutchings
2013-04-22 14:25 ` [07/75] USB: io_edgeport: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [54/75] writeback: fix dirtied pages accounting on redirty Ben Hutchings
2013-04-22 14:25 ` [61/75] drm/i915: add quirk to invert brightness on eMachines e725 Ben Hutchings
2013-04-22 14:25 ` [68/75] mtd: Disable mtdchar mmap on MMU systems Ben Hutchings
2013-04-22 14:25 ` [71/75] KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796) Ben Hutchings
2013-04-22 14:25 ` [40/75] kref: Implement kref_get_unless_zero v3 Ben Hutchings
2013-04-22 14:25 ` Ben Hutchings [this message]
2013-04-22 14:25 ` [09/75] USB: mct_u232: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [42/75] vfs: Revert spurious fix to spinning prevention in prune_icache_sb Ben Hutchings
2013-04-22 14:25 ` [14/75] USB: spcp8x5: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [57/75] drm/i915: panel: invert brightness via quirk Ben Hutchings
2013-04-22 14:25 ` [23/75] hwspinlock: fix __hwspin_lock_request error path Ben Hutchings
2013-04-22 14:25 ` [62/75] drm/i915: add quirk to invert brightness on Packard Bell NCL20 Ben Hutchings
2013-04-22 14:25 ` [27/75] sched_clock: Prevent 64bit inatomicity on 32bit systems Ben Hutchings
2013-04-22 14:25 ` [17/75] hrtimer: Don't reinitialize a cpu_base lock on CPU_UP Ben Hutchings
2013-04-22 14:25 ` [65/75] ALSA: hda - fix typo in proc output Ben Hutchings
2013-04-22 14:25 ` [51/75] kernel/signal.c: stop info leak via the tkill and the tgkill syscalls Ben Hutchings
2013-04-22 14:25 ` [44/75] ath9k_htc: accept 1.x firmware newer than 1.3 Ben Hutchings
2013-04-22 14:25 ` [26/75] powerpc: pSeries_lpar_hpte_remove fails from Adjunct partition being performed before the ANDCOND test Ben Hutchings
2013-04-22 14:25 ` [37/75] target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs Ben Hutchings
2013-04-22 14:25 ` [75/75] sched: Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s Ben Hutchings
2013-04-22 14:25 ` [46/75] can: sja1000: fix handling on dt properties on little endian systems Ben Hutchings
2013-04-22 14:25 ` [64/75] ALSA: hda - Enabling Realtek ALC 671 codec Ben Hutchings
2013-04-22 14:25 ` [67/75] r8169: fix auto speed down issue Ben Hutchings
2013-04-22 14:25 ` [03/75] USB: ark3116: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [05/75] USB: cypress_m8: " Ben Hutchings
2013-04-22 14:25 ` [15/75] USB: ssu100: " Ben Hutchings
2013-04-22 14:25 ` [56/75] drm/i915: panel: invert brightness via parameter Ben Hutchings
2013-04-22 14:25 ` [73/75] KVM: Fix bounds checking in ioapic indirect register reads (CVE-2013-1798) Ben Hutchings
2013-04-22 14:25 ` [11/75] USB: mos7840: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [70/75] hfsplus: fix potential overflow in hfsplus_file_truncate() Ben Hutchings
2013-04-22 14:25 ` [35/75] x86, mm: Patch out arch_flush_lazy_mmu_mode() when running on bare metal Ben Hutchings
2013-04-22 14:25 ` [48/75] ARM: 7696/1: Fix kexec by setting outer_cache.inv_all for Feroceon Ben Hutchings
2013-04-22 14:25 ` [24/75] ALSA: usb-audio: fix endianness bug in snd_nativeinstruments_* Ben Hutchings
2013-04-22 14:25 ` [72/75] KVM: x86: Convert MSR_KVM_SYSTEM_TIME to use gfn_to_hva_cache functions (CVE-2013-1797) Ben Hutchings
2013-04-22 14:25 ` [59/75] DRM/i915: Add QUIRK_INVERT_BRIGHTNESS for NCR machines Ben Hutchings
2013-04-22 14:25 ` [52/75] net: fix incorrect credentials passing Ben Hutchings
2013-04-22 14:25 ` [06/75] USB: ftdi_sio: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [22/75] ata_piix: Fix DVD not dectected at some Haswell platforms Ben Hutchings
2013-04-22 14:25 ` [53/75] thermal: return an error on failure to register thermal class Ben Hutchings
2013-04-22 14:25 ` [45/75] of: introduce helper to manage boolean Ben Hutchings
2013-04-22 14:25 ` [13/75] USB: pl2303: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [30/75] can: gw: use kmem_cache_free() instead of kfree() Ben Hutchings
2013-04-22 14:25 ` [04/75] USB: ch341: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [21/75] libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive Ben Hutchings
2013-04-22 14:25 ` [39/75] Btrfs: make sure nbytes are right after log replay Ben Hutchings
2013-04-22 14:25 ` [25/75] alpha: Add irongate_io to PCI bus resources Ben Hutchings
2013-04-22 14:25 ` [32/75] spinlocks and preemption points need to be at least compiler barriers Ben Hutchings
2013-04-22 14:25 ` [55/75] Btrfs: fix race between mmap writes and compression Ben Hutchings
2013-04-22 14:25 ` [47/75] ath9k_hw: change AR9580 initvals to fix a stability issue Ben Hutchings
2013-04-22 14:25 ` [28/75] ftrace: Consistently restore trace function on sysctl enabling Ben Hutchings
2013-04-22 14:25 ` [49/75] ARM: 7698/1: perf: fix group validation when using enable_on_exec Ben Hutchings
2013-04-22 14:25 ` [12/75] USB: oti6858: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [18/75] crypto: gcm - fix assumption that assoc has one segment Ben Hutchings
2013-04-22 14:25 ` [33/75] tracing: Fix double free when function profile init failed Ben Hutchings
2013-04-22 14:25 ` [01/75] USB: serial: add modem-status-change wait queue Ben Hutchings
2013-04-22 14:25 ` [29/75] PM / reboot: call syscore_shutdown() after disable_nonboot_cpus() Ben Hutchings
2013-04-22 14:25 ` [34/75] x86, mm, paravirt: Fix vmalloc_fault oops during lazy MMU updates Ben Hutchings
2013-04-22 14:25 ` [10/75] USB: mos7840: fix broken TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [58/75] drm/i915: panel: invert brightness acer aspire 5734z Ben Hutchings
2013-04-22 14:25 ` [36/75] target: Fix MAINTENANCE_IN service action CDB checks to use lower 5 bits Ben Hutchings
2013-04-22 14:25 ` [43/75] ARM: Do 15e0d9e37c (ARM: pm: let platforms select cpu_suspend support) properly Ben Hutchings
2013-04-22 14:25 ` [20/75] libata: Use integer return value for atapi_command_packet_set Ben Hutchings
2013-04-22 14:25 ` [74/75] KVM: Allow cross page reads and writes from cached translations Ben Hutchings
2013-04-22 14:25 ` [16/75] USB: ti_usb_3410_5052: fix use-after-free in TIOCMIWAIT Ben Hutchings
2013-04-22 14:25 ` [60/75] drm/i915: add quirk to invert brightness on eMachines G725 Ben Hutchings
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=lsq.1366640759.63236268@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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