From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0029E3451B3 for ; Fri, 27 Feb 2026 18:33:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772217206; cv=none; b=lENhkrW3uLSJKoAlFXUnuDSY6LlaNG8tpMRh7C8fiMp+udgHXojlTxKTdGj+EqSDZwbWl/2h8FG7yGpcd4I4wMSLPlvfw04lHEJO3xcdYVHtrAu4bqZHQ+TR1lg6EiAtjrqh908v+67jUYZS3wPQhsFXzjLCz2XDeYDkN95VQy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772217206; c=relaxed/simple; bh=Ct/G5Q6wnapxX+yOw+Dgb0suO4LB3ExYpPTErIAl9L0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MS9B/XSVnAp8yTkBHyssoBF2OPmS4je4XBipU8hZdkZ++IB8Z4VZ/D+J2bCCILxAOPr+CJFreR3ncS77viexM4hUfu+YJ4sP4BFA8bm96nrFaKxV6K6GyDI5kc6G/1EbCAtQWlQItzXe3hnIlv+CP8HCal5fAIaPvluwJU3j2tE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AgdX/NVe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AgdX/NVe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 775A4C116C6; Fri, 27 Feb 2026 18:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772217205; bh=Ct/G5Q6wnapxX+yOw+Dgb0suO4LB3ExYpPTErIAl9L0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AgdX/NVecpNEIJobBPPjo2Ou1B0B5TodKODgCtLbzY5XGiIkVUFGo3+vcmieNdlMy rvMyOcTnB0QH3npAv5S5UgNVImD8mNfC+TwbaYjUeTXwtFwOhiT5bkZaMFabzt7Jfl HprqHdwukGjxhmjzW6DrXpvGE4uz/40GIyvzpDY2ZBwNmpjjPvmldzGQslibn3GyNU w3KRHM3Z+nmcL8m+yuJPlxvQt4iWW/b3VyUHDDMuGnWGBkOATQY25Ekb18zME02bW6 BZJc2eklqrXtdeEJ9Yo5aKUS3zmfCrSTjNfIf6GY35LgP275rdFI3oGV1h+PkxYF7h TSJe0I3kJfbmQ== Date: Fri, 27 Feb 2026 08:33:24 -1000 From: Tejun Heo To: David Carlier Cc: David Vernet , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] sched_ext: Fix TOCTOU on p->scx.dsq in scx_dump_task() Message-ID: References: <20260226052640.7191-1-devnexen@gmail.com> <20260226052640.7191-2-devnexen@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260226052640.7191-2-devnexen@gmail.com> On Thu, Feb 26, 2026 at 05:26:40AM +0000, David Carlier wrote: > p->scx.dsq is checked for NULL then dereferenced without > synchronization. Another CPU can NULL the pointer between the check > and the use. Use READ_ONCE() to capture the pointer into a local > variable before dereferencing. Aren't we holding rq lock for the task? David, are these patches AI generated? I'm not against AI generated patches but a human gotta verify it end-to-end. Thanks. -- tejun