Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp783054lqt; Tue, 19 Mar 2024 03:56:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVlYbApXyTtOA9plaJx+i7JoKhyZ96FiUybv1Cah/f96gI21iNnCMpcAmnuTK+q8P0gVMlh/a7k9r9m+XvDgn/iFWQxXSors1sntDcSbQ== X-Google-Smtp-Source: AGHT+IEVV1jO1+gfyscIBzmkSb9AlzXHTYwLMTTbZKjDNu+gxuIP0/VIYhD/sqTx7kwkW+QYMUcK X-Received: by 2002:a05:6358:6f9d:b0:17b:f464:e14b with SMTP id s29-20020a0563586f9d00b0017bf464e14bmr2424595rwn.13.1710845765574; Tue, 19 Mar 2024 03:56:05 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r28-20020a63515c000000b005cfbd190e58si9567881pgl.115.2024.03.19.03.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 03:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107422-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@digikod.net header.s=20191114 header.b="Q7tT/TcJ"; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-107422-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107422-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 8E591283E5D for ; Tue, 19 Mar 2024 10:55:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27CD17E58D; Tue, 19 Mar 2024 10:55:16 +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="Q7tT/TcJ" Received: from smtp-1908.mail.infomaniak.ch (smtp-1908.mail.infomaniak.ch [185.125.25.8]) (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 AF5C85BAF0 for ; Tue, 19 Mar 2024 10:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.25.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710845715; cv=none; b=rTfGXLZyVKGaZHGxGBfu7BsmeVaV+A6Z9V2y9BEfixYI/OdddtJsXyVfyt7Lj/eoOFJmGj2r9nR6nkog2JBLdjDBW9IJ7jHG7qlr+dJv0k9UQgo9ROxh8NKq0lhPUa8xlbdxd2jbOPMg8ESygA8TWLMro7+OWvl/JDSXdOKJeNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710845715; c=relaxed/simple; bh=titjicsS13zyLYpwVbjFKzsdWlMZsZ9iAVihS7vtrRU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Ghkx6RZmLE2SUfzn7KXeJY5zVkJEg/24SqpHT4et7WClcM0bb8YJHobIHGQ4rsKWtvPn5NDOUWqiI39uMBdFC2myiidUUc9f8Sf9GKTet+8JzHFRNrqXkr0P3W8Ko9wXD7ktx5mnSbZYxKUEi/SyMGW83WLMOYjQ+z1mdS9RHiM= 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=Q7tT/TcJ; arc=none smtp.client-ip=185.125.25.8 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-4-0001.mail.infomaniak.ch (unknown [10.7.10.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4TzT4G1GLBzMq3Gc; Tue, 19 Mar 2024 11:49:18 +0100 (CET) Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4TzT4D5thVzvGg; Tue, 19 Mar 2024 11:49:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1710845358; bh=titjicsS13zyLYpwVbjFKzsdWlMZsZ9iAVihS7vtrRU=; h=From:To:Cc:Subject:Date:From; b=Q7tT/TcJvK7xnZ0yNnH8RKseTWW7HMLg8r+H4B7xE+inCtDOxMj/yIS0gmUAS574p d1VT8nzN0WuOf/YgPmyMQPrKaMGUA+ZhjzVHME00J/VthdkIqwsIZEFZc80GJoFmyR cBePVO0WziY1W198OVLF5Mx5uDP8hjU07byNStJ4= 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 , "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 , 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 v3 0/7] Handle faults in KUnit tests Date: Tue, 19 Mar 2024 11:48:50 +0100 Message-ID: <20240319104857.70783-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 added Reviewed-by, Tested-by and Fixes tags according to previous review. I improved a commit message and added a comment. 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: 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 --- lib/kunit/kunit-test.c | 45 ++++++++++++++++++++++++++++++++++++++- lib/kunit/try-catch.c | 38 ++++++++++++++++++++++----------- lib/kunit_iov_iter.c | 18 ++++++++-------- 5 files changed, 100 insertions(+), 28 deletions(-) base-commit: e8f897f4afef0031fe618a8e94127a0934896aba -- 2.44.0