Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4287162pxb; Sat, 5 Feb 2022 08:51:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwg7cKZ5tgg4kLl4Kd0uetEhasJClb2T4rJXA2eVWhiL2xMNhm4WWJbZ+rc0z9zk3nX+rSW X-Received: by 2002:a62:7c42:: with SMTP id x63mr8558068pfc.31.1644079877245; Sat, 05 Feb 2022 08:51:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644079877; cv=none; d=google.com; s=arc-20160816; b=y41ylYbxWbRD2tnET52aMk3cNB6/NN1vydNlqmVO4OaOEUiKabXvMyiswB57lS4ptD 87VhpCpQKvo/0WCzp+d5cEFW18t5Yv9nCtbYTh6Fo98fppeKVrxbODsCMh/0s/qDDdCP X63Yp4osg5jYG3RR6d0DE/DhK9KciQZ4BvOWskiQePR1pEqwvOuUPKLt9m4l/lk3J7JV 5+9Zhmno2ulb9V8qDsceYuAPvKI5mDA2Pkm6M0qCeKghjNY0cCW5QKhhN2YzaGE3+DBN b7SXA3JWHtH2UW1rOHlXcBXSvtZKQ4c+WftKDu1kcpKG26lgrpQW0aD18Sq/XW/RP4wB QfpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7eKBpRVeqw7of+gFXXmg+fF0K/LvquTYmEpvmBnw8mU=; b=G7K3jgunr0aRT8yY9EDFyWcngWkHvT3pTsUtdfzhJzK9RHEzdeWFsPh2//M+yAhgrX 10O6nHUTfwx58r0LNcFFpchKYL97pJbYA7LxNuXrvkf+oV7gW+JK4mjqDcGJ/aOCggf0 7O911G1F8+Wbn0fAjCicw/Q5s8ZyXc0QHnxpZd032hxP2U7yQn9ZzgUY4rXzL9OSMH75 G3mUjEmYHAhllohX1jC+V5lDCtpM0HfEKBOIdOUy6eCBhHJsA2VvHmQi2GMGAGRHm2Bg QXEGKIRySxz9s7xFspN98V4CqUlBsyCRz7I6qbAyUqXvuAFsf5YaLyNt6X/P2OkGY4oq eJXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t32si5790193pfg.98.2022.02.05.08.51.02; Sat, 05 Feb 2022 08:51:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245172AbiBCUq4 (ORCPT + 99 others); Thu, 3 Feb 2022 15:46:56 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:52126 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354785AbiBCUpU (ORCPT ); Thu, 3 Feb 2022 15:45:20 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id B59FD1C0B79; Thu, 3 Feb 2022 21:45:18 +0100 (CET) Date: Thu, 3 Feb 2022 21:45:18 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, syzbot+5ca851459ed04c778d1d@syzkaller.appspotmail.com, Ziyang Xuan , Oliver Hartkopp Subject: Re: [PATCH 4.14 2/2] can: bcm: fix UAF of bcm op Message-ID: <20220203204518.GA18824@duo.ucw.cz> References: <20220127180256.764665162@linuxfoundation.org> <20220127180256.840826051@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <20220127180256.840826051@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Ziyang Xuan >=20 > Stopping tasklet and hrtimer rely on the active state of tasklet and > hrtimer sequentially in bcm_remove_op(), the op object will be freed > if they are all unactive. Assume the hrtimer timeout is short, the > hrtimer cb has been excuted after tasklet conditional judgment which > must be false after last round tasklet_kill() and before condition > hrtimer_active(), it is false when execute to hrtimer_active(). Bug > is triggerd, because the stopping action is end and the op object > will be freed, but the tasklet is scheduled. The resources of the op > object will occur UAF bug. >=20 > Move hrtimer_cancel() behind tasklet_kill() and switch 'while () {...}' > to 'do {...} while ()' to fix the op UAF problem. I don't see this commit in mainline or next kernels. What is going on here? Is it one of those "only needed in -stable" things? Or do we still need to fix it in the mainline? Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYfw+3gAKCRAw5/Bqldv6 8uKwAJ0UfJMChXRoN1yhcxHknUTIq0A2DQCfT0NdPdj4mxrex8j1U/PlZy106Og= =ijM2 -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR--