ALSA: compress_offload: import DMA_BUF namespace
Subsystems (2)
PATCH 1/2 ALSA: compress_offload: import DMA_BUF namespace
From: Arnd Bergmann <[email protected]>
The compression offload code cannot be in a loadable module unless it imports that namespace:
ERROR: modpost: module snd-compress uses symbol dma_buf_get from namespace DMA_BUF, but does not import it.
ERROR: modpost: module snd-compress uses symbol dma_buf_put from namespace DMA_BUF, but does not import it.
ERROR: modpost: module snd-compress uses symbol dma_buf_fd from namespace DMA_BUF, but does not import it.
--- sound/core/compress_offload.c | 1 + 1 file changed, 1 insertion(+)
sound/core/compress_offload.c +1 -0
@@ -1247,6 +1247,7 @@ void snd_compr_task_finished(struct snd_compr_stream *stream, }EXPORT_SYMBOL_GPL (snd_compr_task_finished); +MODULE_IMPORT_NS ("DMA_BUF" );#endif /* CONFIG_SND_COMPRESS_ACCEL */ static long snd_compr_ioctl (struct file *f,unsigned int cmd,unsigned long arg)
Signature · 1 line
2.39.5
PATCH 2/2 ALSA: compress_offload: avoid 64-bit get_user()
From: Arnd Bergmann <[email protected]>
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.
--- sound/core/compress_offload.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/core/compress_offload.c +3 -3
@@ -1180,9 +1180,9 @@ static int snd_compr_task_seq(struct snd_compr_stream *stream, unsigned long argif (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)
Signature · 1 line
2.39.5
Quoted 6 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The compression offload code cannot be in a loadable module unless it imports that namespace:
Quoted 6 lines
ERROR: modpost: module snd-compress uses symbol
dma_buf_getfrom namespaceDMA_BUF, but does not import it.
ERROR: modpost: module snd-compress uses symboldma_buf_putfrom namespaceDMA_BUF, but does not import it.
ERROR: modpost: module snd-compress uses symboldma_buf_fdfrom namespaceDMA_BUF, but does not import it.Fixes 04177158cf98 ("ALSA: compress_offload: introduce accel operation mode")Signed-off-by Arnd Bergmann <[email protected]>
Best regards
Shengjiu Wang
Quoted 20 lines
--- sound/core/compress_offload.c | 1 + 1 file changed, 1 insertion(+)sound/core/compress_offload.c +1
-1@@ -1247,6 +1247,7 @@ void snd_compr_task_finished(struct snd_compr_stream *stream, }EXPORT_SYMBOL_GPL (snd_compr_task_finished); +MODULE_IMPORT_NS ("DMA_BUF" );#endif /* CONFIG_SND_COMPRESS_ACCEL */ static long snd_compr_ioctl (struct file *f,unsigned int cmd,unsigned long arg) --2.39.5
Re: [PATCH 2/2] ALSA: compress_offload: avoid 64-bit get_user()
In reply to Arnd BergmannQuoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
On some architectures,
get_user()cannot read a 64-bit user variable:
Quoted 7 lines
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 <[email protected]>
Best regards
Shengjiu Wang
Quoted 25 lines
--- sound/core/compress_offload.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)sound/core/compress_offload.c +3
-4@@ -1180,9 +1180,9 @@ static int snd_compr_task_seq(struct snd_compr_stream *stream, unsigned long argif (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
Quoted 4 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The compression offload code cannot be in a loadable module unless it imports that namespace:
Signature · 1 line
~Vinod
Re: [PATCH 2/2] ALSA: compress_offload: avoid 64-bit get_user()
In reply to Arnd BergmannQuoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
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.
Signature · 1 line
~Vinod
Quoted 6 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The compression offload code cannot be in a loadable module unless it imports that namespace:
Quoted 6 lines
ERROR: modpost: module snd-compress uses symbol
dma_buf_getfrom namespaceDMA_BUF, but does not import it.
ERROR: modpost: module snd-compress uses symboldma_buf_putfrom namespaceDMA_BUF, but does not import it.
ERROR: modpost: module snd-compress uses symboldma_buf_fdfrom namespaceDMA_BUF, but does not import it.Fixes 04177158cf98 ("ALSA: compress_offload: introduce accel operation mode")Signed-off-by Arnd Bergmann <[email protected]>
Sorry for the delay, as I've been (still) off.
Applied both patches now. Thanks!
Takashi