Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3209788lqp; Tue, 26 Mar 2024 02:52:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUP2mHxAgPZRv+eqYq0luzhFNYyKIXnPnMrM0bZjgDfHxIyxFc2QJnCzMR6GMPZqKKeo2VnfBrXWIlYVLOuftIAG4QbmsA8JwbJ6hCgwQ== X-Google-Smtp-Source: AGHT+IEGNWKBt3fByKMgT/5+Dz22AFqfUQ0Kaul8o4uxFgabxeXHeEIb7IwWfmqcyUw5jQ0yLU/y X-Received: by 2002:a05:6830:1bd2:b0:6e6:a94d:3073 with SMTP id v18-20020a0568301bd200b006e6a94d3073mr11812487ota.23.1711446732698; Tue, 26 Mar 2024 02:52:12 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j37-20020a632325000000b005d80a51e1c0si6697224pgj.851.2024.03.26.02.52.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 02:52:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118716-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@digikod.net header.s=20191114 header.b=i86c2MNc; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-118716-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118716-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 618DF29D358 for ; Tue, 26 Mar 2024 09:52:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D21786BB4A; Tue, 26 Mar 2024 09:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="i86c2MNc" Received: from smtp-8fa9.mail.infomaniak.ch (smtp-8fa9.mail.infomaniak.ch [83.166.143.169]) (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 E88934C635; Tue, 26 Mar 2024 09:51:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.166.143.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711446705; cv=none; b=tMlZGfqs/Xy/CmwKyPuj9qvH0BDPA1ZhCvZl7pZ57YG2INzx/TSaOeOW4IffwYmsKj+0E8oOAZ9jTOqAdhzEcxdYEI7JMEjcENWXNDmT1hFX5obaetorpM5EGXYQn5Pcl1FM/f5oW2mhbG9Nos/XN8wrq6APFCJASR7Be/ob5Lw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711446705; c=relaxed/simple; bh=Yw7gXVy/DL5VfiZ97miPEyVcUDPjJaMAJFbpu/mcTYE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ILQhwyQ9qEC6z9DdDkpdFVhX1XDNbT9H0xlKYKrha/Ci+WWmutKbOkTsT3gvq36tYmstQrKx2hd0L6x12+PDa36ir0Kp39vuQum9dy7HH59MkW9KYZFAep9zNxAYKegOdJZ3RK9l+2/amkGulpo4rmxif1lLDN5M+RbTTrvopbg= 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=i86c2MNc; arc=none smtp.client-ip=83.166.143.169 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 4V3lSR0KsWzfNp; Tue, 26 Mar 2024 10:51:35 +0100 (CET) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4V3lSL1PnJzr3; Tue, 26 Mar 2024 10:51:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1711446694; bh=Yw7gXVy/DL5VfiZ97miPEyVcUDPjJaMAJFbpu/mcTYE=; h=From:To:Cc:Subject:Date:From; b=i86c2MNcWhiGwgGVEbjabP59wToLSKeSCaSIWMqbCFLQCt664qe3uZxImx4wWAaLy JoHopq+YsGtBfJMgzCR9dpPgnYuJLI1QfHTgcFXwc1BbUOqzSMd6oBs9Ky3a55+P+e peXAzoer/H8q92XzDYW7LwoJnVX0flBfuuAR1yvc= From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: Brendan Higgins , David Gow , Rae Moar , Shuah Khan Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Alan Maguire , Borislav Petkov , Dave Hansen , "Eric W . Biederman" , "H . Peter Anvin" , Ingo Molnar , James Morris , Kees Cook , Luis Chamberlain , "Madhavan T . Venkataraman" , Marco Pagani , Paolo Bonzini , Sean Christopherson , Stephen Boyd , Thara Gopinath , Thomas Gleixner , Vitaly Kuznetsov , 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 v4 0/7] Handle faults in KUnit tests Date: Tue, 26 Mar 2024 10:51:11 +0100 Message-ID: <20240326095118.126696-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. Shuah, everything should be OK now, could you please merge this series? All these tests pass (on top of v6.8): /tools/testing/kunit/kunit.py run --alltests /tools/testing/kunit/kunit.py run --alltests --arch x86_64 /tools/testing/kunit/kunit.py run --alltests --arch arm64 \ --cross_compile=aarch64-linux-gnu- I also built and ran KUnit tests as a kernel module. 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 versions: v3: https://lore.kernel.org/r/20240319104857.70783-1-mic@digikod.net v2: https://lore.kernel.org/r/20240301194037.532117-1-mic@digikod.net 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 --- kernel/kthread.c | 1 + lib/kunit/kunit-test.c | 45 ++++++++++++++++++++++++++++++++++++++- lib/kunit/try-catch.c | 38 ++++++++++++++++++++++----------- lib/kunit_iov_iter.c | 18 ++++++++-------- 6 files changed, 101 insertions(+), 28 deletions(-) base-commit: e8f897f4afef0031fe618a8e94127a0934896aba -- 2.44.0