From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A211C433F5 for ; Sun, 14 Nov 2021 14:21:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0388161241 for ; Sun, 14 Nov 2021 14:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbhKNOY2 (ORCPT ); Sun, 14 Nov 2021 09:24:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbhKNOY1 (ORCPT ); Sun, 14 Nov 2021 09:24:27 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF1F6C061767 for ; Sun, 14 Nov 2021 06:21:31 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id b12so25234050wrh.4 for ; Sun, 14 Nov 2021 06:21:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=p8lk+q4Y2CquVO9sqmu4dSc1gvfHGQ8MpCynAwi+U0M=; b=tmyGi86bjZW/7vtxIzqiUXXSul5Ye8VTLY6C1i8poScsrQmwey4pUrTupOUd2E5T/O U6eX0di3bcDtRIs3BuWvdCD++Z4pOHXG2V7/QjHQvO431WlrLRjiIwM9WemrClq0gXC7 +Xwgxx1lTobE+ZE2jpjTNbPkawHwTRWgGn7pR4xCufUfAXa+44eXTTKOtS99KaHF6/+R X8NSkvmce0zWcaFSbInWCw47Cpi/bqA/D2uBq+Lg4zTA1l4KCZa5rfTWtLhA0NbTHWly iswWc8J+xnA9MCX3kJHw267Gkq+v0ts2CP9PZtr0/CC3u0DB5j2rE/ahsAFpiporeeH8 D3iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=p8lk+q4Y2CquVO9sqmu4dSc1gvfHGQ8MpCynAwi+U0M=; b=BI0++H9rcgFABbr1Xme6ISHpje9aBSB3hSP+JwJ88J1AEw/QtZ1c4ZRC499jo5tF9t pQXXRkklkLPJLan5U2yvy2O7UE7s49zV/XByqugb+oOrtMB/TsvVG8eIgLccu3OjCe9R G7V9VC2f3WT0ll4174JYWfz/tVArugC1XbdP+SpoGmS88en0wPOPRzDTL5eWcgT1YSjQ KKk51qi7l5GR8V8xgBiJ/29yxJLf6iHvRwMH1UAk2seChDgDzdSs3KQ2MilV03s5Dxi7 jRuD8WSEz2EtCWAa1MLj+zOCbsa09PR5Gk2nB9abkJiGOPY77TuGLYjr7nau770JAA9c 54fg== X-Gm-Message-State: AOAM533UsL7rHQPCJ2JSfm9MdXqW7L5F6JkJsFL4MNM1SAvEtkOUewLz QwETn8b7cy6218/tUJ+bYWypnA== X-Google-Smtp-Source: ABdhPJz1rGJhN4paD+q9e5k6x6AlTsEg1AdYORqZcrmrG1v2dBBnBwDrylK3vuq8tZdXbfsQe80dtQ== X-Received: by 2002:adf:f042:: with SMTP id t2mr38984084wro.180.1636899689743; Sun, 14 Nov 2021 06:21:29 -0800 (PST) Received: from elver.google.com ([2a00:79e0:15:13:48e0:47e8:1868:a12e]) by smtp.gmail.com with ESMTPSA id 9sm14717028wry.0.2021.11.14.06.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Nov 2021 06:21:29 -0800 (PST) Date: Sun, 14 Nov 2021 15:21:22 +0100 From: Marco Elver To: Alexander Popov Cc: Linus Torvalds , Jonathan Corbet , Paul McKenney , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Joerg Roedel , Maciej Rozycki , Muchun Song , Viresh Kumar , Robin Murphy , Randy Dunlap , Lu Baolu , Petr Mladek , Kees Cook , Luis Chamberlain , Wei Liu , John Ogness , Andy Shevchenko , Alexey Kardashevskiy , Christophe Leroy , Jann Horn , Greg Kroah-Hartman , Mark Rutland , Andy Lutomirski , Dave Hansen , Steven Rostedt , Will Deacon , Ard Biesheuvel , Laura Abbott , David S Miller , Borislav Petkov , Arnd Bergmann , Andrew Scull , Marc Zyngier , Jessica Yu , Iurii Zaikin , Rasmus Villemoes , Wang Qing , Mel Gorman , Mauro Carvalho Chehab , Andrew Klychkov , Mathieu Chouquet-Stringer , Daniel Borkmann , Stephen Kitt , Stephen Boyd , Thomas Bogendoerfer , Mike Rapoport , Bjorn Andersson , Kernel Hardening , linux-hardening@vger.kernel.org, "open list:DOCUMENTATION" , linux-arch , Linux Kernel Mailing List , linux-fsdevel , notify@kernel.org, main@lists.elisa.tech, safety-architecture@lists.elisa.tech, devel@lists.elisa.tech, Shuah Khan , Lukas Bulwahn , glider@google.com Subject: Re: [PATCH v2 0/2] Introduce the pkill_on_warn parameter Message-ID: References: <20211027233215.306111-1-alex.popov@linux.com> <77b79f0c-48f2-16dd-1d00-22f3a1b1f5a6@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.5 (2021-01-21) Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Sat, Nov 13, 2021 at 11:58AM -0800, Linus Torvalds wrote: > On Sat, Nov 13, 2021 at 10:14 AM Alexander Popov wrote: [...] > Honestly, if the intent is to not have to parse the dmesg output, then > I think it would be much better to introduce a new /proc file to read > the kernel tainting state, and then some test manager process could be > able to poll() that file or something. Not sending a signal to random > targets, but have a much more explicit model. > > That said, I'm not convinced that "just read the kernel message log" > is in any way wrong either. We had this problem of "need to get errors/warnings that appear in the kernel log" without actually polling the kernel log all the time. Since 5.12 there's the 'error_report' tracepoint for exactly this purpose [1]. Right now it only generates events on KASAN and KFENCE reports, but we imagined it's easy enough to extend with more types. Like WARN, should the need arise (you'd have to add it if you decide to go down that route). So you could implement a close-enough variant of the whole thing in userspace using what tracepoints give you by just monitoring the trace pipe. It'd be much easier to experiment with different policies as well. [1] https://git.kernel.org/torvalds/c/9c0dee54eb91d48cca048bd7bd2c1f4a166e0252