[alsa-devel] UBSAN: Undefined behaviour in sound/core/timer.c

Takashi Iwai tiwai at suse.de
Sun Jun 24 09:46:21 CEST 2018


On Sun, 24 Jun 2018 09:11:42 +0200,
air icy wrote:
> 
> Hi Takashi,
> 
> You are a responsible man.
> I repro this bug in *https://github.com/lcytxw/bug_repro/tree/master/bug_200213
> <https://github.com/lcytxw/bug_repro/tree/master/bug_200213>*
> This patch is ok since I can't repro this bug anymore.

Good to hear.

Would you like put your reported-by and tested-by tags?
If yes, please give it explicitly.  It's be better to give a real name
than a nick name there in general.

Oh, and your another report for seq_client.c should be handled
similarly, a patch like below.  Please give it a try.


thanks,

Takashi

---
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -2004,7 +2004,8 @@ static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client,
 	struct snd_seq_client *cptr = NULL;
 
 	/* search for next client */
-	info->client++;
+	if (info->client < INT_MAX)
+		info->client++;
 	if (info->client < 0)
 		info->client = 0;
 	for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) {


More information about the Alsa-devel mailing list