Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp528142lqg; Fri, 1 Mar 2024 12:23:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXcLjcL6kNDeUssoyAeEu/QttaKxqQwbReOfr2SE2+HyHph49pDfSPPxnEro0offgyW8SkWi2xmrYbmODS6wSOL0hNiuIGNuvucPxEaMg== X-Google-Smtp-Source: AGHT+IEjPlzaI7SR6DDz7xelgvq+DHFzBKJCYIjdrNsowIkwGopgh9+dPNtjGY8Ebx2ipj72gIs2 X-Received: by 2002:a17:902:7c96:b0:1dc:a60f:4bf0 with SMTP id y22-20020a1709027c9600b001dca60f4bf0mr2300657pll.42.1709324589051; Fri, 01 Mar 2024 12:23:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709324589; cv=pass; d=google.com; s=arc-20160816; b=I8pC2RWGQlLsO3rJ7zFeifSPwxIuOROZlQQi5IE51cY3dr1hKIHASNoZEuZou7F3Kz t405MwAeuXSczlLb8yBeXgW8Z0WMVENa83k7nnMnyXywgxPc39OrCErAtCB0UmkQ9/6n F/ZzG2ZG/JjatP8ejpXUvzuq5NJJEIL0ZZ9MtuVb0htbqjn66Z3H8T7U2m55Ie19BMfC F3CYliVzAfKDWywCoWYm9B9dnPJhrmSusqstiOR2hJybzUt32sRjPXoHCvMPT51H6X2R P64V6rB7k0c/nFHK8L2A7GHfhX9amZcRwjfG2z4nRJMs9iCdKieu25EnF1S2dkPtFiN/ jATw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=aHlsqS+r2zHvt2nrY27JAGMMOJGL5E/nzaw8d+fXqiw=; fh=MR/wbEn34JHmT+rtzWNq5RVU/RKi8DhjSvb3ywiuLkE=; b=vcaTzsJtG3gyWxt8RBkAxCme7fZAHURIfpeiBc+TzLuT0cctqNzrSHIbMePjvpXRS6 ZWDirqOl12GE+TOCXte77CLUy/JVwp+pby3GxZ17bZWZNRqW4IuuK0161pldB96kv1uf pSFZKyt5dYfev6yq/sUZ02rylnOsLItjgLPkdmT2u5tBO9Byf6/EyZ5YnG0E/Tp+P9Rb hWaQWZtxYwLJ7yWiKpmCvWuN37a9qvFVuW+aOsbWhISz1Qw/zgxV+8aIsDE2YyzDwOA5 klphXE7auBpQ7E8EL09hK2+PFqy1ScBCm76BEvtgAHZmE/7BD37sKUygyQiIsGUOjXM/ D+SQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=OSrVYlnh; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-89038-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89038-linux.lists.archive=gmail.com@vger.kernel.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 u23-20020a170902a61700b001d8a94d10d9si3972927plq.448.2024.03.01.12.23.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 12:23:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89038-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=@digikod.net header.s=20191114 header.b=OSrVYlnh; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-89038-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89038-linux.lists.archive=gmail.com@vger.kernel.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 310E2B29C4C for ; Fri, 1 Mar 2024 19:41:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A68333BB28; Fri, 1 Mar 2024 19:40:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="OSrVYlnh" Received: from smtp-190b.mail.infomaniak.ch (smtp-190b.mail.infomaniak.ch [185.125.25.11]) (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 AF0103A8C2 for ; Fri, 1 Mar 2024 19:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.25.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709322054; cv=none; b=o/0Uy/w+aJm1r4CagMDlUt8tyYky7Lgtah56S6CHJMWey58l146q9zNprurNcxtrs4zr8l7h+J5441/AgiPDJrjKsdcqZHrP2kVCXS3RB3+mp7ZhQ5eKT+uWJmueCdUgd92pHzegxP82dU0VQE/akfFwCEna//nm3rRT2gcyWwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709322054; c=relaxed/simple; bh=2OrWNccpx9RIERKaD1LaWkqEFkrgGuR3iwbvIXZvKD4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CkLmskzNSpwNFFB9NKRagE1WUVyaqWb2lSUZJJ+X4gc0WaHZ8ik0x1hu3DOGropmmeQnLzt2yIMZwbKq7ej5lioGWDpEcyANAJste3Nwf0yq72qHofdt6m5foVQTjNUjM7l0QJcREBzPxTVUAtcn1p0GqqPDeE5WuNFxmTY6i5k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b=OSrVYlnh; arc=none smtp.client-ip=185.125.25.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Tmdjs4TkfznjY; Fri, 1 Mar 2024 20:40:49 +0100 (CET) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4Tmdjr32Rnz3b; Fri, 1 Mar 2024 20:40:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1709322049; bh=2OrWNccpx9RIERKaD1LaWkqEFkrgGuR3iwbvIXZvKD4=; h=From:To:Cc:Subject:Date:From; b=OSrVYlnhvWxkk6XfcuTUYzkKfO5Jtwoju81YMT1NYRVqiaCeI2z+/tpHnjDdsMyJ/ lO3wu1Mf2w3OCerCjG/QoY9ouNjpOioGbIAvyPlnKE+Yha7vtzB2yRgOXpH95GuzTB 5SOB3hqc0ZR5ETY+eNpo67Mod+PwaxNqurlhLF8M= From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: Brendan Higgins , David Gow , Kees Cook , Rae Moar , Shuah Khan Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , 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: [PATCH v2 0/7] Handle faults in KUnit tests Date: Fri, 1 Mar 2024 20:40:30 +0100 Message-ID: <20240301194037.532117-1-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=UTF-8 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha Hi, This patch series teaches KUnit to handle kthread faults as errors, and it brings a few related fixes and improvements. I removed the previous patch that moved the KUnit test execution at the very end of kernel initialization. We'll address that with a separate series. A new test case check NULL pointer dereference, which wasn't possible before. This is useful to test current kernel self-protection mechanisms or future ones such as Heki: https://github.com/heki-linux Previous version: v1: https://lore.kernel.org/r/20240229170409.365386-1-mic@digikod.net Regards, Mickaël Salaün (7): kunit: Handle thread creation error kunit: Fix kthread reference kunit: Fix timeout message kunit: Handle test faults kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests kunit: Print last test location on fault kunit: Add tests for fault include/kunit/test.h | 24 ++++++++++++++++++--- include/kunit/try-catch.h | 3 --- lib/kunit/kunit-test.c | 45 ++++++++++++++++++++++++++++++++++++++- lib/kunit/try-catch.c | 33 +++++++++++++++++----------- lib/kunit_iov_iter.c | 18 ++++++++-------- 5 files changed, 95 insertions(+), 28 deletions(-) base-commit: d206a76d7d2726f3b096037f2079ce0bd3ba329b -- 2.44.0