Message ID | CO1PR17MB54194226DA08BFC9EBD8C163E1172@CO1PR17MB5419.namprd17.prod.outlook.com (mailing list archive) |
---|---|
State | Accepted |
Commit | a2cf936ebef291ef7395172b9e2f624779fb6dc0 |
Headers | show
Received: from mx0b-0068d901.pphosted.com (mx0b-0068d901.pphosted.com [205.220.180.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A6ED14A4F7; Thu, 25 Apr 2024 15:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.180.35 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714058429; cv=fail; b=IcuEhu5Yh5yFipyztflAC2MInnTkzbMVRmfelCQspd/v2zBHbDih1IJex7H4nTER88m8uaHXlvsdNI5n+Q8I+JD4iGOkkaLy/GOdffHqc7/NfFL48nj+IeWTu/3bIgvEWBulqg0A1n01sm4B7cR1sTgzyx8ZTOokygqj8dnqtCI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714058429; c=relaxed/simple; bh=ZYvtXtFcoyYuG5vaf03NKUV4CTB3bBJQjdoztJhTW4c=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=AbEP2LbzmRr+/K3xg4VqwVSZKu2s7wG5lW9fJZgJSm+P+geW26HSsyKOF1wrp/0iXhtzNdGRnveEnGFCFUZReCPCxoJUEXDsAxvADKKKsyonghxNjyCsLa4lHwvVQFj6GwDsDXp8wFNbIsE4Anjj2gY1XnEgXNfvYoco7e7vQLE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=biamp.com; spf=pass smtp.mailfrom=biamp.com; dkim=pass (2048-bit key) header.d=biamp.com header.i=@biamp.com header.b=hwYIhKSB; dkim=pass (2048-bit key) header.d=biamp.com header.i=@biamp.com header.b=RH3k+0V6; arc=fail smtp.client-ip=205.220.180.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=biamp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=biamp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=biamp.com header.i=@biamp.com header.b="hwYIhKSB"; dkim=pass (2048-bit key) header.d=biamp.com header.i=@biamp.com header.b="RH3k+0V6" Received: from pps.filterd (m0278265.ppops.net [127.0.0.1]) by mx0b-0068d901.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43PAM66H014918; Thu, 25 Apr 2024 08:20:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=biamp.com; h= from:to:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=proofpoint; bh=r0YmCo HuuGhPZnKctsdMDTTjBPqMJ3audmps9lye55M=; b=hwYIhKSBDVTXDWsbrwJsHC kWH9R9/lmOhWUGl5FrKWymnxERu0PGBR7UdwqKpe3yqOnAEtWywoXdIRtWtzoK2M 2LbyrT7+I0OKY35pvKTvmEodE7GWpkBbC3zQsOs1+qRlse4/scFLEmlH5g9+CeYl 0Y4iHnun9GP+tB0vgmGmOT4RItfiY8QrozrJO+H8IRHywMHhZnd7zk4p1wE+RzFX NAOorrHlFnI2u6XKdW3JZ0MFf4oTrOdJSatHfS0BDpQk4B0gNqhbH8hec1dcPsD3 GhF3JdOR+3yrzPA6ZPQqEaa46fhm385cVo90cf7+rdaUVqbn9j0G9cqPrrWZUKtA == Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2040.outbound.protection.outlook.com [104.47.51.40]) by mx0b-0068d901.pphosted.com (PPS) with ESMTPS id 3xmadvkx9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Apr 2024 08:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZkokwLXiQa1Q5SqAHRdgNSV3BoPRZB01joBmBOq+wjNmWyon/ocH5I1ac7QvVGEqBnzn+ooioX9gXdeFjtB9nQnyGpy35LpJqT2e/l6Y//0HlcAGszWM2wAQ5Fckyj0vVfTXZcSmj9fInX+HqmLRh+qsRwzCCCge17Aws5eDhehatD87fmcVpjSs6EKy+82f25OoQhzU6JCMqwlEyM2LGDbPrmpfDATlnGnw6n2+KTKNoomlbWfK87OJTqVzx+cvSlas4sUPuqQ7c3TxP36yMP9bNaFA/T4hIsR2r9A374YaW3cLsrm86Wku6v9k2sS/jBeBRy+rEXnEAErIS7rcgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r0YmCoHuuGhPZnKctsdMDTTjBPqMJ3audmps9lye55M=; b=J6tXAxrd1u4fm2+mur6XRGUp96yQ4pNcMjJ/xlt8d5PYR5JLaClj3YUt1uu9rN0T28XnLNKVO6Foap3XFG0I0PyHPakkxTucr76lZqktl/OYmwu/XbVUi6Q7uY0jxG+e+XZXclETTc708B+cN5tAkkFEXWS7WMliln0lsZCOi4p7QfdTmvaREQ3GkgeaQ4rJLpi9t7mQeFTh1ibEpEr4Xyph+z5bfmGLSc3v4RGTAL3ZTVfjRySmc7kVB+I9Sxq5HLTuJI3whqB56VkYdj0qw1WmkPFYSJZ65GXxyBoG+vLYwkmDnKpzxmks6GV2M1/wwVRdaRvW6AcxfQP1xj2Q6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=biamp.com; dmarc=pass action=none header.from=biamp.com; dkim=pass header.d=biamp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=biamp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r0YmCoHuuGhPZnKctsdMDTTjBPqMJ3audmps9lye55M=; b=RH3k+0V6vJZoOAcibeEOBHynzBDLvZSpG7BAyR4GMSQt2rnG31dOhODve2x3mpSZ8XC3rBYGnDsV+VlagXRRbKD0io/6rK2Q4yB1GlC7LTgFeW2diOUSPjYnNv44uSF6/hfx5k1GMiXpj9R4vDhOQuyLx1/+P9q2JdsOUaPiS4NsN9Yh/rSYoN9IoU1F0dWS4XR4OiVrjZ8v1Eb3aQPenLMULZUJVcepKEaJbnRLjQ8TlKNJOrLR/Ujy7PW+0OClKWLMLqXrm1o45tb58cIL/++KfefAksJ13iEVdabQfHOajTFi0qaLdL2seGMha6GYEFEBuc5Wm//4zgzelfgZCA== Received: from CO1PR17MB5419.namprd17.prod.outlook.com (2603:10b6:303:ec::17) by CH2PR17MB3720.namprd17.prod.outlook.com (2603:10b6:610:8c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Thu, 25 Apr 2024 15:20:20 +0000 Received: from CO1PR17MB5419.namprd17.prod.outlook.com ([fe80::f48:ee61:a81b:d555]) by CO1PR17MB5419.namprd17.prod.outlook.com ([fe80::f48:ee61:a81b:d555%4]) with mapi id 15.20.7519.021; Thu, 25 Apr 2024 15:20:20 +0000 From: Chris Wulff <Chris.Wulff@biamp.com> To: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Felipe Balbi <felipe.balbi@linux.intel.com>, Ruslan Bilovol <ruslan.bilovol@gmail.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "stable@vger.kernel.org" <stable@vger.kernel.org>, Chris Wulff <chris.wulff@biamp.com> Subject: [PATCH] usb: gadget: u_audio: Clear uac pointer when freed. Thread-Topic: [PATCH] usb: gadget: u_audio: Clear uac pointer when freed. Thread-Index: AQHalyPM5H/A1wf4GEWGdCTKp7qtuQ== Date: Thu, 25 Apr 2024 15:20:20 +0000 Message-ID: <CO1PR17MB54194226DA08BFC9EBD8C163E1172@CO1PR17MB5419.namprd17.prod.outlook.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR17MB5419:EE_|CH2PR17MB3720:EE_ x-ms-office365-filtering-correlation-id: c88b3a16-516d-4542-fd1b-08dc653b38b9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: =?iso-8859-1?q?Bu1Nf/ChWamIpcuiYId1xTLzOU?= =?iso-8859-1?q?+rZm/nDMLes6R6nTyFtd9mvVflHs83Say93j4j+0dXX47UNEda8qZX2w8GRr?= =?iso-8859-1?q?MqKrQc8jxYU5hkHdyyNpEax02ahEY2ngT3+oxr2DJl8BMdTSZvcGE3BSblpR?= =?iso-8859-1?q?dtCUsbD/kEjASNUkd5IPr9XqYq5pQBG5VzKN///rN91VigFIKprQxsZSJUq/?= =?iso-8859-1?q?5S8WE+pGdZ/VaHObIAC7ADxWl2jYC5SUVwWglw8+WatDRWQPSbbBVoheYrz1?= =?iso-8859-1?q?m6hxH1UyhuAVhnGGRUwh0DFf7u6wDl36uwbL3r0bh926DI29VJ5GCQMDbPdK?= =?iso-8859-1?q?gKDCah7/IPv0+3b5/YT+EpkH7gJ2SPhqs3wlu3kUH3EcVrBTuAotYj+ObFSm?= =?iso-8859-1?q?SdIjlwdE3OCNX3WjxLy0NMJN9oUnP5IsWtdpMwNsawyHoiNZ6UvTxGJ4p5ii?= =?iso-8859-1?q?RcKsl/S4g/7lKd492ffSvBijHc0xGvybac6Fb5YBsj40bmQl7pKDtDEUThhg?= =?iso-8859-1?q?A4k+dfLXL2hjl9hTcFV6Ew596Pu7MAE3rDax8hGKgNywi1PAq/h+ebJ864+y?= =?iso-8859-1?q?/rGNXs8t2Gwc0PdN3t4MTJghmgWkRTotD791UX+PEsfyXdxb8jlhXemW7SJ1?= =?iso-8859-1?q?+k6Hu8EfkkrAM5nv6fZpH2aY8hge6jdhwvzxLu7Bh1zCZ0ow5Mhwk+YO2rvH?= =?iso-8859-1?q?QTcRPWecN+NwcXOFbP5JZKkOyRqVtw5Ht34HgyOKYgz32rX3O5dS1sWhQRWB?= =?iso-8859-1?q?T0UTaN2lJNzuJb8Kr7b9BpWwOKWqFN3v7U7Rr8wPoR1/nnHmolkAhNb3o7jS?= =?iso-8859-1?q?7gLm9rMoCAGAzNX75Coztz5CRcw3L/fT2by3Y4HEr3VBDada6maKMgXGE7OU?= =?iso-8859-1?q?QPL4Z9kN+aUvt7y1pvsUoYrz88PcIUL4I7qN1/uk3IWk8LdQ4IIyfJ90dG1k?= =?iso-8859-1?q?9LLTNAb+PEkfG9kaJKWwVKuUItC5FnvAWal/CnxWvSP52LTA1OI/vezhX04g?= =?iso-8859-1?q?WQm/B1Ds82SpkcgxjGFXYEmuaduAEVnvEwth9Z1TwICsm8VkyCH9Gv+IdTzm?= =?iso-8859-1?q?OJZwnZKajumKclTyPoRwo1wYpGF1JwxW57+bluNjPywCcIwOMXBnYLED8DLW?= =?iso-8859-1?q?atHUYF3ukdBy7qWBq54ePsIKJZdiej9w5RdaQ5YJN42XLRTB2XBKxbBtGgtu?= =?iso-8859-1?q?8r0mjYhbJPbxIU/cMfJix5977pGoT85MNZaWd/SiijPl6HrSZ/P9FlpTwbGb?= =?iso-8859-1?q?tzbW4GUgAMZaEETQQPkVp4kI1iCjO54m/IYrFkwJkqnNRfdBHQgJmsnOeWuY?= =?iso-8859-1?q?UltkIu/HJcdZAPeqfuSeGZR35/LB281r9E7Y3L0akt/2bH3+N7VfrmQoOtcS?= =?iso-8859-1?q?+W3ye8Qi1WQdySP4O4OA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR17MB5419.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?ADRoXxC/8WWJoeFHX6Gs8Ih?= =?iso-8859-1?q?qkBCMxkC+0v8GNXK5zpukSPSsi9u9jq8RnrHDCQdoEaZYIFIEEl8iMPQB1MJ?= =?iso-8859-1?q?OsjwcGJKhcRIqC6y6bCXoJfMFt+neLRLTpH1c/DpV1qipayAbikx+8BjG19s?= =?iso-8859-1?q?KEqXmv7KIyy+fGZuGWjPX8ZwptrsfH7M5lfdb97t+BsyUSklEEszkwNCcwby?= =?iso-8859-1?q?nczan5D3bOy4+DUc+iL2E086aqG0PBAikSy/stwyuNREUI5PSizAxwsScY2m?= =?iso-8859-1?q?QmLwkO8SXs/MOXgZbc5j+gmTK3AIxgA86Ij5vbpk6S5Ykri1DkZYlDiBHl2r?= =?iso-8859-1?q?Ey7UQaObL8489FQZgdzjSsFFKJAFUi3oJobr3uOXvPk627a27yuCuRyhuS2T?= =?iso-8859-1?q?bRzrIpHB2Fe/tmSoNo3IahA4A03ugUpB/o1AM+YKLhEYhqcAWLQdF/bIVIC9?= =?iso-8859-1?q?0zC7ec+WJyr8fgqlvD3sObSplutJ8dz3i2HDJBekAgFhCer4lwDdsgiLhUkL?= =?iso-8859-1?q?pR4l8oa/j3IfRYdhWS5ybG3JSoZL9gmpH1+j7KBC74AIuQFkqJvTQhvf41t3?= =?iso-8859-1?q?i9+nCA6t+1I0bhygitErqHEibYlRYgOjFtqDeyOG78BN+2tWZjCFjU4d+6Oq?= =?iso-8859-1?q?3JBilOn84P7uPJgoKe6bFQLSL7cqAzqFRF8/i1ysUJSOLBUc1zBgLCk1O9fN?= =?iso-8859-1?q?Mtk2ZXrcaohoNQylkpLCA81hSgYzs5G98rL+R10lqMMw9iWWF+UR6cU7i5Ee?= =?iso-8859-1?q?JuS4Ee79+P9HlAaq1hB8iXWibTEORDsoeHNtk1xQNpazh3pHdy8/RFTZQ+2A?= =?iso-8859-1?q?BJtr2te7OSm6tQ9PNNKeh4UwAqnBKhEY6dHds5PW3HA2tPpCpiCdLkv5RLmi?= =?iso-8859-1?q?CdPFjeajMDXgdbhCpN7dElOUMD+AKifLkIN8Eiz66DMhbdlw7A4NbTP/+JVT?= =?iso-8859-1?q?zd2m1ijNAnvaRwDzVYQAMiQbt0K+kWncMY6AYtq8cfs/PXNmL34xXyawXJYs?= =?iso-8859-1?q?K7IWLsiqUxabnz9MX+CPLIubxxoBv3/U080iqQEFjWc6qzH4i/LGKuwOrggE?= =?iso-8859-1?q?honFgPTLZ4iTdEmUqD5hLPKZYehlTYKlZEkD2U/Fe33hp2N1JgCfrvjyOooy?= =?iso-8859-1?q?EjwHkm7SizsvssTwG9B7Ncx3bt6r2plKq29a/U9ubQw8kICzjcxLdQFwQx3g?= =?iso-8859-1?q?cFfeNamM5H46gF6Pee1EB1aw9h72ogjdOo7nzDGFPzdw1bprk3NkDxyGvU4N?= =?iso-8859-1?q?0vnjORyeo58VELWFpzohP29SKtRtfPpS6NhaLLPTpyajC52Hyx9YbsU0ZFAl?= =?iso-8859-1?q?x3x5FmvvOtSrOabALpESsHw5tb8+h+oWOMa8t5kda/8jzFqEq86JASsXYjcN?= =?iso-8859-1?q?9UORfXZkWrBHC2CNN6qW/h92Da/xWzHTjDRdv4w6az9INFB2fFOjDMhxF8qs?= =?iso-8859-1?q?xfAQVf7UFg6Q9c4ZRjAtRA+2DYb2HvWx0URBJEzb28XRqnWuEW6cppj7YJ5k?= =?iso-8859-1?q?cLkFSYd9+uj43yhgULvKZDb+ubmOE+q9P8BQvDfeCxm5WRreggqDIIuy2Xz1?= =?iso-8859-1?q?DXqD/X6PRHoItWoftFPLvkMyKl/tPtYJ1dPyYR+220EOIyjv4N6UkDZvYaFo?= =?iso-8859-1?q?939Q47brWo+u7UB3f?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: <linux-usb.vger.kernel.org> List-Subscribe: <mailto:linux-usb+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-usb+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-OriginatorOrg: biamp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR17MB5419.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c88b3a16-516d-4542-fd1b-08dc653b38b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2024 15:20:20.8365 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 341ac572-066c-46f6-bf06-b2d0c7ddf1be X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tC4sEKKcmxJ6ii7o6bsfem34YwF2R3gs7/7jJAudFj4KeH85aGtkFnUO4PzobOwOXxSxfeZ/lk+WDISxCuxM+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR17MB3720 X-Proofpoint-GUID: WhSVEohAI6JcmigTAqlJxu9d43nvbWM6 X-Proofpoint-ORIG-GUID: WhSVEohAI6JcmigTAqlJxu9d43nvbWM6 |
Series |
usb: gadget: u_audio: Clear uac pointer when freed.
|
expand
|
diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c index c8e8154c59f5..ec1dceb08729 100644 --- a/drivers/usb/gadget/function/u_audio.c +++ b/drivers/usb/gadget/function/u_audio.c @@ -1419,6 +1419,8 @@ void g_audio_cleanup(struct g_audio *g_audio) return; uac = g_audio->uac; + g_audio->uac = NULL; + card = uac->card; if (card) snd_card_free_when_closed(card);
This prevents use of a stale pointer if functions are called after g_cleanup that shouldn't be. This doesn't fix any races, but converts a possibly silent kernel memory corruption into an obvious NULL pointer dereference report. Fixes: eb9fecb9e69b ("usb: gadget: f_uac2: split out audio core") Signed-off-by: Chris Wulff <chris.wulff@biamp.com> --- v1: Split from https://lore.kernel.org/linux-usb/CO1PR17MB54190B898057616EEB3F9E51E10E2@CO1PR17MB5419.namprd17.prod.outlook.com/ drivers/usb/gadget/function/u_audio.c | 2 ++ 1 file changed, 2 insertions(+)