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 37D76C433EF for ; Tue, 16 Nov 2021 18:41:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 177456322C for ; Tue, 16 Nov 2021 18:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239596AbhKPSou (ORCPT ); Tue, 16 Nov 2021 13:44:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239587AbhKPSor (ORCPT ); Tue, 16 Nov 2021 13:44:47 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A92A0C061746 for ; Tue, 16 Nov 2021 10:41:50 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id m15so14526190pgu.11 for ; Tue, 16 Nov 2021 10:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rpZo5Ukhloxpo3t6te7xJnWQRrow3d4oIhzJ9wNY//s=; b=VSNC43P14WmPSZmUrPilJ+DgGj5eVm+rYneRkINAieo4BCqCLBy5QiE+yxx4dMJHrP ofgb/NWCMtHijcLBbRJZt2srQLA+UEZ3FYMnXTi4zhVU59bazntvLi1ZB9x1FOAMm3MU zC1NqI7P7FvTEoA0kb6E30B9MNDZ7w/u4TNWQ= 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; bh=rpZo5Ukhloxpo3t6te7xJnWQRrow3d4oIhzJ9wNY//s=; b=k03VUKHVHDvXAUxd/lZc6CpddTN0ES8KKyZiC0+zsdZdYzLfyBOCxgTEbqEmEiaH+l rbiHaAEkhoUwP8uJpDoRSVcAlDFpDhu7KVKA1tL1qup99HhoUh9Vh8YK93CeS8EIrabA hP4/g0lwNNhX6hYITWrxNs52UMxEx8gjg+ac4fNZqvGPX7HmgP87827EKFYN/Q5LKG4e rKv41md/L5VF7holf0gRDzPMjHRAEIjlp5/wkFJiGdlL7PwQijyZkwq2PVgiOxAO6wrG nHAJoOT5Ia0quAKNXYHizIQi+ROC411J03xEet0T5wzsiJJdc/Jm1wGRjJvPw/xwN2eF +fQQ== X-Gm-Message-State: AOAM532pSyzgLFBpjju9kBnEIgEHAAGC0+1YSQvKw+paq7cEu8yyVJfh hVV3r4SsoPRBuaymy9FC3ywGyQ== X-Google-Smtp-Source: ABdhPJwwvQRQ7H1L7erOMj0WCwxaWTV8d2CBQFnkm/BoZWo9AQPZdRvAdBwwSZAEqBBMD7kMUEk6Tw== X-Received: by 2002:a63:b502:: with SMTP id y2mr798068pge.214.1637088110275; Tue, 16 Nov 2021 10:41:50 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m6sm14550926pgc.17.2021.11.16.10.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 10:41:49 -0800 (PST) Date: Tue, 16 Nov 2021 10:41:49 -0800 From: Kees Cook To: Alexander Popov Cc: Steven Rostedt , Linus Torvalds , Lukas Bulwahn , 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 , Luis Chamberlain , Wei Liu , John Ogness , Andy Shevchenko , Alexey Kardashevskiy , Christophe Leroy , Jann Horn , Greg Kroah-Hartman , Mark Rutland , Andy Lutomirski , Dave Hansen , 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 Subject: Re: [PATCH v2 0/2] Introduce the pkill_on_warn parameter Message-ID: <202111161037.7456C981@keescook> References: <20211027233215.306111-1-alex.popov@linux.com> <77b79f0c-48f2-16dd-1d00-22f3a1b1f5a6@linux.com> <20211115110649.4f9cb390@gandalf.local.home> <202111151116.933184F716@keescook> <59534db5-b251-c0c8-791f-58aca5c00a2b@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59534db5-b251-c0c8-791f-58aca5c00a2b@linux.com> Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Tue, Nov 16, 2021 at 12:12:16PM +0300, Alexander Popov wrote: > What if the Linux kernel had a LSM module responsible for error handling policy? > That would require adding LSM hooks to BUG*(), WARN*(), KERN_EMERG, etc. > In such LSM policy we can decide immediately how to react on the kernel error. > We can even decide depending on the subsystem and things like that. That would solve the "atomicity" issue the WARN tracepoint solution has, and it would allow for very flexible userspace policy. I actually wonder if the existing panic_on_* sites should serve as a guide for where to put the hooks. The current sysctls could be replaced by the hooks and a simple LSM. -- Kees Cook