Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1498320pxf; Fri, 26 Mar 2021 08:44:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpBKzvzIXQ2eJiZ0OP06d7kUdRDXfGASr1daq7q/rNcvZr7jWUCyscBeZL5Y9SFB1vCsT4 X-Received: by 2002:a05:6402:31e9:: with SMTP id dy9mr16166989edb.186.1616773459094; Fri, 26 Mar 2021 08:44:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616773459; cv=none; d=google.com; s=arc-20160816; b=pvlugXnUd25WzPJj8wQOMo9egoBSBJAcXxnTLPz6s4k3NbA2a+cJI1avFtaPtIIzV4 n5LgBh1urp2G8QHVDYD2FtfjZCoHvuqrFjLvRHOAznKOZS4hcaIiitcK70X4iRz7cd1L XzoLW8M7d4Bhtc0Stt/fG5yzPgfY9ZIii0pf3VHI2Enbmq9XDB8tbPFKypdqIElMY3bq qSPv7i+eduDcnVAOZATB20X5uvLZbussKUOXs75tAXhD9U6DfJkaOb97m69EF6uw5/LG J+vNfF59LBTXELxbi2Nb5mVKfup4QMYRqtqlEk5ruB18RF/R3JudfsgYfDs+aYNDpT2m wPgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qIgpVnVkbfCqq2cX7vi5/rwYT4MM7COAMskMgWZGJrY=; b=caRZJpJC/uOaq98VQyWav8R1U1IGgJvgXWyP9h+kS3v8i8dA/RTo0pNVEeYVXQjICO IIQpuElbcsm1QpXfGSKc5yyq26JSWUEB0W6cX8lT+xYBIVB/Mtqnz/d8PMyTNXEKBqkY NHtdDMuhzlIEZfiJh/pZ1AFI/hEm7Z7jLo8x15LrCwzKk4f121+ljVHcy2sVzhqCrFWg jDq97X5BhCCkMNZW5NhHUsQruAtkU+5aEU5QDdz4pw63+zRiH6U424WBrr+SVJcMGFlz iXDLjEfz6Rx6/Sam/KLLF3mOsr7caj4XecRkUQef7OwD0PcoBZOdyinvjTqYvz2NA8c3 /Vxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="h8SQ3C/2"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si6957290edv.534.2021.03.26.08.43.56; Fri, 26 Mar 2021 08:44:19 -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=@gmx.net header.s=badeba3b8450 header.b="h8SQ3C/2"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230407AbhCZPnD (ORCPT + 99 others); Fri, 26 Mar 2021 11:43:03 -0400 Received: from mout.gmx.net ([212.227.17.21]:46687 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230192AbhCZPmz (ORCPT ); Fri, 26 Mar 2021 11:42:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1616773315; bh=5eLgdU45K7E2wo8Ug5bX02jFCrshvXXHtRqXp9B6Ow4=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=h8SQ3C/2QwpQx0H0KY6KP+jiib7Gm5USU+lQNsEvBANLK8Smdnfid33h7KFB12x81 J973x93ulLSa39BNO+pIsKe63b3zq5qjrZJSl5r8bnDMhUMY0ZaLcWqfkbNNOzqcsb n76DLt/OLQKTDbpkQPdF2Yd/qmbdd9MY2ZlVjXTY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ubuntu ([83.52.229.153]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1ML9yc-1l7jkH0lQw-00IAuO; Fri, 26 Mar 2021 16:41:55 +0100 Date: Fri, 26 Mar 2021 16:41:41 +0100 From: John Wood To: Jonathan Corbet Cc: Kees Cook , Jann Horn , Randy Dunlap , James Morris , Shuah Khan , John Wood , "Serge E. Hallyn" , Greg Kroah-Hartman , Andi Kleen , kernel test robot , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [PATCH v6 7/8] Documentation: Add documentation for the Brute LSM Message-ID: <20210326154141.GA3131@ubuntu> References: <20210307113031.11671-1-john.wood@gmx.com> <20210307113031.11671-8-john.wood@gmx.com> <87k0q0l4s8.fsf@meer.lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k0q0l4s8.fsf@meer.lwn.net> X-Provags-ID: V03:K1:2ffp/O9iNnB5tOZJlOKbIBIElc1aB7tKPscALEmFt1EkyRNffNU wiPNw8U3ciTKoYxsVRf81yoQRo+H/hCZy/YRjAhdBHs3d0PuEgLHBhO3PnfD7k9tPPFojEM cGrMSsT0B1TFpWESJbnCsgDEso8ClCflg1zZj8nlYfUqt71TtWmomZBAxLP/erTm8BKsSQK seGzO+1FPZsNDkPT/lboQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vchnW+PvK4U=:Kaw9IXbD5r2xS7sNA6OL56 QE1/0MjKUGVmH5sEyhJqPw6vSvgHThqEtvtDYJZUOOOx/PiFtqjWxWcqPZYpfm6fAF26hbUyL dQzXBiz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+P3Dc775l0b KiQ9ZMeMLa8xYiKNjOfvfRZHcpCykK9NEMIQk1XBD48HaVsli04WH179X88YsvSyiz4xE= Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 21, 2021 at 12:50:47PM -0600, Jonathan Corbet wrote: > John Wood writes: > > > Add some info detailing what is the Brute LSM, its motivation, weak > > points of existing implementations, proposed solutions, enabling, > > disabling and self-tests. > > > > Signed-off-by: John Wood > > --- > > Documentation/admin-guide/LSM/Brute.rst | 278 +++++++++++++++++++++++= + > > Documentation/admin-guide/LSM/index.rst | 1 + > > security/brute/Kconfig | 3 +- > > 3 files changed, 281 insertions(+), 1 deletion(-) > > create mode 100644 Documentation/admin-guide/LSM/Brute.rst > > Thanks for including documentation with the patch! > > As you get closer to merging this, though, you'll want to take a minute > (OK, a few minutes) to build the docs and look at the result; there are Thanks, I will do it. > a number of places where you're not going to get what you expect. Just > as an example: > > [...] > > > +Based on the above scenario it would be nice to have this detected an= d > > +mitigated, and this is the goal of this implementation. Specifically = the > > +following attacks are expected to be detected: > > + > > +1.- Launching (fork()/exec()) a setuid/setgid process repeatedly unti= l a > > + desirable memory layout is got (e.g. Stack Clash). > > +2.- Connecting to an exec()ing network daemon (e.g. xinetd) repeatedl= y until a > > + desirable memory layout is got (e.g. what CTFs do for simple netw= ork > > + service). > > +3.- Launching processes without exec() (e.g. Android Zygote) and expo= sing state > > + to attack a sibling. > > +4.- Connecting to a fork()ing network daemon (e.g. apache) repeatedly= until the > > + previously shared memory layout of all the other children is expo= sed (e.g. > > + kind of related to HeartBleed). > > Sphinx will try to recognize your enumerated list, but that may be a bit > more punctuation than it is prepared to deal with; I'd take the hyphens > out, if nothing else. Thanks. I will fix this for the next version. > > +These statistics are hold by the brute_stats struct. > > + > > +struct brute_cred { > > + kuid_t uid; > > + kgid_t gid; > > + kuid_t suid; > > + kgid_t sgid; > > + kuid_t euid; > > + kgid_t egid; > > + kuid_t fsuid; > > + kgid_t fsgid; > > +}; > > That will certainly not render the way you want. What you need here is > a literal block: > > These statistics are hold by the brute_stats struct:: > > struct brute_cred { > kuid_t uid; > kgid_t gid; > kuid_t suid; > kgid_t sgid; > kuid_t euid; > kgid_t egid; > kuid_t fsuid; > kgid_t fsgid; > }; > > The "::" causes all of the indented text following to be formatted > literally. Thanks a lot for your comments and guidance. I will build the docs and check if the output is as I want. > Thanks, > > jon Regards, John Wood