All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: akpm@linux-foundation.org, "Takashi Iwai" <tiwai@suse.de>,
	"Dmitry Vyukov" <dvyukov@google.com>
Subject: [PATCH 3.2 068/101] ALSA: seq: Fix link corruption by event error handling
Date: Thu, 01 Jun 2017 16:40:55 +0100	[thread overview]
Message-ID: <lsq.1496331655.925189094@decadent.org.uk> (raw)
In-Reply-To: <lsq.1496331653.552489284@decadent.org.uk>

3.2.89-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

commit f3ac9f737603da80c2da3e84b89e74429836bb6d upstream.

The sequencer FIFO management has a bug that may lead to a corruption
(shortage) of the cell linked list.  When a sequencer client faces an
error at the event delivery, it tries to put back the dequeued cell.
When the first queue was put back, this forgot the tail pointer
tracking, and the link will be screwed up.

Although there is no memory corruption, the sequencer client may stall
forever at exit while flushing the pending FIFO cells in
snd_seq_pool_done(), as spotted by syzkaller.

This patch addresses the missing tail pointer tracking at
snd_seq_fifo_cell_putback().  Also the patch makes sure to clear the
cell->enxt pointer at snd_seq_fifo_event_in() for avoiding a similar
mess-up of the FIFO linked list.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/core/seq/seq_fifo.c | 3 +++
 1 file changed, 3 insertions(+)

--- a/sound/core/seq/seq_fifo.c
+++ b/sound/core/seq/seq_fifo.c
@@ -137,6 +137,7 @@ int snd_seq_fifo_event_in(struct snd_seq
 	f->tail = cell;
 	if (f->head == NULL)
 		f->head = cell;
+	cell->next = NULL;
 	f->cells++;
 	spin_unlock_irqrestore(&f->lock, flags);
 
@@ -216,6 +217,8 @@ void snd_seq_fifo_cell_putback(struct sn
 		spin_lock_irqsave(&f->lock, flags);
 		cell->next = f->head;
 		f->head = cell;
+		if (!f->tail)
+			f->tail = cell;
 		f->cells++;
 		spin_unlock_irqrestore(&f->lock, flags);
 	}

  parent reply	other threads:[~2017-06-01 15:43 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 15:40 [PATCH 3.2 000/101] 3.2.89-rc1 review Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 032/101] USB: serial: digi_acceleport: fix OOB-event processing Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 031/101] USB: serial: digi_acceleport: fix OOB data sanity check Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 049/101] powerpc/xmon: Fix data-breakpoint Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 043/101] KEYS: Fix an error code in request_master_key() Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 066/101] ALSA: timer: Reject user params with too small ticks Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 033/101] USB: serial: digi_acceleport: fix incomplete rx sanity check Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 039/101] serial: 8250_pci: Add MKS Tenta SCOM-0800 and SCOM-0801 cards Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 020/101] usb: dwc3: gadget: skip Set/Clear Halt when invalid Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 056/101] nfsd: special case truncates some more Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 023/101] USB: serial: ftdi_sio: fix extreme low-latency setting Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 029/101] bcma: use (get|put)_device when probing/removing device driver Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 024/101] drm/ttm: Make sure BOs being swapped out are cacheable Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 046/101] md linear: fix a race between linear_add() and linear_congested() Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 045/101] mmc: host: omap_hsmmc: avoid possible overflow of timeout value Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 074/101] xfrm_user: validate XFRM_MSG_NEWAE XFRMA_REPLAY_ESN_VAL replay_window Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 021/101] usb: gadget: f_hid: Use spinlock instead of mutex Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 060/101] net/dccp: fix use after free in tw_timer_handler() Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 079/101] net/packet: fix overflow in check for priv area size Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 093/101] nfsd: stricter decoding of write-like NFSv2/v3 ops Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 082/101] KEYS: fix keyctl_set_reqkey_keyring() to not leak thread keyrings Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 061/101] scsi: aacraid: Fix memory leak in fib init path Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 075/101] xfrm_user: validate XFRM_MSG_NEWAE incoming ESN size harder Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 055/101] nfsd: minor nfsd_setattr cleanup Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 092/101] nfsd4: minor NFSv2/v3 write decoding cleanup Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 014/101] USB: serial: mct_u232: fix modem-status error handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 051/101] MIPS: Fix special case in 64 bit IP checksumming Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 009/101] USB: serial: ark3116: fix open error handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 089/101] tracing: Use strlcpy() instead of strcpy() in __trace_find_cmdline() Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 080/101] net/packet: fix overflow in check for tp_frame_nr Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 018/101] perf script: Fix man page about --dump-raw-trace option Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 085/101] crypto: hash - Fix the pointer voodoo in unaligned ahash Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 016/101] USB: serial: ti_usb_3410_5052: fix control-message error handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 071/101] KEYS: Reinstate EPERM for a key type name beginning with a '.' Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 006/101] IB/ipoib: Change list_del to list_del_init in the tx object Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 040/101] USB: serial: cp210x: add new IDs for GE Bx50v3 boards Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 078/101] packet: handle too big packets for PACKET_V3 Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 003/101] ath5k: drop bogus warning on drv_set_key with unsupported cipher Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 026/101] ext4: trim allocation requests to group size Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 035/101] s390/qdio: clear DSCI prior to scanning multiple input queues Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 042/101] USB: serial: mos7840: fix another NULL-deref at open Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 070/101] KEYS: special dot prefixed keyring name bug fix Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 038/101] ext4: preserve the needs_recovery flag when the journal is aborted Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 001/101] adm80211: return an error if adm8211_alloc_rings() fails Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 012/101] USB: serial: io_edgeport: fix epic-descriptor handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 017/101] staging: rtl: fix possible NULL pointer dereference Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 095/101] USB: serial: io_ti: fix information leak in completion handler Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 076/101] drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl() Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 004/101] RDMA/core: Fix incorrect structure packing for booleans Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 057/101] NFSv4: Fix the underestimation of delegation XDR space reservation Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 096/101] USB: serial: omninet: fix reference leaks at open Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 067/101] ALSA: ctxfi: Fallback DMA mask to 32bit Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 050/101] Bluetooth: Add another AR3012 04ca:3018 device Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 044/101] drivers: hv: Turn off write permission on the hypercall page Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 037/101] jbd2: don't leak modified metadata buffers on an aborted journal Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 081/101] net/packet: fix overflow in check for tp_reserve Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 099/101] sctp: do not inherit ipv6_{mc|ac|fl}_list from parent Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 098/101] ipv6: Check ip6_find_1stfragopt() return value properly Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 058/101] fuse: add missing FR_FORCE Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 027/101] ext4: use private version of page_zero_new_buffers() for data=journal mode Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 041/101] USB: serial: ftdi_sio: fix line-status over-reporting Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 010/101] USB: serial: ftdi_sio: fix modem-status error handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 028/101] ext4: fix data corruption in data=journal mode Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 052/101] MIPS: OCTEON: Fix copy_from_user fault handling for large buffers Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 063/101] NFSv4: Fix range checking in __nfs4_get_acl_uncached and __nfs4_proc_set_acl Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 083/101] mm/mempolicy.c: fix error handling in set_mempolicy and mbind Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 062/101] scsi: aacraid: Reorder Adapter status check Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 077/101] drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl() Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 002/101] tty: serial: msm: Fix module autoload Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 091/101] nfsd: check for oversized NFSv2/v3 arguments Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 084/101] crypto: ahash - Fully restore ahash request before completing Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 030/101] [media] media: fix dm1105.c build error Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 015/101] USB: serial: ssu100: fix control-message error handling Ben Hutchings
2017-06-01 15:40 ` Ben Hutchings [this message]
2017-06-01 15:40 ` [PATCH 3.2 086/101] crypto: hash - Pull out the functions to save/restore request Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 007/101] USB: serial: ch341: fix modem-status handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 072/101] KEYS: Disallow keyrings beginning with '.' to be joined as session keyrings Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 013/101] USB: serial: io_edgeport: fix descriptor error handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 069/101] USB: iowarrior: fix NULL-deref at probe Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 025/101] drm/radeon: handle vfct with multiple vbios images Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 048/101] nlm: Ensure callback code also checks that the files match Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 064/101] NFSv4: fix getacl ERANGE for some ACL buffer sizes Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 034/101] USB: serial: keyspan_pda: fix receive sanity checks Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 008/101] USB: serial: ark3116: fix register-accessor error handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 005/101] IB/ipoib: Set device connection mode only when needed Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 101/101] ipv6: fix out of bound writes in __ip6_append_data() Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 100/101] ipv6/dccp: do not inherit ipv6_mc_list from parent Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 011/101] USB: serial: ftdi_sio: fix latency-timer error handling Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 065/101] net sched actions: decrement module reference count after table flush Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 047/101] md: ensure md devices are freed before module is unloaded Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 087/101] crypto: hash - Simplify the ahash_finup implementation Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 059/101] rdma_cm: fail iwarp accepts w/o connection params Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 053/101] MIPS: ip27: Disable qlge driver in defconfig Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 036/101] x86/pci-calgary: Fix iommu_free() comparison of unsigned expression >= 0 Ben Hutchings
2017-06-01 15:40   ` Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 090/101] ipx: call ipxitf_put() in ioctl error path Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 094/101] dccp/tcp: do not inherit mc_list from parent Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 097/101] ipv6: Prevent overrun when parsing v6 header options Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 073/101] ping: implement proper locking Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 019/101] mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 088/101] crypto: ahash - Fix EINPROGRESS notification callback Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 022/101] MIPS: 'make -s' should be silent Ben Hutchings
2017-06-01 15:40 ` [PATCH 3.2 054/101] nfsd: update mtime on truncate Ben Hutchings
2017-06-01 21:41 ` [PATCH 3.2 000/101] 3.2.89-rc1 review Guenter Roeck
2017-06-01 21:59   ` 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.1496331655.925189094@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.