Re: [PATCH 080/190] Revert "ALSA: usx2y: fix a double free bug"

Takashi Iwai
2021-04-21T16:13:43Z

On Wed, 21 Apr 2021 14:59:15 +0200,
Greg Kroah-Hartman wrote:
>
> This reverts commit cbb88db76a1536e02e93e5bd37ebbfbb6c4043a9.
>
> 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: Wenwen Wang <wang6495@umn.edu>
> Cc: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

I examined the change again, and confirmed that this code change
itself is correct, so it's not necessary to revert.

OTOH, it's just a tip of iceberg in this driver, and maybe it's better
to cover all in a better way. So it's fine to revert this, either.

thanks,

Takashi

> ---
> sound/usb/usx2y/usbusx2y.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
> index 3cd28d24f0a7..bb188245b0e2 100644
> --- a/sound/usb/usx2y/usbusx2y.c
> +++ b/sound/usb/usx2y/usbusx2y.c
> @@ -279,8 +279,10 @@ int usX2Y_In04_init(struct usX2Ydev *usX2Y)
> if (! (usX2Y->In04urb = usb_alloc_urb(0, GFP_KERNEL)))
> return -ENOMEM;
>
> - if (! (usX2Y->In04Buf = kmalloc(21, GFP_KERNEL)))
> + if (! (usX2Y->In04Buf = kmalloc(21, GFP_KERNEL))) {
> + usb_free_urb(usX2Y->In04urb);
> return -ENOMEM;
> + }
>
> init_waitqueue_head(&usX2Y->In04WaitQueue);
> usb_fill_int_urb(usX2Y->In04urb, usX2Y->dev, usb_rcvintpipe(usX2Y->dev, 0x4),
> --
> 2.31.1
>