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 81EA9C433F5 for ; Sun, 14 Nov 2021 14:21:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D54461027 for ; Sun, 14 Nov 2021 14:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234393AbhKNOYf (ORCPT ); Sun, 14 Nov 2021 09:24:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbhKNOY1 (ORCPT ); Sun, 14 Nov 2021 09:24:27 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4463C061200 for ; Sun, 14 Nov 2021 06:21:31 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id t30so25130221wra.10 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=nMtgkk8UVbMjnSo674USFWUjrGovOEXAIFoKKZseNcKUp+OTzboyFOMHVR9+gNWs3w 61qjwCze/bgOFRZ8xijqKh5UAEVP9pW1kUv4+3754AwdC5jqioROLzknGBpn9rHbTCsA 6452JKZEwWFUnHxkLd7y82HiM83+99KW6L/GlzyK2vLz5YPReiTe9+f5nL8z9VX+p2pg qDmphEoy+DDnDq1mWBEANNKLpwZkJSjQ0WjLsiOpYiKhtuvtBXrlt0klxUnAn0+M5cZS vRORAFuNb3GfHo4EmYvDOUqvFZqN3XpF0znZT5nWj/X1aYXDVTSQDknAN6E8mFHgDYBq qAOg== X-Gm-Message-State: AOAM533KlqOr3x1n86VEpG5zW+lJNRzacAvwGwMuwx7W/gngenPgMKIN V5bfywyZ4V/uWf/TKZT07WiLLQ== 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-kernel@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