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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 923E3C77B7F for ; Fri, 5 May 2023 15:17:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08C536B007B; Fri, 5 May 2023 11:17:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 03CF4900002; Fri, 5 May 2023 11:17:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E47296B007E; Fri, 5 May 2023 11:17:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by kanga.kvack.org (Postfix) with ESMTP id C82B56B007B for ; Fri, 5 May 2023 11:17:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683299824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=abj92oKBVKkSuSz9pqIREg9vXlBszotRotTWHKF/vxY=; b=TS1CC1sevwUhsdOm0jb6hmUcbpbPp7xnZnGvavuR03jOjJpeSSxedTgA9orb0akZmTnSYi iJR10J5wkJlAL18qcM8Qa8i3HGQITBaS+CKFb8mPs4/2yE36YUbsFyVxguZMOYG//C0Dut iQOzQ8JJ8LMyXDPHNC4UA9Jik7bfTLE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-267-dm1q6-xIMS-E-VCvf-vRww-1; Fri, 05 May 2023 11:17:01 -0400 X-MC-Unique: dm1q6-xIMS-E-VCvf-vRww-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f3fe2492c4so10987495e9.0 for ; Fri, 05 May 2023 08:17:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683299820; x=1685891820; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=abj92oKBVKkSuSz9pqIREg9vXlBszotRotTWHKF/vxY=; b=ZHJEGx+5Y6MD4iC3qheXPglPd08Oraw8RdOUp/feSatf1IkN/q23ZfaZ7bQSp3N8fy ab0vuRZL9zLYWlP8MIinBLmsxXTyEmtmNFNDpzm6OBS/MGq0Q7NWiAfL/mWbe/aoaaXM slUpsH/IiLlF0TOoJwZwryYteqTvM5Qh+JktgwsvGWjygRNeWtGUz4WYzEbTjIC+LPEy 3+xVlWdh+LLfh6Hw45BDzttV8gWe46jsficP9Nt3igHKVS+WBiAdpGNi5o7wvOk8VKSL wUrpyA9DiHhFnLyIt9AxLDAKve7B1qecCsP3F3cjB+nDvTdmrEx7bDepcLn6xkYVT60A fgOg== X-Gm-Message-State: AC+VfDz12G34iWZuMiBeypVQasqQg8ZzdJK9OzyA8WKYnhP9uziLPYGU rFBlF3vGlphGxfPJkDTZ3XCJ+lMNgGthtBuJfhtRKOKUye6XSsxoS1kaUnWB5gYsNpbSbenila8 5EvRXVLAzmao= X-Received: by 2002:a1c:7702:0:b0:3f1:72ec:4009 with SMTP id t2-20020a1c7702000000b003f172ec4009mr1676495wmi.9.1683299820163; Fri, 05 May 2023 08:17:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ78JBIXEOqF3dAix6y4QDwnEAMI8vIJEvszuxEpNDMp1Z2OwDOrdyWv9MUnAGy//RkyiltP9g== X-Received: by 2002:a1c:7702:0:b0:3f1:72ec:4009 with SMTP id t2-20020a1c7702000000b003f172ec4009mr1676482wmi.9.1683299819807; Fri, 05 May 2023 08:16:59 -0700 (PDT) Received: from ?IPV6:2003:cb:c71f:6900:2b25:fc69:599e:3986? (p200300cbc71f69002b25fc69599e3986.dip0.t-ipconnect.de. [2003:cb:c71f:6900:2b25:fc69:599e:3986]) by smtp.gmail.com with ESMTPSA id h5-20020a1ccc05000000b003ee5fa61f45sm8280845wmb.3.2023.05.05.08.16.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 May 2023 08:16:59 -0700 (PDT) Message-ID: Date: Fri, 5 May 2023 17:16:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] sysctl: add config to make randomize_va_space RO From: David Hildenbrand To: Sam James Cc: Michael McCracken , linux-kernel@vger.kernel.org, serge@hallyn.com, tycho@tycho.pizza, Luis Chamberlain , Kees Cook , Iurii Zaikin , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, kernel-hardening@lists.openwall.com References: <20230504213002.56803-1-michael.mccracken@gmail.com> <87pm7f9q3q.fsf@gentoo.org> Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 05.05.23 17:15, David Hildenbrand wrote: > On 05.05.23 09:46, Sam James wrote: >> >> David Hildenbrand writes: >> >>> On 04.05.23 23:30, Michael McCracken wrote: >>>> Add config RO_RANDMAP_SYSCTL to set the mode of the randomize_va_space >>>> sysctl to 0444 to disallow all runtime changes. This will prevent >>>> accidental changing of this value by a root service. >>>> The config is disabled by default to avoid surprises. >>> >>> Can you elaborate why we care about "accidental changing of this value >>> by a root service"? >>> >>> We cannot really stop root from doing a lot of stupid things (e.g., >>> erase the root fs), so why do we particularly care here? >> >> (I'm really not defending the utility of this, fwiw). >> >> In the past, I've seen fuzzing tools and other debuggers try to set >> it, and it might be that an admin doesn't realise that. But they could >> easily set other dangerous settings unsuitable for production, so... > > At least fuzzing tools randomly toggling it could actually find real > problems. Debugging tools ... makes sense that they might be using it. > > What I understand is, that it's more of a problem that the system > continues running and the disabled randomization isn't revealed to an > admin easily. > > If we really care, not sure what's better: maybe we want to disallow > disabling it only in a security lockdown kernel? Or at least warn the > user when disabling it? (WARN_TAINT?) Sorry, not WARN_TAINT. pr_warn() maybe. Tainting the kernel is probably a bit too much as well. -- Thanks, David / dhildenb