Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1043702rwr; Fri, 5 May 2023 08:22:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vM1YGZ9N82DCL09EyWZwAMpMy0hf5SiJuxzfQbBZo6I6+l/NaDjvRntYDYA9BGVvaRZGP X-Received: by 2002:a17:902:9349:b0:1a9:4fa1:2747 with SMTP id g9-20020a170902934900b001a94fa12747mr1651341plp.47.1683300150830; Fri, 05 May 2023 08:22:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683300150; cv=none; d=google.com; s=arc-20160816; b=O6HVpCJ7JUmZ9lgnR4BLsLU9D8Q7hhIXvkOhoh1lYFRot1c16Ifq2rriKlPIn4dZKT Suvl6EynuDG71qYb9e97Dtv3tRUewy0JFdqcVkFMQVNFl/DhURiKjAmKy0xsswz+Vj7Q GxKLsN2YeV4nsOy2Relc5Q+menS1i6ioamJA657+P6LrqaVjyURaOgf8XEbob+S23Zxn lvb97DLBdRBYUQGQJqPALmEZVHoEcGut2YdrcHtoFe7UPP7TnwlZXFhbytgtWIJ2kYI2 EZZCPR8DN4VrR4JwRKnj1R+Wq01veoYFN4qPK328VvlB4RnawDaL68oQnToHTeSFSA/v AZBQ== 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 :organization:references:cc:to:from:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=abj92oKBVKkSuSz9pqIREg9vXlBszotRotTWHKF/vxY=; b=ToLYsIXTZ1xmWr3YTltHUOsLJeEA4Mfqe3gIrWxrA4yzEYhtFEShRbkrECgJLjdRBT rUJl60988fsDJgl8igKTFhR/MoAWCJG4n8zGXkOFIR57h0qUBI7Uz2K2pqUwmw6DU5ey uaqqFYSnclxXkco472/MMHn4cq6JkzbqQVNKxMba71pgM+CYQ4cUgyaTNjl9e5C2sDaH eAv8ZEoVuyLA148diIhssfjv+MW8bkNXDBp6kF7NB+9/wSiLvAdpRiPjWviwyK+K622n uWfqkIUufnZWxD6YtBUl+O8JzmnrLi5JXAi1uyKIbQssyZLJsOzVON9L5VuF9vgDkaJN +soA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ybkm35MQ; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a170902b60a00b001a6f0e81ec7si104094pls.237.2023.05.05.08.22.15; Fri, 05 May 2023 08:22:30 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=Ybkm35MQ; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231686AbjEEPRw (ORCPT + 99 others); Fri, 5 May 2023 11:17:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232457AbjEEPRu (ORCPT ); Fri, 5 May 2023 11:17:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B102517FFB for ; Fri, 5 May 2023 08:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683299822; 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=Ybkm35MQVl6W0UqmckRPall+d69uZ584vqXpsNH1xez1CQ4OIkUothZZOEuRRIiWMCoQTk sv6MiKn4W48QwYnqkG3oNgNpTrjMkLQsWcKzANN7LllotiyXB67KRPxmmT5CMo2iQJpsWQ xhiLO+nedfvHfQ5Q9HdsL2UYp+2oNi0= 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-433-2KTS8tfzMSqVqVgTWJ271w-1; Fri, 05 May 2023 11:17:01 -0400 X-MC-Unique: 2KTS8tfzMSqVqVgTWJ271w-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f173bd0fc9so10873685e9.3 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=iWZd+l0dr4xsyBqXa2XE/7pT0CGx+bwaD0/LtqFiJyS/i7eRlOYPMQM1diY12J890F cca5iT3syXCym9H07YL9RfAueG3aEmkXeX16iADID94juBnlfCFIQmfe7jV+bCdUszAA cWx2TeZrfQ1AEKifmr7zjK6DMYvcL2ANS7U1mwVEvWTQkO6/azI7IYmIOe0HyDtHXJ6l gZCEBDyOp9an5ypmslApYbt2W58ahafd8rmpT2SFWYE/v/0n0CADIwoLkow3xWeJlmgk cenNillzJ5zNNpOSqPPPhuSUeaWnrLXnCA/CfMiC51JRWpv/Qcnq3hSb4y2IyzNQk0i4 dOlQ== X-Gm-Message-State: AC+VfDyuuUuFoCz8SdZGkezk22bklpzOhHs+tGYWXEregY+/BL2LBvP4 hiL+8k3wPIjHmXtZHUUrRqLVm4c06jBvQU5+fiYeexjuEgBxkCWizITrtF6tWVenVEKYbH8uKAH tNB9Da8+vjtBFM4NRDAxCWswL X-Received: by 2002:a1c:7702:0:b0:3f1:72ec:4009 with SMTP id t2-20020a1c7702000000b003f172ec4009mr1676493wmi.9.1683299820163; Fri, 05 May 2023 08:17:00 -0700 (PDT) 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 Content-Language: en-US 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE, 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 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