From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
"Mark Brown" <broonie@kernel.org>
Cc: Daniel Baluta <daniel.baluta@nxp.com>,
Jaroslav Kysela <perex@perex.cz>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Keyon Jie <yang.jie@linux.intel.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Rander Wang <rander.wang@intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Takashi Iwai <tiwai@suse.com>,
stable@vger.kernel.org, sound-open-firmware@alsa-project.org,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: SOF: Intel: Fix NULL ptr dereference when ENOMEM
Date: Fri, 25 Feb 2022 00:55:20 +0700 [thread overview]
Message-ID: <0fe07c68-9a8b-a7fd-31e1-6026589b7101@gnuweeb.org> (raw)
In-Reply-To: <cfe9e583-e20a-f1d6-2a81-2538ca3ca054@linux.intel.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 1952 bytes --]
On 2/24/22 11:53 PM, Péter Ujfalusi wrote:
> On 24/02/2022 16:51, Ammar Faizi wrote:
>> From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
>>
>> Do not call snd_dma_free_pages() when snd_dma_alloc_pages() returns
>> -ENOMEM because it leads to a NULL pointer dereference bug.
>
> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thanks for the review, I will append this tag in the v2.
>> The dmesg says:
>>
>> <6>[109482.497835][T138537] usb 1-2: Manufacturer: SIGMACHIP
>> <6>[109482.502506][T138537] input: SIGMACHIP USB Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:1C4F:0002.000D/input/input34
>> <6>[109482.558976][T138537] hid-generic 0003:1C4F:0002.000D: input,hidraw1: USB HID v1.10 Keyboard [SIGMACHIP USB Keyboard] on usb-0000:00:14.0-2/input0
>> <6>[109482.561653][T138537] input: SIGMACHIP USB Keyboard Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:1C4F:0002.000E/input/input35
>> <6>[109482.615490][T138537] input: SIGMACHIP USB Keyboard System Control as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/0003:1C4F:0002.000E/input/input36
>> <6>[109482.615643][T138537] hid-generic 0003:1C4F:0002.000E: input,hidraw2: USB HID v1.10 Device [SIGMACHIP USB Keyboard] on usb-0000:00:14.0-2/input1
>> <4>[110102.335460][T140985] rtw_8822ce 0000:01:00.0: timed out to flush queue 1
>> <3>[118575.730928][ T1387] sof-audio-pci-intel-tgl 0000:00:1f.3: error: memory alloc failed: -12
>
> Wow, I wonder what is going on that allocation fails...
Can't really tell the reason behind the -ENOMEM.
It's hard to reproduce, randomly happens. I have hit this bug
at least 4 times on my laptop with 16 GB of RAM. All happened
randomly.
I tried to torture the memory with mmap() + mlock() + memset()
+ sleep(), then playing some audio while almost running out of
memory, but still can't reproduce the same -ENOMEM.
--
Ammar Faizi
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 1795 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
next prev parent reply other threads:[~2022-02-24 17:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 14:51 Ammar Faizi
2022-02-24 16:53 ` Péter Ujfalusi
2022-02-24 17:55 ` Ammar Faizi [this message]
2022-02-24 18:05 ` Pierre-Louis Bossart
2022-02-24 18:08 ` [PATCH v2] " Ammar Faizi
2022-02-24 18:14 ` Mark Brown
2022-02-24 18:28 ` [PATCH v3] " Ammar Faizi
2022-02-24 18:58 ` [PATCH v4] " Ammar Faizi
2022-02-24 22:58 ` Mark Brown
2022-02-24 22:58 ` [PATCH v3] " Mark Brown
2022-02-24 22:58 ` [PATCH v2] " Mark Brown
2022-02-24 17:26 ` [PATCH] " Mark Brown
2022-02-24 17:56 ` Ammar Faizi
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=0fe07c68-9a8b-a7fd-31e1-6026589b7101@gnuweeb.org \
--to=ammarfaizi2@gnuweeb.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rander.wang@intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sound-open-firmware@alsa-project.org \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=yang.jie@linux.intel.com \
/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
all inboxes | Powered by JetHome®