Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp674227lqs; Tue, 5 Mar 2024 12:58:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXJOdpaa0pTngN3znHqHN/dQiyRBj8YMqr7ii2L1GqaLN5NSqOu3ZgUsdYEwB3ZoMxMChlETOyVdTPTajeL7V/1SjY9wKyO6eJrXAjfrw== X-Google-Smtp-Source: AGHT+IHEdWPbvFmA9Va8Ke8q9RFjKqzyVhixCy02d7k8gh2CLSjr2tLiP7fdatJHQZXxHWEz4OAI X-Received: by 2002:a50:c88b:0:b0:567:737f:e91f with SMTP id d11-20020a50c88b000000b00567737fe91fmr2929860edh.27.1709672281372; Tue, 05 Mar 2024 12:58:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709672281; cv=pass; d=google.com; s=arc-20160816; b=XDzHiah5fUTLhhXtqGD/8dq2dtQY7uvmNDCOMPmSeCbsJf33wFvZBT5Dhc2jjsuuuh 45/n3USWLPhUopBJBppVp48tp25BBZg/yHvaZ2ZaWDJ3xbfc0TuHS30taWwAOsiLct8F Cdy/DF3pp+LSzyBuRMeHjXh0TZVNzkTcdKcXh0EzyfC5WbTLTObSvbT1wzfiz2GXqVC0 crdyKx3LJnKqOhpEKeLQvHlhvSiH4Ys+EM0khkKKlT/HGUm9BYr/M5AgpLGVUnfCwAZe zpDlkF566s/0iE3+jHRre0+Pjv9PyNruo5KkUHVpD3PIJFgrVgA39LbK34IStTon3v3z 3krQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=DMppHw7KV/r56VUSnIREU2O979JxXuHNtcifN4Olhis=; fh=+5/kyJX2RaIw6kuKOHWyK/2psgippoukc7wnAvng8Aw=; b=AOVM399/Vvb6BE2BSg24DhMZtCrBizpw9Op/mTA4D4PGY+P4gBrQO9L6sd6UrdIyfF LssYkAnUHxLmcUOmnMqe9n5aR0Q1qQyu0WnVxRlmRRiNBmqY1gEKYtQUyB8KsamsyFgu 6TC4tw0nEqmwT2ZdkfzQUtmSiT//S8edTF765vWk6GA1DcIj0p5S7/8HgwipdRyideMW eP73iA5TF30HFWzaMHF41APIpzEJ3eVYUVivs0VXTh9qm2ERwgDrltrJPk7Nzhfw6eiE uJk9JbIHR3a3UYu/d8FUx/7vVEoeGG1qHfhkOg+4gt2s6WgvUCTVA+BOggJNBI2WtXJy 78KA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VBWqCKDG; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-92981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t16-20020a056402525000b00566c1bd22b9si4657049edd.99.2024.03.05.12.58.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 12:58:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VBWqCKDG; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-92981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1DCE61F285F4 for ; Tue, 5 Mar 2024 20:58:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99F4A12B168; Tue, 5 Mar 2024 20:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VBWqCKDG" Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 2395812AAC2 for ; Tue, 5 Mar 2024 20:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709672270; cv=none; b=ZAyoYgi5peipqeTy7ae1JsU68eSDDia8PFEewtjEPaTnC68dCsGHmvIaf1qdCeipJkqA3DmuksGm8fJO30YClcqrPYcTMSCpLrPZSGm7Pdx+CMBO4tRPV9GTNG9kNTTPOt5zKgA88H8m7RdUYs3/KafRL6bsT6/QE+G63cf6g1o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709672270; c=relaxed/simple; bh=4y2L0boXZTMV4TDb8hO8PgzieZmUzq9lbLSb3KvG8k0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ued6Omzggzwc8TW2bje3GF7L2y/tGgIiBqzqJOTioVSzgsW3TKLxEUNxSr2pOyMAqee0lJX7khKOnML/U+Cprdpbf0yDbZXxqBqg/68FhaXJWp02e5sQKZnhC396DGWO+s0VcqTfVUPFIUxLIFGjtHnpOo2YNlOefH0OcbMKw8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=VBWqCKDG; arc=none smtp.client-ip=209.85.160.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-42ef8193ae6so81791cf.1 for ; Tue, 05 Mar 2024 12:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709672268; x=1710277068; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DMppHw7KV/r56VUSnIREU2O979JxXuHNtcifN4Olhis=; b=VBWqCKDGDtqfSjtVb345vt3+W6a38qDDSmcNfrprRiqVm5KKVxFG1eaTAs9zIWM7nw XkfOxDepJJzr4XmZd2u0E14fT33iq5bTYaYJAj3YXIw3pmu04FxywWf4wDtLfOOe835A 8kzpzXszReLLvUFCmeHlZGEqYf+80F8kAuEVgvBt84uIPsSTZBAmHO6jNpzDHrfodkz5 c6WNZ/4ukxpBT5QAY192A537hKlu+uJfMgubl5uWcaSnP+OBxYno6lBa2Na//z/s/1se X7EpWXiF+JDkISNr909WYap/KO8NOmEeRwkBSjEq4MPYqu9SXDfRAV7It/+xUW8waKIf +byg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709672268; x=1710277068; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DMppHw7KV/r56VUSnIREU2O979JxXuHNtcifN4Olhis=; b=MJJT/3lzswmQtk3197xW4Lau5myd4yDQ5YH1QEvWfaOpGkjkNh8QPVQjGQ7eReAnnb 7JseL8eUtVfOicDKpN3ggjvFCxMWOWg9oZsiF6p3eTiFYTmeCYveSo/4tIUeXR1BteiZ M4vUQtTIpSlAeAA83yZk6YyvUoFqDv6fIHzoplg60lwtrGhbBidQGGWeIQvYnc1lW2ro 0/C/aMtP5eSL5OSZFWi5LsjCaVavAkezQhLCogUihbJcDQ/Y0ujS3NlX0WY+CUGGHiSs 42Q/ek93xcoFH6LyqlUczd41jZyJ1tXpsSu9WNjHc7CO3vrmt3Ku23xjgUPgYlugThiM AppQ== X-Forwarded-Encrypted: i=1; AJvYcCUGgjrLiLEOIjCBGqD6AjGtTLx0bDCeOGjfSl0QthEcWTlDiI/9sWneupTjRwPt4sCUDZ7vKsBuLIy+HVd9zT2JTZBGCdB9MDn0rE7U X-Gm-Message-State: AOJu0YzG2HHjlo6QYw2YS9CY8c/K9ftF6w6Vv+0QD2BaSzMSahqGbAov 4GNPRI2tdydk60FOH7/0Ic/vZuO1pfjZpOsr2wt0hkpqyZYA4EvkYVVoOwHHVLcwW3Tt7gHny/j Bw2BhC2CCB7XYfmzT1XgNV+7LmEhlpsV+n5JR X-Received: by 2002:a05:622a:28c:b0:42e:6de9:cd13 with SMTP id z12-20020a05622a028c00b0042e6de9cd13mr258781qtw.3.1709672267992; Tue, 05 Mar 2024 12:57:47 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240301194037.532117-1-mic@digikod.net> <20240301194037.532117-2-mic@digikod.net> In-Reply-To: <20240301194037.532117-2-mic@digikod.net> From: Rae Moar Date: Tue, 5 Mar 2024 15:57:35 -0500 Message-ID: Subject: Re: [PATCH v2 1/7] kunit: Handle thread creation error To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: Brendan Higgins , David Gow , Kees Cook , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 1, 2024 at 2:40=E2=80=AFPM Micka=C3=ABl Sala=C3=BCn wrote: > > Previously, if a thread creation failed (e.g. -ENOMEM), the function was > called (kunit_catch_run_case or kunit_catch_run_case_cleanup) without > marking the test as failed. Instead, fill try_result with the error > code returned by kthread_run(), which will mark the test as failed and > print "internal error occurred...". Hello! I have tested this and this fix looks good to me. Thanks! -Rae Reviewed-by: Rae Moar > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: Shuah Khan > Reviewed-by: Kees Cook > Signed-off-by: Micka=C3=ABl Sala=C3=BCn > Link: https://lore.kernel.org/r/20240301194037.532117-2-mic@digikod.net > --- > > Changes since v1: > * Added Kees's Reviewed-by. > --- > lib/kunit/try-catch.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c > index f7825991d576..a5cb2ef70a25 100644 > --- a/lib/kunit/try-catch.c > +++ b/lib/kunit/try-catch.c > @@ -69,6 +69,7 @@ void kunit_try_catch_run(struct kunit_try_catch *try_ca= tch, void *context) > try_catch, > "kunit_try_catch_thread"); > if (IS_ERR(task_struct)) { > + try_catch->try_result =3D PTR_ERR(task_struct); > try_catch->catch(try_catch->context); > return; > } > -- > 2.44.0 >