Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1482198ybh; Sun, 8 Mar 2020 05:29:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsG1WIyWSvlAzkmA/qZYItzr8LNYLBxG1HOVpGNP3WQLOMvzjLcXNVdHvHwXSmdZgfQ9HhT X-Received: by 2002:a9d:6b1a:: with SMTP id g26mr987759otp.2.1583670576603; Sun, 08 Mar 2020 05:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583670576; cv=none; d=google.com; s=arc-20160816; b=RXV7iO/g8QBw77YBgXxwMKSy6GSlRfGyzcOwwXcdaw43ZvFiV/9tJ4zhKefxsReNDY HiVJxexqXckA3fo7iIY9SfUdAC3NIz1w7mHpwy7M6kgLL/8bMC9E6/GrsWHX+xC9fH9n dWPYfBp4M1iby4UgUPkKy6+WB+UOpC434uyoflemiRVMMjecSHd2pufURGpZvhzUeIuP jWzzm2vPoIWFD9LhEd6CG1OZn3FMz47h6YxNXeYKQcojqLLSNq/I9mCc5x9PCoN6z8Ki Fg8HzGp2E6b5cZswSEmpDk3kiQ2k9vismfSu1q8uEmw8aT5KUiehF91Jwtkq8dojqQvF /3og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Bg6XtXqrF594qxk1LLTmkQZGRuT62M+iWLZfIav8sMc=; b=ecnerXBDNgigUaF5oaZXh91hNCzHJGdLxrwSkcCHiETtGS4GdHOStpL6rxfdgKxvsO hO+dUhLho+RVQpDCTlpB7ui50jsKOpkXEtrC5ZTRBwuWtAxcIjnvp/VOJgBhpaCfefUO 9Ymv83UAua4AdP6gVhLJZU5k/BdRqVGu1QveBG2aO5t8M6SHtzC6pxTNU8r7ZJiHleFR Rhc/c4BXsHz4H01tKDWRTJc1gPcf5WcYpek/yXdrYkRe0LRVPCv1I7WSSdeU2F0uXe8Z 2KHMQsb0U1epC35+fL7IOd53PUv2OQXxwF8aM+dui37vLxGnNWoMopR6QhnE9r6ia7gQ MQpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x68si2698083oix.277.2020.03.08.05.29.14; Sun, 08 Mar 2020 05:29:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726281AbgCHMZd (ORCPT + 99 others); Sun, 8 Mar 2020 08:25:33 -0400 Received: from sg2plout10-02.prod.sin2.secureserver.net ([182.50.145.5]:60616 "EHLO sg2plout10-02.prod.sin2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgCHMZd (ORCPT ); Sun, 8 Mar 2020 08:25:33 -0400 X-Greylist: delayed 440 seconds by postgrey-1.27 at vger.kernel.org; Sun, 08 Mar 2020 08:25:33 EDT Received: from mail-oi1-f172.google.com ([209.85.167.172]) by :SMTPAUTH: with ESMTPSA id AushjL9TYO6ZBAuskjSSOO; Sun, 08 Mar 2020 05:18:11 -0700 X-CMAE-Analysis: v=2.3 cv=BaWmLYl2 c=1 sm=1 tr=0 a=Y+b99WSDUBXwRGtcog24Ag==:117 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=SS2py6AdgQ4A:10 a=1_j9CwCaYTysT8vyirYA:9 a=QEXdDO2ut3YA:10 X-SECURESERVER-ACCT: kaiwan@kaiwantech.com Received: by mail-oi1-f172.google.com with SMTP id l12so7374731oil.9; Sun, 08 Mar 2020 05:18:10 -0700 (PDT) X-Gm-Message-State: ANhLgQ0qMGNtbgT0CLSw7vFCRkXqWhn8Tv1o7mrYdIm0JByBZM66CeVW aBi5pUB+1C3DzKJxidAisBPB2IvvO2FEX6njS90= X-Received: by 2002:aca:5044:: with SMTP id e65mr8541289oib.28.1583669887378; Sun, 08 Mar 2020 05:18:07 -0700 (PDT) MIME-Version: 1.0 References: <202003021038.8F0369D907@keescook> <20200305151010.835954-1-nivedita@alum.mit.edu> In-Reply-To: From: Kaiwan N Billimoria Date: Sun, 8 Mar 2020 17:47:50 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] sh: Stop printing the virtual memory layout To: John Paul Adrian Glaubitz Cc: Arvind Sankar , Kees Cook , "Tobin C . Harding" , Tycho Andersen , Kernel Hardening , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-CMAE-Envelope: MS4wfA50qyIlkVVHqwvhiVy51LCaeXikHE5ZfTHtJvQTeBKBpAxc3GA5+SHnjOiUpG4oZ00GXu12yjgqmiWDaw2sy0G1CK2UJ6H2oPsgrMOQUtKUF4nr+Pcf fN+MoFxTSylJOAo3i4JthnH6SMKgdVx3I5bgd4i9ByHqA7m2lT/3ZZp22V4ZBXChA36IplHl/lTN5ge6JRvBTfU8sB8dwBuUr5weO7herzpDdEttfo/bp+3m i+drPBLWNmwItSVko4UtZQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 5, 2020 at 8:48 PM John Paul Adrian Glaubitz wrote: > > On 3/5/20 4:10 PM, Arvind Sankar wrote: > > For security, don't display the kernel's virtual memory layout. > > > > Kees Cook points out: > > "These have been entirely removed on other architectures, so let's > > just do the same for ia32 and remove it unconditionally." > > > > 071929dbdd86 ("arm64: Stop printing the virtual memory layout") > > 1c31d4e96b8c ("ARM: 8820/1: mm: Stop printing the virtual memory layout") > > 31833332f798 ("m68k/mm: Stop printing the virtual memory layout") > > fd8d0ca25631 ("parisc: Hide virtual kernel memory layout") > > adb1fe9ae2ee ("mm/page_alloc: Remove kernel address exposure in free_reserved_area()") > Aww, why wasn't this made configurable? I found these memory map printouts > very useful for development. Same here! IMO, the kernel segment layout is useful for devs/debug purposes. Perhaps: a) all these printk's could be gathered into one function and invoked only when DEBUG (or equivalent) is defined? b) else, the s/pr_info/pr_devel approach with %pK should be good? -Kaiwan.