Re: [PATCH 130/190] Revert "ALSA: usx2y: Fix potential NULL pointer dereference"

Greg Kroah-Hartman
2021-04-27T13:53:36Z

On Wed, Apr 21, 2021 at 06:23:19PM +0200, Takashi Iwai wrote:
> On Wed, 21 Apr 2021 15:00:05 +0200,
> Greg Kroah-Hartman wrote:
> >
> > This reverts commit a2c6433ee5a35a8de6d563f6512a26f87835ea0f.
> >
> > Commits from @umn.edu addresses have been found to be submitted in "bad
> > faith" to try to test the kernel community's ability to review "known
> > malicious" changes. The result of these submissions can be found in a
> > paper published at the 42nd IEEE Symposium on Security and Privacy
> > entitled, "Open Source Insecurity: Stealthily Introducing
> > Vulnerabilities via Hypocrite Commits" written by Qiushi Wu (University
> > of Minnesota) and Kangjie Lu (University of Minnesota).
> >
> > Because of this, all submissions from this group must be reverted from
> > the kernel tree and will need to be re-reviewed again to determine if
> > they actually are a valid fix. Until that work is complete, remove this
> > change to ensure that no problems are being introduced into the
> > codebase.
> >
> > Cc: Aditya Pakki <pakki001@umn.edu>
> > Cc: Takashi Iwai <tiwai@suse.de>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> This is same like the revert#80, the code change itself seems correct,
> but it's a pretty minor error path, probably no one would hit.
> So, feel free to revert if it's in doubt.
>
>
> thanks,
>
> Takashi
>
> > ---
> > sound/usb/usx2y/usb_stream.c | 5 -----
> > 1 file changed, 5 deletions(-)
> >
> > diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
> > index 091c071b270a..6bba17bf689a 100644
> > --- a/sound/usb/usx2y/usb_stream.c
> > +++ b/sound/usb/usx2y/usb_stream.c
> > @@ -91,12 +91,7 @@ static int init_urbs(struct usb_stream_kernel *sk, unsigned use_packsize,
> >
> > for (u = 0; u < USB_STREAM_NURBS; ++u) {
> > sk->inurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
> > - if (!sk->inurb[u])
> > - return -ENOMEM;
> > -
> > sk->outurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
> > - if (!sk->outurb[u])
> > - return -ENOMEM;

This leaks memory if the error path is hit, so I'm going to keep this
revert as it it needs to be handled properly. And really, this code
path is impossible to hit...

thanks,

greg k-h