* [PATCH] sound/isa/gus: fix null pointer dereference on pointer block
@ 2021-10-24 10:46 ` Chengfeng Ye
0 siblings, 0 replies; 5+ messages in thread
From: Chengfeng Ye @ 2021-10-24 10:46 UTC (permalink / raw)
To: perex, tiwai; +Cc: alsa-devel, linux-kernel, Chengfeng Ye
The pointer block return from snd_gf1_dma_next_block could be
null, so there is a potential null pointer dereference issue.
Fix this by adding a null check before dereference.
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
---
sound/isa/gus/gus_dma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/isa/gus/gus_dma.c b/sound/isa/gus/gus_dma.c
index a1c770d826dd..6d664dd8dde0 100644
--- a/sound/isa/gus/gus_dma.c
+++ b/sound/isa/gus/gus_dma.c
@@ -126,6 +126,8 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus)
}
block = snd_gf1_dma_next_block(gus);
spin_unlock(&gus->dma_lock);
+ if (!block)
+ return;
snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
kfree(block);
#if 0
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] sound/isa/gus: fix null pointer dereference on pointer block
@ 2021-10-24 10:46 ` Chengfeng Ye
0 siblings, 0 replies; 5+ messages in thread
From: Chengfeng Ye @ 2021-10-24 10:46 UTC (permalink / raw)
To: perex, tiwai; +Cc: alsa-devel, Chengfeng Ye, linux-kernel
The pointer block return from snd_gf1_dma_next_block could be
null, so there is a potential null pointer dereference issue.
Fix this by adding a null check before dereference.
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
---
sound/isa/gus/gus_dma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/isa/gus/gus_dma.c b/sound/isa/gus/gus_dma.c
index a1c770d826dd..6d664dd8dde0 100644
--- a/sound/isa/gus/gus_dma.c
+++ b/sound/isa/gus/gus_dma.c
@@ -126,6 +126,8 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus)
}
block = snd_gf1_dma_next_block(gus);
spin_unlock(&gus->dma_lock);
+ if (!block)
+ return;
snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
kfree(block);
#if 0
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sound/isa/gus: fix null pointer dereference on pointer block
2021-10-24 10:46 ` Chengfeng Ye
@ 2021-10-26 6:02 ` Takashi Iwai
-1 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2021-10-26 6:02 UTC (permalink / raw)
To: Chengfeng Ye; +Cc: perex, tiwai, alsa-devel, linux-kernel
On Sun, 24 Oct 2021 12:46:11 +0200,
Chengfeng Ye wrote:
>
> The pointer block return from snd_gf1_dma_next_block could be
> null, so there is a potential null pointer dereference issue.
> Fix this by adding a null check before dereference.
>
> Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Thanks, applied.
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sound/isa/gus: fix null pointer dereference on pointer block
@ 2021-10-26 6:02 ` Takashi Iwai
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2021-10-26 6:02 UTC (permalink / raw)
To: Chengfeng Ye; +Cc: linux-kernel, alsa-devel, tiwai
On Sun, 24 Oct 2021 12:46:11 +0200,
Chengfeng Ye wrote:
>
> The pointer block return from snd_gf1_dma_next_block could be
> null, so there is a potential null pointer dereference issue.
> Fix this by adding a null check before dereference.
>
> Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Thanks, applied.
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
* 回复: [PATCH] sound/isa/gus: fix null pointer dereference on pointer block
2021-10-26 6:02 ` Takashi Iwai
(?)
@ 2021-10-26 12:51 ` YE Chengfeng
-1 siblings, 0 replies; 5+ messages in thread
From: YE Chengfeng @ 2021-10-26 12:51 UTC (permalink / raw)
To: Takashi Iwai; +Cc: perex, tiwai, alsa-devel, linux-kernel
Thanks so much,
-Chengfeng
-----邮件原件-----
发件人: Takashi Iwai <tiwai@suse.de>
发送时间: 2021年10月26日 14:02
收件人: YE Chengfeng <cyeaa@connect.ust.hk>
抄送: perex@perex.cz; tiwai@suse.com; alsa-devel@alsa-project.org; linux-kernel@vger.kernel.org
主题: Re: [PATCH] sound/isa/gus: fix null pointer dereference on pointer block
On Sun, 24 Oct 2021 12:46:11 +0200,
Chengfeng Ye wrote:
>
> The pointer block return from snd_gf1_dma_next_block could be null, so
> there is a potential null pointer dereference issue.
> Fix this by adding a null check before dereference.
>
> Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Thanks, applied.
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-10-26 12:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 10:46 [PATCH] sound/isa/gus: fix null pointer dereference on pointer block Chengfeng Ye
2021-10-24 10:46 ` Chengfeng Ye
2021-10-26 6:02 ` Takashi Iwai
2021-10-26 6:02 ` Takashi Iwai
2021-10-26 12:51 ` 回复: " YE Chengfeng
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.