Re: [PATCH 2/2] ASoC: SOF: sof-client-probes: cleanup tokenize_input()

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

 



On Wed, Jul 06, 2022 at 12:27:49PM +0300, Péter Ujfalusi wrote:
> 
> 
> On 06/07/2022 10:25, Dan Carpenter wrote:
> > The tokenize_input() function is cleaner if it uses strndup_user()
> > instead of simple_write_to_buffer().  The way it's written now, if
> > *ppos is non-zero then it returns -EIO but normally we would return
> > 0 in that case.  It's easier to handle that in the callers.
> 
> This patch breaks the probe point settings:
> 
> # echo 52,1,0 > /sys/kernel/debug/sof/probe_points
> -bash: echo: write error: Invalid argument
> 
> I did not looked for the exact reason, but something is not correct.
> 

Crud...

Thanks for testing.

I used strndup_user() in a couple other patches today and I didn't
realize how strict it was.  I've NAKed my patches which used
strndup_user().  One of the patches was an infoleak patch so I'm going
to resend that using memdup_user() instead but let's just drop this one.

I guess another safer option would be to just always zero the buffers
going into simple_write_to_buffer()...

regards,
dan carpenter




[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