Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3221872pxb; Thu, 10 Feb 2022 15:36:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyws2wobd09zWqJIAJI3fIRGx6UkpB++AdCTqTl95NF7oZXH8421HrXMqBLJCOAbY7WiKsA X-Received: by 2002:a05:6a00:a1e:: with SMTP id p30mr9759920pfh.66.1644536214461; Thu, 10 Feb 2022 15:36:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644536214; cv=none; d=google.com; s=arc-20160816; b=wDxM7zEJhaLHpwt+xNLE/44JDGB2bSIVh95YIDwngHh//12++hkXWahgzJ/RqF+sQL 9Jkj3h12sOPgYCmFiH+nZ2yRdxF1KNDxcqWj/ADJOOCi3RRDVilzKgASsGeJ1UJDY3DP wRjkcfyM2VsfgUmbGPc51Pc0T3F/aCCVJgiKD5O40OnY/z6rCm6h2oAc+a5KcGZwOH2X RlAUdzbbbNQcodKRbgtQpJH0387ndCgGpAJG6k489lwQYagSVtFTpgkzwQaFzyYilmEb X19VtI9cqdQgy+sRJTsMEDFhni7ooF9pCosuR7lfvkwT7w2JrEA8Ay0fDMX8nySzaz// o1BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2Qay4SXcXqCUQIXOF09+29cliVC/ppwG39SV706o69I=; b=YDhNUL9MTxPDJkR6kldbmbBPtc+kkB978ayVykjBFH1JpRh6tsSKiTg/SC44a7kPCX hoRKHoB3Zk5Mxi9BTEnhuHvc8OmHkthaXZQ8gdMNSeajX6qa6EY93E6d8GbykO9HlP6j oalVbLXTFdf5UJZEaSSeIzXAN6XJaHYDwhWk+iD0sC8/GHI9zd+1WUhLMJOv2u4sZ0ow F3XlIzWh1gxSSsvUguY+muSwKTJk59DTfttzxnbmceMoS98J+IROJtpXhdh80UdyzuI5 Rv5N3J+diuMlU052QmN7THYf2nNhDXBw/OcXx0XjORWkaKJ7wOHZnduUYYBwU7dSTR09 BiZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CG3CEgac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj19si19400638pgb.374.2022.02.10.15.36.43; Thu, 10 Feb 2022 15:36:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CG3CEgac; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236093AbiBJSmA (ORCPT + 99 others); Thu, 10 Feb 2022 13:42:00 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233454AbiBJSl6 (ORCPT ); Thu, 10 Feb 2022 13:41:58 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50F1710C2 for ; Thu, 10 Feb 2022 10:41:59 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id v13-20020a17090ac90d00b001b87bc106bdso9444467pjt.4 for ; Thu, 10 Feb 2022 10:41:59 -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=2Qay4SXcXqCUQIXOF09+29cliVC/ppwG39SV706o69I=; b=CG3CEgac/J7CcLrLpcqwqD15ezQ2qtSXIz2G+GP7H2CENISZlNph3GVBcqiTWrJWAg ozVzbw04bERVTLcgz7tlsYeaFsLuMp2ozTwZKwgZRHNhON220yOAiKPyVJ/LC/RQlaFh xuB/Cb9frKW+g45VBMYRNYiQgGoc1AgyDh338= 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=2Qay4SXcXqCUQIXOF09+29cliVC/ppwG39SV706o69I=; b=Ybqstcz/Px1V4ppC2qzWPX7TzsQqMANSXOaEQkUT1RfRsJzBcVAlluJHUoPRqOesch tdRrshaG9dImT6SHIi+zyoe/nRj9Kcgs/EznCthLbV4Fvwkp0drTe8en/CyTUEDIrGiR 6YSxozzneGlobgMmmpBEBkE2ziGCceQXBly7iPtvZpEcZOsiKSoVpNkd8yeCLmuTWznh BzM0EY5siql3O4MZCKahiI3RZVheNwjpHxYfmWhnXPcCOvWtEpWoGjVd95ShPkwilvOY tN7BGKTe8ZeHG3AcRrOCaZlMcwZf9WrdNPdB8fJ+6pDT8ax9idtq3xiYd0u4q0KZ0CSx qyBA== X-Gm-Message-State: AOAM531Z86kzJq3pZfc90FuOW4plvb3OkG7bWvf1ZyS2cIWWgUXHpNEJ E7GGTXWUYiH6Ekz6ocdVmFaVDQ== X-Received: by 2002:a17:903:40ca:: with SMTP id t10mr8817172pld.121.1644518518816; Thu, 10 Feb 2022 10:41:58 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c14sm23138622pfm.169.2022.02.10.10.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 10:41:58 -0800 (PST) Date: Thu, 10 Feb 2022 10:41:57 -0800 From: Kees Cook To: "Eric W. Biederman" Cc: Robert =?utf-8?B?xZp3acSZY2tp?= , Andy Lutomirski , Will Drewry , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 0/3] signal: HANDLER_EXIT should clear SIGNAL_UNKILLABLE Message-ID: <202202101033.9C04563D9@keescook> References: <20220210025321.787113-1-keescook@chromium.org> <871r0a8u29.fsf@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871r0a8u29.fsf@email.froward.int.ebiederm.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 10, 2022 at 12:17:50PM -0600, Eric W. Biederman wrote: > Kees Cook writes: > > > Hi, > > > > This fixes the signal refactoring to actually kill unkillable processes > > when receiving a fatal SIGSYS from seccomp. Thanks to Robert for the > > report and Eric for the fix! I've also tweaked seccomp internal a bit to > > fail more safely. This was a partial seccomp bypass, in the sense that > > SECCOMP_RET_KILL_* didn't kill the process, but it didn't bypass other > > aspects of the filters. (i.e. the syscall was still blocked, etc.) > > Any luck on figuring out how to suppress the extra event? I haven't found a good single indicator of a process being in an "I am dying" state, and even if I did, it seems every architecture's exit path would need to add a new test. The best approach seems to be clearing the TIF_*WORK* bits, but that's still a bit arch-specific. And I'm not sure which layer would do that. At what point have we decided the process will not continue? More than seccomp was calling do_exit() in the middle of a syscall, but those appear to have all been either SIGKILL or SIGSEGV? -- Kees Cook