Re: [REGRESSION] rust midir MIDI library causes kernel oops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 05 Sep 2023 01:00:11 +0200,
Ash Holland wrote:
> 
> On 04/09/2023 22:49, Takashi Iwai wrote:
> > Yes, that was a bad change.  Could you try the fix below?
> > 
> > 
> > thanks,
> > 
> > Takashi
> > 
> > -- 8< --
> > --- a/sound/core/seq/seq_memory.c
> > +++ b/sound/core/seq/seq_memory.c
> > @@ -187,8 +187,12 @@ int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char
> >   	err = expand_var_event(event, 0, len, buf, in_kernel);
> >   	if (err < 0)
> >   		return err;
> > -	if (len != newlen)
> > -		memset(buf + len, 0, newlen - len);
> > +	if (len != newlen) {
> > +		if (in_kernel)
> > +			memset(buf + len, 0, newlen - len);
> > +		else
> > +			clear_user((__force void __user *)buf + len, newlen - len);
> > +	}
> >   	return newlen;
> >   }
> >   EXPORT_SYMBOL(snd_seq_expand_var_event);
> 
> That patch seems to work fine! Many thanks.

Thanks for quick testing!  I'll submit the proper patch later.


Takashi



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux