Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1069881rwr; Fri, 5 May 2023 08:43:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vgjwJJkJ9W/oz7HGpY1AjbUkBoUyFvFIG7jXn2dX9JtNnm7XIOFvAmsWwGb+D8e1nz/21 X-Received: by 2002:a17:90b:17d0:b0:24d:f113:2e2c with SMTP id me16-20020a17090b17d000b0024df1132e2cmr2421933pjb.16.1683301435810; Fri, 05 May 2023 08:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683301435; cv=none; d=google.com; s=arc-20160816; b=gkPLVkU08k81V2c4G5ARDOjkO0ZNwOBNtnYXE7eb/JRGXGYBbjKFHxxM2VKgVPaf3M MnQYfpo5DdEKTszTDLEUZQJgBHalMZi36TwCD07vJKn5kC2OrOZYwQUsUcHYZkGC6K1q iMpnKLVKbQoDbHCPvYR98ABqLxpaWYK1LQOy8tnvUmtuZKTlCp0NpYCkg68m7a72JHRt AGP1snWABZK0IGazVZIsapbyj/665LPVK6P7eQ69j3NE8H8dmr0FNDHViDLqFDKpEKJ4 2tM+NI/9Xbvls+Gg6qwdaeLpgVICNKEBtFJvQm7NNPBhTrQTD9Z83VwN00kuXvTSaAIo R5bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4/3vTohp91jiKKtxYYXC9sZ4oDT0Wvdf7xVOWIDy7Fk=; b=dy6/iSM7kdaJk2uGaPmcy6b26LtzwKLT6O7pAVOWLvhC63R1fYSKV7Gil4Clu7JE6l NdRfJw7e5vM8fWOgJUQeQ/SDN94df27Mp2KsHrnzik+eINgJqwTaArNu/wD0JjsnFglb zczW+Z71JYPHlTfLGYr8ck/3GJOXlcYi1CXQsZum88F2RlcGTip+oGhvkjtuwvM//bME i5RmRQ8AR0Sb5QvvB6rXuol5Mm3lbZVXkoAfmF86qhvxf8Fqq8Ka3/zwcAetc7BgRLiN GqouBnYrWxErlKp55BoWF4hMoSxWzB04a6rd3pSe8iXZW2X1jL8fqOffekLuNq0ylFP0 d5sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=Bszl0DwZ; 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=paul-moore.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo13-20020a17090b090d00b0024e22853a90si9624912pjb.170.2023.05.05.08.43.43; Fri, 05 May 2023 08:43:55 -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=@paul-moore.com header.s=google header.b=Bszl0DwZ; 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=paul-moore.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232921AbjEEPZu (ORCPT + 99 others); Fri, 5 May 2023 11:25:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232925AbjEEPZT (ORCPT ); Fri, 5 May 2023 11:25:19 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D70D1C0DC for ; Fri, 5 May 2023 08:23:47 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id 3f1490d57ef6-b9a6eec8611so14579391276.0 for ; Fri, 05 May 2023 08:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1683300216; x=1685892216; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4/3vTohp91jiKKtxYYXC9sZ4oDT0Wvdf7xVOWIDy7Fk=; b=Bszl0DwZbz8s+myurjfDruThE0Fu8MhipC9cyx9FTy3XiZxkMKgFbm867G2C7RFNbT OJczRbftk7euoqYCIpgBXpuyjmZnTE8jpjOwFvJJ3s/14zLgxyQjZjhqwtzHVIeb9rHH h70UHwRlPMA2MUR8cG2u9TKfm7m10YDCj7ZelEEfzTiSLn15zDrDojwEIkVgmD5VnDSv HsR7FB2fKjU/MVKSotN/8UpkcEqIFiaiWiww4pIvKGNGUKhbKawbk1skibuLteTKnxCc y4Xn865xcSP3LUMtcRXSqSyY6lp9eAE99FUGbpcL32FJ0gHXsTQpLgKCjmDkPqmv4uJC 8EbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683300216; x=1685892216; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4/3vTohp91jiKKtxYYXC9sZ4oDT0Wvdf7xVOWIDy7Fk=; b=OpN8sLIp0CSCOodg6uAYdUPVrxm08NVGJa7chV7NIydu6mvbe/P/kG/OYjvWXwtIAQ JbmoU1bAMkP2NyVyKMhn/xK4uv6PQxCzAWMAANG176CyxaWyV1banNThxX21rua8br5e dZHkgltl+HQW7RLG+0duto4DNItDBaXZSbP4/PtentwBrnqCDfgnwhyB+N7tfdod3I0m KzxGWwogkTgJ9yCdY1Q6nT3IkZBBGl/Uq02t80qMpVagpPnNDLTqeHuSivqjGc0LaH+K p1FSb1uubELw38MGjYCULEBPOAGH2x2jaGgcsAsm7MVP8G/mektSO/kFds5vqZmWhP8l NkuA== X-Gm-Message-State: AC+VfDyfjXPZfzowaU/dxOV4Zy0kwZCBI50R4QpzGgN3q/MKn4yrtS4S +z09wAFVhgq+Y2VVfJ9NMWoPGn6w/mpgWjJGRUbp X-Received: by 2002:a81:138d:0:b0:559:f517:a72d with SMTP id 135-20020a81138d000000b00559f517a72dmr2939441ywt.14.1683300215767; Fri, 05 May 2023 08:23:35 -0700 (PDT) MIME-Version: 1.0 References: <20230504213002.56803-1-michael.mccracken@gmail.com> <87pm7f9q3q.fsf@gentoo.org> In-Reply-To: From: Paul Moore Date: Fri, 5 May 2023 11:23:24 -0400 Message-ID: Subject: Re: [PATCH] sysctl: add config to make randomize_va_space RO To: David Hildenbrand Cc: Sam James , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 Fri, May 5, 2023 at 11:15=E2=80=AFAM 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_spac= e > >>> 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. ... > If we really care, not sure what's better: maybe we want to disallow > disabling it only in a security lockdown kernel? If we're bringing up the idea of Lockdown, controlling access to randomize_va_space is possible with the use of LSMs. One could easily remove write access to randomize_va_space, even for tasks running as root. (On my Rawhide system with SELinux enabled) % ls -Z /proc/sys/kernel/randomize_va_space system_u:object_r:proc_security_t:s0 /proc/sys/kernel/randomize_va_space --=20 paul-moore.com