Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5187084pxj; Wed, 9 Jun 2021 11:09:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkf4cxw1lmN6knSp1fOxzR3RxV78cxLm0y5rrAUrAjUqsd04ROy04oENxJ5N3NhWEo2fvl X-Received: by 2002:a17:906:7188:: with SMTP id h8mr1025630ejk.529.1623262187907; Wed, 09 Jun 2021 11:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623262187; cv=none; d=google.com; s=arc-20160816; b=zDfD8n5xe9gB7wb1PEeXCPDzwSyCCGG1aP8GqqdPiBZ+Nwr7/VONjZoBs2AKY0RjR/ 0Wk/J9tFhXbPhVy/lCt5I3al3ObWL1glfn5AxdHfCWsCrSGDL565hs7FiGz/mboEnf8c Mo/cBg42YC9mY/oXUF5Xo0Zw+r/xpExaOo3vvLUHyvhrwn8Yy4jWbz1IMKTd9bhPoyoW QIL65/i8riIIJE4QRpN19p/Ku2iZLlHjWEpFLzO2U14LKHO97SqELk+kuJBqKt0UozMC 5GOFzmdtiFVeMUi7l99lisVj3b2Yd8soaogxzp/6GpgcN2hZXg4DPvzf/Jcin4vqHD6+ 9gwA== 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=LD9HSxwVBYD4Eigmm4/eFaSooe5X81yBa6b9diyTxLk=; b=YlvWcc+8aNHsHVQR93qQFGEbWnvxTxI/yj4FFGVXqQHkhtL0q3esU/5TuOrKW7ctHt R6OhkBAaQjhjf4eRN1/0/XTlsOFkplU8vVudQiNoGzopswsGKtDxUa9QTFkwSqJEblJn zmPY7iPv5Q1NWjo0vFvYaKbBp/RzWpnWXOkYw9JzLaQHuliULdsJ3ZRrTsWZhaS1PSMO 41Iz9XNGzMXMSxjIObbdOpJKfFbZGcBjb7WhblshjhFG7Aea6EbKONd5qPYhx2E4q4qG f7TPGdzxvk8DAcNyzPwkR1z8sniKRhIuAtSg1tKu81plhl0MrccmMSrkK+gTEgEp63pZ fDig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=N47Q7iKR; 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 b8si385712ejl.368.2021.06.09.11.09.23; Wed, 09 Jun 2021 11:09:47 -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=N47Q7iKR; 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 S230285AbhFIQy1 (ORCPT + 99 others); Wed, 9 Jun 2021 12:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbhFIQy0 (ORCPT ); Wed, 9 Jun 2021 12:54:26 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 960F7C0617A6 for ; Wed, 9 Jun 2021 09:52:31 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id o17-20020a17090a9f91b029015cef5b3c50so1739541pjp.4 for ; Wed, 09 Jun 2021 09:52:31 -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=LD9HSxwVBYD4Eigmm4/eFaSooe5X81yBa6b9diyTxLk=; b=N47Q7iKRccjNkYwWKqUHqFn73mIgkb6yUnEgVpfiCnpd7KGAo+RwkJGh7fCyhsJ5rJ PHoctqrgLpYFlXiogoGImI85Yu3OsLM3sfJYRnwP4OzsOAGtIgoKDG+IYVT+VOE0fTE/ 27PJSIvlhBf+evKmhRLXx/yOa0KOermG9co7o= 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=LD9HSxwVBYD4Eigmm4/eFaSooe5X81yBa6b9diyTxLk=; b=moxOxxIOVhoITDMjqrPKDifzPk06cKehFm0BjLYiB9e+wZTeCKz9o+ynBepQ5phc9x n/NR2dXLhMS7088mZC8C35VYSy0gtGLohCfp05cFMCwXyGQ5gnaMIWeWe3S5nbIcTtAw vmg8bK84S5a9NV/zaGKYVRVae08urdXdxMoh0zcNRTkffeh/dubXnp648DTGyhX28IyC yJ+nkAJ4QWH+Pl1toN5wwmmrAfDHJcXIkIk8RMtxWgSHm78RjbIk35Z2sdMFogjFSgQi BtqU3BMPRQQmK/cVLWal4mBXZuGifj09VW0to/s5FdcChs86wKX/gPcXRaDhrGLF77e8 izxw== X-Gm-Message-State: AOAM531nLa+UaY2pDLMuBO/augnwPUR4+VXk2rH9iTYd/WpK4JSzVFLA nx0V0Gj1t1zwlwNyRhdTKCR6aQ== X-Received: by 2002:a17:902:988f:b029:114:12d2:d548 with SMTP id s15-20020a170902988fb029011412d2d548mr479973plp.73.1623257550841; Wed, 09 Jun 2021 09:52:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k30sm305187pgf.59.2021.06.09.09.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 09:52:30 -0700 (PDT) Date: Wed, 9 Jun 2021 09:52:29 -0700 From: Kees Cook To: Andi Kleen Cc: John Wood , 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 , 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: <202106090951.8C1B5BAD@keescook> References: <20210605150405.6936-1-john.wood@gmx.com> <202106081616.EC17DC1D0D@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 08, 2021 at 04:38:15PM -0700, Andi Kleen wrote: > > On 6/8/2021 4:19 PM, Kees Cook wrote: > > 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. > > > The whole point of the mitigation is to trade potential attacks against DOS. > > If you're worried about DOS the whole thing is not for you. Right, but there's no need to make a system unusable for everyone else. There's nothing here that relaxes the defense (i.e. stop spawning apache for 10 minutes). Writing it to disk with nothing that undoes it seems a bit too much. :) -- Kees Cook