Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3939357yba; Mon, 29 Apr 2019 10:58:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWh0f4ej1Sn3q679qGMcD6SUQeVI3HZCtGFwTm2lcVrhMTNpxj1zRJm1MJdGOR1B32H5gH X-Received: by 2002:a63:28c8:: with SMTP id o191mr18826614pgo.164.1556560738509; Mon, 29 Apr 2019 10:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556560738; cv=none; d=google.com; s=arc-20160816; b=faovGNlufg5qgJtB/V0m/bEDMVxuiQ8kPAC55KJfubdbotG5dhTnZoWsB2fkITtYad Tah0n1bN6eew6cGBtaRwZT/Reecv1bYcHRXlcPe7qcGO+P/a0Lp4u08+5xXr5Ju9gdg/ tRS0n3OJsMzE82MFdff2Y4cQapRbegP7csoWtHHy/Jvu38mxgyHjvsraCC+O0wKwNiao TFyNMJvO8tl/Tvegk4PKcQoifu+vXGDfN/9eSyU6lMUeLjQov0JMmuy0mWHniCmnbrAn MJ+VPFTQ2hV6z8BDDBSJ6fR3GVyg2ctnib9EyqJlfJfCDNeWOgpzQphu1xWCqBloSzzd BJRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=xrZo07gcaWjUn4uP2zYlKFRQJ/BLbAWzHBXvEZ1CNRw=; b=XN1EXmhqwiz0LLsZZSwcN+4XiUGyBsla3tWTnDGCfG68suBS0s9qQX874Rsht7LdiQ dgz940/ejBFD7igdLjK7c6psFeXUSb1wpPB2kHT5W1uyN/v3mLzW5aasM1e9q7sDuujv 2jrzVQL0PnuMJ5tikk/o/vhOZ42QByHKjIp20Hqot5DQHkiXtrQHeIhMTt7rzVC90nTy mOYz9ifVnrw7Bgtp2ywUeV4w3ShprHKSwDjHTpQWcqHHA4LoQ9WGbaNjd0kdOKjUvzy2 r4ff+MecfKgawIP5CD7DWzFuDxmxQlf1UfeenkGZb9QGzCoZafDnETEWh0xhTHBEvcgn SObA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23si33449415pll.21.2019.04.29.10.58.42; Mon, 29 Apr 2019 10:58:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728970AbfD2R5O (ORCPT + 99 others); Mon, 29 Apr 2019 13:57:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:34988 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728844AbfD2R5M (ORCPT ); Mon, 29 Apr 2019 13:57:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 06C0DACD4; Mon, 29 Apr 2019 17:57:10 +0000 (UTC) Date: Mon, 29 Apr 2019 19:57:10 +0200 Message-ID: From: Takashi Iwai To: "Wenwen Wang" Cc: "moderated list:SOUND" , "Kees Cook" , "Jaroslav Kysela" , "open list" Subject: Re: [PATCH v2] ALSA: usx2y: fix a double free bug In-Reply-To: <1556559941-26684-1-git-send-email-wang6495@umn.edu> References: <1556559941-26684-1-git-send-email-wang6495@umn.edu> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 Apr 2019 19:45:40 +0200, Wenwen Wang wrote: > > In usX2Y_In04_init(), a new urb is firstly created through usb_alloc_urb() > and saved to 'usX2Y->In04urb'. Then, a buffer is allocated through > kmalloc() and saved to 'usX2Y->In04Buf'. If the allocation of the buffer > fails, the error code ENOMEM is returned after usb_free_urb(), which frees > the created urb. However, the urb is actually freed at card->private_free > callback, i.e., snd_usX2Y_card_private_free(). So the free operation here > leads to a double free bug. > > To fix the above issue, simply remove usb_free_urb(). > > Signed-off-by: Wenwen Wang Applied now. Thanks. Takashi