Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4507216pxj; Tue, 8 Jun 2021 16:24:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiHlOWCI95pr7T0zW/jhfPCGa3vJlV9ZfqBouThGLtbjF7BNl/lG4K+baGSK39saMwvjhK X-Received: by 2002:a17:906:fa13:: with SMTP id lo19mr26468670ejb.468.1623194694510; Tue, 08 Jun 2021 16:24:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623194694; cv=none; d=google.com; s=arc-20160816; b=nT6tDHP2tMaVp52VnvOOTXh+pvc4zBgB2K7MK+Avve/R7QHgAuCBBZiCMV0eakHFLR twHjyxBvFawajupencEjVbsUvfkHgzjeRdqFVPzNmt8z2d/EaM6AW+296vw8fWK8e8QR P/gyvV6RdTcW0Zcuq9VJxY8CH+/Iymtc83suN/tf5bbuiwf8jHoS58H0Y2Rzuexdw++V xEj/nvITw5WCVBirjHoqZUyQefAYA5ROtTkGEAdHCAKD7CNUB0ZZb3whRXT/3d4VUfaA deK/RLdv06tB8mWfMhWz9HlL2OC3g5ZyYloGi9dNthd5y3XLLwdFiN8dCVsaIwduK0tP dccQ== 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=UYnHXpjkxY6uN8Q/wAdT4oZuTb3kldbBA0o55ZnXLbI=; b=ZZfaYdfn1KBP4aUWtZWSNOpn4vD7QidiHqUSsd/INII3yORTIa5z36leSIx7pEL44I p9zzUEi11WouwwnF/Eiw7WD9exTVWeBsSd2zdFq2KQszsnWp4D3dpn9lJ5LAY1qTQxOJ 6rZxP1gg8DCFqDmnfAR1z+fPVnhl2Yf7UFs4zg6Um6FVglFqgkWZ4QggXNJ8tKi1lL+a 8XhrAoDqTBAWf8Ou0ShUhsEZmS8NNFc3cKTe9JMCDiDmjitkBOeh7X24X672rcOGNkQC 25vdhv/4jvSz4vY4hi+VaEXOjWGU1x70pTZw4sHSkB2lIj1foENV9tyRZ9XkHLSTqdbX na6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VDGAYt9z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si831660edv.591.2021.06.08.16.24.30; Tue, 08 Jun 2021 16:24:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VDGAYt9z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234334AbhFHXWl (ORCPT + 99 others); Tue, 8 Jun 2021 19:22:41 -0400 Received: from mail-pf1-f182.google.com ([209.85.210.182]:36822 "EHLO mail-pf1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233927AbhFHXWk (ORCPT ); Tue, 8 Jun 2021 19:22:40 -0400 Received: by mail-pf1-f182.google.com with SMTP id c12so16954919pfl.3 for ; Tue, 08 Jun 2021 16:20:34 -0700 (PDT) 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=UYnHXpjkxY6uN8Q/wAdT4oZuTb3kldbBA0o55ZnXLbI=; b=VDGAYt9zeOJIjafEo+B67uPbBGKQhrSGnf7Qo9Ch6H/mTASRST0oDv92Nf7ui6OeS8 iB3NOQV0MMtCh2uBcA+Npibc6zFdC9xeu4KT1yRo8M0w7oGssOjX8MMlaVOz2EjWKrbi wCpTzbJv8yEONP8oFpas7EKEl1l7Ccqy2QOmo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UYnHXpjkxY6uN8Q/wAdT4oZuTb3kldbBA0o55ZnXLbI=; b=sITluAbRw+bcPSI6DAz002IOtHqN7AgbsobUcEpozGFTlJ9roFM3G3dXWm6WBrGFES bMwFmI+IXnzGt9/nx37pTIQnX9aTpMuDFTcg3PgFgMWW8sYWofj+PQjnJMaqcEpK9cEy GYF6ir6bqo0y1wBCjx1dkvokh+NKBt3FGRDsx6NSqWjn/Jks47Hiv8y5qZ6jmEH4YHAK KC3TdHEGsqCauJkr/jiVrcu+4ALxm6r+x54EoMc2WiGvtvT/N+ngpNizixcUCZGdqqwE oxUnjNPoElN3eX3pIz1GK0BczqivPKM3OBhjNVPegGB0kk+kTu+wCQWYYBKEYRTNUyck BgdQ== X-Gm-Message-State: AOAM530LKThtXxE9Cp7AYBLHmQbLht19fJ14m+R/FpGZZbHMJqxHi7fE FzXVcgGdTr9xEwXWhMeoQpJXhA== X-Received: by 2002:a62:be03:0:b029:2e9:fe8c:effe with SMTP id l3-20020a62be030000b02902e9fe8ceffemr2325280pff.34.1623194373956; Tue, 08 Jun 2021 16:19:33 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m2sm16400257pjf.24.2021.06.08.16.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 16:19:32 -0700 (PDT) Date: Tue, 8 Jun 2021 16:19:31 -0700 From: Kees Cook To: John Wood Cc: Jann Horn , Jonathan Corbet , James Morris , "Serge E. Hallyn" , Shuah Khan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Arnd Bergmann , Andi Kleen , valdis.kletnieks@vt.edu, Greg Kroah-Hartman , Randy Dunlap , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arch@vger.kernel.org, linux-hardening@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [PATCH v8 0/8] Fork brute force attack mitigation Message-ID: <202106081616.EC17DC1D0D@keescook> References: <20210605150405.6936-1-john.wood@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210605150405.6936-1-john.wood@gmx.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 05, 2021 at 05:03:57PM +0200, John Wood wrote: > [...] > the kselftest to avoid the detection ;) ). So, in this version, to track > all the statistical data (info related with application crashes), the > extended attributes feature for the executable files are used. The xattr is > also used to mark the executables as "not allowed" when an attack is > detected. Then, the execve system call rely on this flag to avoid following > executions of this file. I have some concerns about this being actually usable and not creating DoS situations. For example, let's say an attacker had found a hard-to-hit bug in "sudo", and starts brute forcing it. When the brute LSM notices, it'll make "sudo" unusable for the entire system, yes? And a reboot won't fix it, either, IIUC. It seems like there is a need to track "user" running "prog", and have that be timed out. Are there use-cases here where that wouldn't be sufficient? -Kees -- Kees Cook