From: Arnd Bergmann <arnd@kernel.org>
To: "Vinod Koul" <vkoul@kernel.org>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
"Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Yu Jiaoliang <yujiaoliang@vivo.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] ALSA: compress_offload: avoid 64-bit get_user()
Date: Mon, 16 Dec 2024 10:33:41 +0100 [thread overview]
Message-ID: <20241216093410.377112-2-arnd@kernel.org> (raw)
In-Reply-To: <20241216093410.377112-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
On some architectures, get_user() cannot read a 64-bit user variable:
arm-linux-gnueabi-ld: sound/core/compress_offload.o: in function `snd_compr_ioctl':
compress_offload.c:(.text.snd_compr_ioctl+0x538): undefined reference to `__get_user_bad'
Use an equivalent copy_from_user() instead.
Fixes: 04177158cf98 ("ALSA: compress_offload: introduce accel operation mode")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
sound/core/compress_offload.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index ec2485c00e49..1d6769a66810 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -1180,9 +1180,9 @@ static int snd_compr_task_seq(struct snd_compr_stream *stream, unsigned long arg
if (stream->runtime->state != SNDRV_PCM_STATE_SETUP)
return -EPERM;
- retval = get_user(seqno, (__u64 __user *)arg);
- if (retval < 0)
- return retval;
+ retval = copy_from_user(&seqno, (__u64 __user *)arg, sizeof(seqno));
+ if (retval)
+ return -EFAULT;
retval = 0;
if (seqno == 0) {
list_for_each_entry_reverse(task, &stream->runtime->tasks, list)
--
2.39.5
next prev parent reply other threads:[~2024-12-16 9:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 9:33 [PATCH 1/2] ALSA: compress_offload: import DMA_BUF namespace Arnd Bergmann
2024-12-16 9:33 ` Arnd Bergmann [this message]
2024-12-16 10:16 ` [PATCH 2/2] ALSA: compress_offload: avoid 64-bit get_user() Shengjiu Wang
2024-12-16 16:28 ` Vinod Koul
2024-12-16 10:15 ` [PATCH 1/2] ALSA: compress_offload: import DMA_BUF namespace Shengjiu Wang
2024-12-16 16:28 ` Vinod Koul
2024-12-20 8:50 ` Takashi Iwai
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=20241216093410.377112-2-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
--cc=yujiaoliang@vivo.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