Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp71042lqc; Thu, 29 Feb 2024 10:33:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXML1VAxvH9D6eoFC1xlStn00hk582qlnbQsXzO1xswBocvUiX8nzFLi9qGW61Lba3vtftVtoJhTu36XX5ES+iaBQeJssP9p/UwIhZRGw== X-Google-Smtp-Source: AGHT+IFQvouYMAMoe8HlR5oJHNFJrOTsrE5yV9sXoidDQZyxMUoLArhb8HVKeNySvSSMKmSt9aDp X-Received: by 2002:a17:902:d4cc:b0:1d8:ee44:629d with SMTP id o12-20020a170902d4cc00b001d8ee44629dmr3667669plg.30.1709231602889; Thu, 29 Feb 2024 10:33:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709231602; cv=pass; d=google.com; s=arc-20160816; b=f/1ZwFnPE2gH5f/8bqEn0jOYrhYV/USt4crcIhzmB76r4IoGjMcrlOXPfDaCZBr3tk kZFeg/EUEuNzRR0DktGYs4/MEsw99uRbWCjJG69KmMVapy6I8b4kUHWeAPhrZRkdpLOD aEBOULWDg8ckcr5o2ishyW2+6sMZeStG3DOcNrLc1vlHaxhH7zm88MRMiXRTSgoL8/Lu MnRfiGnBFXGsOtP3Bi05CSAvthzgXCSivfQ5atSxVXpzHE6a5yUmF8AqdDMqbw4IDiRD udcbv4Ay+POyl7lDEofgrsV7ZppCuHnYZ9Br2LDyP2Prr8N9WvYhOKngGcie1gHH42sG dKYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d0x4aOlew+ChlnlW593MwGC8/uLA2yAII6jDpil+AZo=; fh=gYSPCcCfyNR0CACHgUzTlUZ4f7nijuOJrcgMqLCe5Iw=; b=CitRkcTVqTMZ6pSJ3Zl/RM+YpLXnJCwuQX3J+uuzSX2QyyBP+gPXZluv08QTuTL/gA jH6SFwwXvXa4cRyu9jkyP1EmAbi8xnX0y7alHmiZRZ490PB438eS1w+RKL3sfkRRUAYU fD23aqhyEQxFqgLV1oVZMZGOw4oHUTtWs1gj8mikP8EM3hkY6eoNcj70nNuZV2BIpUZR c2ddwKx6SrMaeqrPyd0Z8ODnUbgtlWijhEib4wWfUXbkvFsvcVywx5sRu9tfUhBBi1hE suMQpyXusyWwonsDxzOh+Y92gNGVFzCY8xBnyCsI0bi65wItgMN9/VLtYGW8YZKotVI5 cbHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=B9KciT6Z; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-87274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m13-20020a170902db0d00b001dc742a30bdsi1837854plx.386.2024.02.29.10.33.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:33:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=B9KciT6Z; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-87274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 41F8DB25383 for ; Thu, 29 Feb 2024 18:22:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BFB012F5AC; Thu, 29 Feb 2024 18:22:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="B9KciT6Z" Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18FC47A144 for ; Thu, 29 Feb 2024 18:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230937; cv=none; b=YaYdmkWtvXclinYqtvl0unVqDnYuE1xKWAe53ltXQaFEF1b7cmRZlTmPRM3LYdZ1HRYsIMv57co8QuzzWKZ+r2SMB/8OsxfRb2HUQFM1mSUMaY0zfUlF65XHesqjgJOm7n+plW5FhDrflUmirDxlAmjNdiAbGKjzy211QwcX954= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230937; c=relaxed/simple; bh=fDc9Uwhm++z7zUnn73jE8m6PTGMIZXn9lNaCfrSaFKw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O0wabmRw9vb5vjgPqhvwXdn/lJgc6CXdl51LL5XsMoY2CqxJXDDtnDUoBW1sbHQwm7oc2nKhOT9Rtm6h5PE8LtCNuuhiSR3X5TE0UCIOMj+LgWsKkHwsgRwdIXsvKTUCf23x5TUu6bLnfGoNBF+Lk6ZPMdK5XjbJMnflAokb4sM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=B9KciT6Z; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1dc9222b337so13176175ad.2 for ; Thu, 29 Feb 2024 10:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709230935; x=1709835735; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=d0x4aOlew+ChlnlW593MwGC8/uLA2yAII6jDpil+AZo=; b=B9KciT6ZaaZF4rRQhqyiILzLdNkpla2QbXXkNeuCqrChpu0qtMIaDWenDbQ8rrSIFh 9XynGDga/vimj3ueeTB3rdqIRVOjTHTM95CYqqb8qeQr22gNsndvohB4T8KofRerc6rN 48/S2kHkaGM+eNJMxTNvKpqQO0LME4EEwFUmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230935; x=1709835735; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d0x4aOlew+ChlnlW593MwGC8/uLA2yAII6jDpil+AZo=; b=rl1bT5Jp3fHBgRqGascCl9AT2ic+kpKmWvC/biPowRhiKhpbrIZbEJo3hd9vlWZohr layRjOSIjQy3Jyljjhuc48JzGfxJfW5q5K/Enjnqnn4uIX/+/eeG6uG2hyHu+/GDwU2L G0nQi3p9aTyL90Btg8bMQ9Sf3j2sHrZmGnPDRfoB6hGxBpemVvm/BXTbt64LQ2WieaYd 9UHw7F9y034r+2GkxFkRLV6B1b/wud6qIJ8RarOAM1D/R6rQGAMm1NRH7uCHoXi1iFVx ZCJyZQhw74ocesbtYqSo1NsstC5XT22wzjwyc6a31XrK6FMi8T1KESrQfU8/Gl/wQzoW irxg== X-Forwarded-Encrypted: i=1; AJvYcCW8n8LZ34GW+IEPv9dnq38saJ/oxTV311txoCmAbIUx+W0KcOMKqCpJ76SKu/DP0TY0o1wDyceX4fvV52cj/bvzGazgUR+uy4Wfo7+1 X-Gm-Message-State: AOJu0YwmqI1VMfX4JT/pU5LakuQql33fJmxcf5QsT1hjOCmfV29liywY QBEdNHXpjVl3ZGy9hCakU0z2BsoRnPUsqqrqm0crMetniP9yIu8DF8GlaVfsPA== X-Received: by 2002:a17:902:6547:b0:1db:e7a4:90a5 with SMTP id d7-20020a170902654700b001dbe7a490a5mr2736748pln.12.1709230935335; Thu, 29 Feb 2024 10:22:15 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id u5-20020a170902e5c500b001dcc158df20sm1813098plf.97.2024.02.29.10.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:22:14 -0800 (PST) Date: Thu, 29 Feb 2024 10:22:14 -0800 From: Kees Cook To: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: Brendan Higgins , David Gow , Rae Moar , Shuah Khan , Alan Maguire , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Ingo Molnar , James Morris , Luis Chamberlain , "Madhavan T . Venkataraman" , Marco Pagani , Paolo Bonzini , Sean Christopherson , Stephen Boyd , Thara Gopinath , Thomas Gleixner , Vitaly Kuznetsov , Wanpeng Li , Zahra Tarkhani , kvm@vger.kernel.org, linux-hardening@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org Subject: Re: [PATCH v1 3/8] kunit: Fix kthread reference Message-ID: <202402291022.A8E2AB8A@keescook> References: <20240229170409.365386-1-mic@digikod.net> <20240229170409.365386-4-mic@digikod.net> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240229170409.365386-4-mic@digikod.net> On Thu, Feb 29, 2024 at 06:04:04PM +0100, Micka?l Sala?n wrote: > There is a race condition when a kthread finishes after the deadline and > before the call to kthread_stop(), which may lead to use after free. > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: Shuah Khan > Signed-off-by: Micka?l Sala?n Reviewed-by: Kees Cook -- Kees Cook