From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
Takashi Iwai <tiwai@suse.de>,
syzbot+205eb15961852c2c5974@syzkaller.appspotmail.com
Subject: [PATCH 5.4 46/63] ALSA: pcm: Test for "silence" field in struct "pcm_format_data"
Date: Mon, 18 Apr 2022 14:13:43 +0200 [thread overview]
Message-ID: <20220418121137.308538507@linuxfoundation.org> (raw)
In-Reply-To: <20220418121134.149115109@linuxfoundation.org>
From: Fabio M. De Francesco <fmdefrancesco@gmail.com>
commit 2f7a26abb8241a0208c68d22815aa247c5ddacab upstream.
Syzbot reports "KASAN: null-ptr-deref Write in
snd_pcm_format_set_silence".[1]
It is due to missing validation of the "silence" field of struct
"pcm_format_data" in "pcm_formats" array.
Add a test for valid "pat" and, if it is not so, return -EINVAL.
[1] https://lore.kernel.org/lkml/000000000000d188ef05dc2c7279@google.com/
Reported-and-tested-by: syzbot+205eb15961852c2c5974@syzkaller.appspotmail.com
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220409012655.9399-1-fmdefrancesco@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/core/pcm_misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/sound/core/pcm_misc.c
+++ b/sound/core/pcm_misc.c
@@ -423,7 +423,7 @@ int snd_pcm_format_set_silence(snd_pcm_f
return 0;
width = pcm_formats[(INT)format].phys; /* physical width */
pat = pcm_formats[(INT)format].silence;
- if (! width)
+ if (!width || !pat)
return -EINVAL;
/* signed or 1 byte data */
if (pcm_formats[(INT)format].signd == 1 || width <= 8) {
next prev parent reply other threads:[~2022-04-18 13:01 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 12:12 [PATCH 5.4 00/63] 5.4.190-rc1 review Greg Kroah-Hartman
2022-04-18 12:12 ` [PATCH 5.4 01/63] memory: atmel-ebi: Fix missing of_node_put in atmel_ebi_probe Greg Kroah-Hartman
2022-04-18 12:12 ` [PATCH 5.4 02/63] net/sched: flower: fix parsing of ethertype following VLAN header Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 03/63] veth: Ensure eth header is in skbs linear part Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 04/63] gpiolib: acpi: use correct format characters Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 05/63] mlxsw: i2c: Fix initialization error flow Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 06/63] net/sched: fix initialization order when updating chain 0 head Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 07/63] net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 08/63] net/sched: taprio: Check if socket flags are valid Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 09/63] cfg80211: hold bss_lock while updating nontrans_list Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 10/63] drm/msm/dsi: Use connector directly in msm_dsi_manager_connector_init() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 11/63] net/smc: Fix NULL pointer dereference in smc_pnet_find_ib() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 12/63] sctp: Initialize daddr on peeled off socket Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 13/63] testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 14/63] nfc: nci: add flush_workqueue to prevent uaf Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 15/63] cifs: potential buffer overflow in handling symlinks Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 16/63] drm/amd: Add USBC connector ID Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 17/63] drm/amd/display: fix audio format not updated after edid updated Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 18/63] drm/amd/display: Update VTEM Infopacket definition Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 19/63] drm/amdkfd: Fix Incorrect VMIDs passed to HWS Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 20/63] drm/amdkfd: Check for potential null return of kmalloc_array() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 21/63] Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 22/63] scsi: target: tcmu: Fix possible page UAF Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 23/63] scsi: ibmvscsis: Increase INITIAL_SRP_LIMIT to 1024 Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 24/63] net: micrel: fix KS8851_MLL Kconfig Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 25/63] ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 26/63] gpu: ipu-v3: Fix dev_dbg frequency output Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 27/63] regulator: wm8994: Add an off-on delay for WM8994 variant Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 28/63] arm64: alternatives: mark patch_alternative() as `noinstr` Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 29/63] tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 30/63] net: usb: aqc111: Fix out-of-bounds accesses in RX fixup Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 31/63] drm/amd/display: Fix allocate_mst_payload assert on resume Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 32/63] powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 33/63] scsi: mvsas: Add PCI ID of RocketRaid 2640 Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 34/63] scsi: megaraid_sas: Target with invalid LUN ID is deleted during scan Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 35/63] drivers: net: slip: fix NPD bug in sl_tx_timeout() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 36/63] perf/imx_ddr: Fix undefined behavior due to shift overflowing the constant Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 37/63] mm, page_alloc: fix build_zonerefs_node() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 38/63] mm: kmemleak: take a full lowmem check in kmemleak_*_phys() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 39/63] KVM: Dont create VM debugfs files outside of the VM directory Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 40/63] gcc-plugins: latent_entropy: use /dev/urandom Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 41/63] ath9k: Properly clear TX status area before reporting to mac80211 Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 42/63] ath9k: Fix usage of driver-private space in tx_info Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 43/63] btrfs: remove unused variable in btrfs_{start,write}_dirty_block_groups() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 44/63] btrfs: mark resumed async balance as writing Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 45/63] ALSA: hda/realtek: Add quirk for Clevo PD50PNT Greg Kroah-Hartman
2022-04-18 12:13 ` Greg Kroah-Hartman [this message]
2022-04-18 12:13 ` [PATCH 5.4 47/63] ipv6: fix panic when forwarding a pkt with no in6 dev Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 48/63] drm/amd/display: dont ignore alpha property on pre-multiplied mode Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 49/63] genirq/affinity: Consider that CPUs on nodes can be unbalanced Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 50/63] tick/nohz: Use WARN_ON_ONCE() to prevent console saturation Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 51/63] ARM: davinci: da850-evm: Avoid NULL pointer dereference Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 52/63] dm integrity: fix memory corruption when tag_size is less than digest size Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 53/63] smp: Fix offline cpu check in flush_smp_call_function_queue() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 54/63] i2c: pasemi: Wait for write xfers to finish Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 55/63] dma-direct: avoid redundant memory sync for swiotlb Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 56/63] ax25: add refcount in ax25_dev to avoid UAF bugs Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 57/63] ax25: fix reference count leaks of ax25_dev Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 58/63] ax25: fix UAF bugs of net_device caused by rebinding operation Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 59/63] ax25: Fix refcount leaks caused by ax25_cb_del() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 60/63] ax25: fix UAF bug in ax25_send_control() Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 61/63] ax25: fix NPD bug in ax25_disconnect Greg Kroah-Hartman
2022-04-18 12:13 ` [PATCH 5.4 62/63] ax25: Fix NULL pointer dereferences in ax25 timers Greg Kroah-Hartman
2022-04-18 12:14 ` [PATCH 5.4 63/63] ax25: Fix UAF bugs " Greg Kroah-Hartman
2022-04-18 17:33 ` [PATCH 5.4 00/63] 5.4.190-rc1 review Florian Fainelli
2022-04-18 18:18 ` Pavel Machek
2022-04-19 0:05 ` Guenter Roeck
2022-04-19 0:09 ` Shuah Khan
2022-04-19 6:37 ` Naresh Kamboju
2022-04-19 12:00 ` Sudip Mukherjee
2022-04-19 12:21 ` Jon Hunter
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=20220418121137.308538507@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=fmdefrancesco@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+205eb15961852c2c5974@syzkaller.appspotmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).