Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2255983pxa; Mon, 3 Aug 2020 11:19:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2Vhy93SKkblk5ZU1Ux8H3ag01yq9AMiPK8jJ1Ygd8rBLuODhXPSPTniIvygc8THh09eqA X-Received: by 2002:a17:906:d042:: with SMTP id bo2mr17211459ejb.152.1596478749997; Mon, 03 Aug 2020 11:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596478749; cv=none; d=google.com; s=arc-20160816; b=sZNHP5L5mnW/MiurPbnDYCxUpDN3O6c1EGv93UXg+kdIA0wKN9+5Uvsy3028Qd/EQm VKTb5PxCtBpA5mIfNlieyV9eWGtEoSrfaSmdw7KK+/oFMQRrMbBX9U4iW0QkiLwa92VG 0p7kTRY7+O7K97qu7kDb77UHpV62+mGdAwY8xBoT/2pr77nVlzDoZb/xSBEAFwosVzXr oEtCyYbHncVCNV5jLR+oUYS9PfrPVHlUFcXn69O9vxCeu0Jhsrqsm/5xuxSTtPCZ5+ad sv1adQdASRNKFemhwmNug21VbyhdOc8yq3uQzPTefY7bPE0Js3hSP3QrpzuyukU1dDMh EuCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=VMw7i1cpHh8qkyXWE10tJgStQ1flp9PULSkxAaczHSg=; b=WFEh5khBRvSY2rz7PZmR1TlzJFTxiQi9cBbpjyf+E3LJCb3N1xh0gh27z3zXdOA0cg ofXeFSiwxn8cLsZoXUcxUM5mHfg9CtBawYtnR9f0tfH4zGmqt00K7j631G43yNsDJhLe 6Z+E7dL6IBxodk98EycyTolZzH98Sa5BACEoKQbGrlXOQZDR9enDCkGrbv7Zy+T4/kIy q8oVsbOfv0ADVatW/v5Zjca7iEEa/UjMUlP5cbS5pGlrlghMozJI6mDrq0sihzQ3Q0f9 qmzv/885Bcvq9+N+ICubJghsAwnwc1i4JKHQBra8s/CjZsXVBqKn+3w0coNvoaNoNgug QyYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cCctHbSS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si9921225edh.122.2020.08.03.11.18.46; Mon, 03 Aug 2020 11:19:09 -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=@redhat.com header.s=mimecast20190719 header.b=cCctHbSS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728467AbgHCSRw (ORCPT + 99 others); Mon, 3 Aug 2020 14:17:52 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:23947 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727076AbgHCSRw (ORCPT ); Mon, 3 Aug 2020 14:17:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596478671; 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=VMw7i1cpHh8qkyXWE10tJgStQ1flp9PULSkxAaczHSg=; b=cCctHbSS1Veo1mxBoJLr5RHvRM3el8ufQJ/6cPJt0pcqdhu9y8Scx5oeiA9XoVFoLqzYwI L7f09wup4sxg7/3Eqz2iJwVYXBKF9l7byk7fq1r3I4ZUOPsYTy6fjOIJQ/WkUurdC5/LmA uscN374vAx8r72DGG0CHfxH9l+KUgF8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-fFB4_STrOvKdjZdsookBXA-1; Mon, 03 Aug 2020 14:17:46 -0400 X-MC-Unique: fFB4_STrOvKdjZdsookBXA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51F418017FB; Mon, 3 Aug 2020 18:17:44 +0000 (UTC) Received: from [10.10.114.255] (ovpn-114-255.rdu2.redhat.com [10.10.114.255]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45C4274F58; Mon, 3 Aug 2020 18:17:42 +0000 (UTC) Subject: Re: [PATCH v4 00/10] Function Granular KASLR To: Kees Cook , Evgenii Shatokhin Cc: Kristen Carlson Accardi , Miroslav Benes , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, arjan@linux.intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, rick.p.edgecombe@intel.com, live-patching@vger.kernel.org, Josh Poimboeuf , Jessica Yu , "Frank Ch. Eigler" References: <20200717170008.5949-1-kristen@linux.intel.com> <202008031043.FE182E9@keescook> From: Joe Lawrence Message-ID: Date: Mon, 3 Aug 2020 14:17:41 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <202008031043.FE182E9@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/3/20 1:45 PM, Kees Cook wrote: > On Mon, Aug 03, 2020 at 02:39:32PM +0300, Evgenii Shatokhin wrote: >> There are at least 2 places where high-order memory allocations might happen >> during module loading. Such allocations may fail if memory is fragmented, >> while physically contiguous memory areas are not really needed there. I >> suggest to switch to kvmalloc/kvfree there. > > While this does seem to be the right solution for the extant problem, I > do want to take a moment and ask if the function sections need to be > exposed at all? What tools use this information, and do they just want > to see the bounds of the code region? (i.e. the start/end of all the > .text* sections) Perhaps .text.* could be excluded from the sysfs > section list? > [[cc += FChE, see [0] for Evgenii's full mail ]] It looks like debugging tools like systemtap [1], gdb [2] and its add-symbol-file cmd, etc. peek at the /sys/module//section/ info. But yeah, it would be preferable if we didn't export a long sysfs representation if nobody actually needs it. [0] https://lore.kernel.org/lkml/e9c4d88b-86db-47e9-4299-3fac45a7e3fd@virtuozzo.com/ [1] https://fossies.org/linux/systemtap/staprun/staprun.c [2] https://www.oreilly.com/library/view/linux-device-drivers/0596005903/ch04.html#linuxdrive3-CHP-4-SECT-6.1 -- Joe