Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4918206pxy; Tue, 27 Apr 2021 16:00:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLNn8Le/q8z/MSPa68uoCL21ss3o//Tim9ikNcYISompuUyRb3w15WhYpn1y2lYHzotOuU X-Received: by 2002:a63:5a55:: with SMTP id k21mr23816277pgm.312.1619564420274; Tue, 27 Apr 2021 16:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619564420; cv=none; d=google.com; s=arc-20160816; b=YmftbKNYJvRZkYlG8v+TpN1h04PoCkpYW0mBOw+R6RoWPoY3IOf8R9DSOs2XofrV1i mKZJNv7eyeOVNxx7BZgy4ybm/jIYQwNLbUH6Dj9VMtI+1XuRpHGNaM/WEVzF1Bx8CgLy NkHK7zGDrdB7ve2Z3tqFOwdRjXn9s04pVaqNB99yLB9hJ2USXwS+1FXz5RFNhjgB6Dxp 75BmukWfToThnXpipZRwr4jPbLPVTh5bKLR8haTuI6E53bvyZGgNFyt7aS5PkR+zsq2h Fp5rvLD7FTk8nfQL9Rbm9S6AvG6NXGI4P0aCS+NnaoeBsjjCXGhnLZ/KCANejb3+cphA KLPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=j981qgFtuq6fxvASGv/oGF89vtoeN/Z0NvemUV1hOwQ=; b=IC9rLjBH3HPm5v4WfRvICSwUW7AePtUBXUWw5YzUAXica7Uvg5caGjfOP2GSpdqehG 5JAy2mRjt016y5W3R3Nv2GuUive/QdEx5tRO1QqXHA/SNjNLPhWjz7BqHwMPncsfCnnx +GdrxqTjtMbRRyUhHHx6YuVl7CcF4O1R3ep/qByNgTKHfxhhUcWQPeQcAd1aqfAho7Si moYA9xE+A6lFFI3Epwq3sKGkWmG0HRxHYOddsK8EqQbtzJJKCsB5DEU+fhX7xJ8DpDFq OhWnFYJSydNZ9FriuNQjFdt8gXvt7bVv+7eVSUwkAFBI8PrmNZWTLHHt3yS+AqbcOkND wTrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eMNwqZvi; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si4737419pfp.229.2021.04.27.16.00.03; Tue, 27 Apr 2021 16:00:20 -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=@chromium.org header.s=google header.b=eMNwqZvi; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239426AbhD0W7O (ORCPT + 99 others); Tue, 27 Apr 2021 18:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235395AbhD0W7J (ORCPT ); Tue, 27 Apr 2021 18:59:09 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACFD5C061574 for ; Tue, 27 Apr 2021 15:58:25 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id j7so33996079pgi.3 for ; Tue, 27 Apr 2021 15:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=j981qgFtuq6fxvASGv/oGF89vtoeN/Z0NvemUV1hOwQ=; b=eMNwqZvisi/AEYs+s/j2rYEwpIK7mfT3y2VNF93m2aZf6cv/xm3EqCRd1YYQiLu+Ig +Eo2YaS7O6RGHL5PfjWD8W4UbrOhrlUY4J9PeNEhX+m+sLXto+2lCuLamJHySwM0uB25 cOoKplxtQYeXK691N+YX9kf7MWv8Z85+u6P40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=j981qgFtuq6fxvASGv/oGF89vtoeN/Z0NvemUV1hOwQ=; b=deRdZA2CHNZ0YlC17a/avdxzmzhi/BD/OHJ8IrMZB6bWXOg8wex9N+7/4qu3S2pIvQ 9Bn+MsUZobQifjB5FUPFdipJGOXEzNm5S7LdP4UBYmEkBOHmxmqfGbXAZNrJofduenqo x910d+hmEcutDdXebguICyNjCPSrZW5AWMmBesHpTqdKlucaz2Xsd9bxxrqoQjn5TwZ2 bgsIPC018CJfJn8zFOp5TJMBJsCUgcwqwEfbOmqOnPtPsdN6uMzItGItDSwUbep6UakK trMXZxpmzcNhG9keYWi/gTx0TKlwwtJiNa87oDlpqmcR2zUkfi0cS3PktSeynUHSS3lh Np3A== X-Gm-Message-State: AOAM533LRf4G7lv8vnITSJ94q0jKwf3tiaDh0FHlxSEpiu9ACGAy2i7F X/4guff6jkWFI3NsJzOxtcdCJQ== X-Received: by 2002:a63:ff22:: with SMTP id k34mr23954095pgi.336.1619564305243; Tue, 27 Apr 2021 15:58:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id fy1sm3353275pjb.14.2021.04.27.15.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 15:58:24 -0700 (PDT) Date: Tue, 27 Apr 2021 15:58:23 -0700 From: Kees Cook To: Bill Wendling Cc: Ard Biesheuvel , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64/vdso: Discard .note.gnu.property sections in vDSO Message-ID: <202104271557.412DD365A@keescook> References: <20210423205159.830854-1-morbo@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210423205159.830854-1-morbo@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 23, 2021 at 01:51:59PM -0700, Bill Wendling wrote: > The arm64 assembler in binutils 2.32 and above generates a program > property note in a note section, .note.gnu.property, to encode used x86 > ISAs and features. But the kernel linker script only contains a single > NOTE segment: > > PHDRS > { > text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */ > dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ > note PT_NOTE FLAGS(4); /* PF_R */ > } > > The NOTE segment generated by the vDSO linker script is aligned to 4 bytes. > But the .note.gnu.property section must be aligned to 8 bytes on arm64. > > $ readelf -n vdso64.so > > Displaying notes found in: .note > Owner Data size Description > Linux 0x00000004 Unknown note type: (0x00000000) > description data: 06 00 00 00 > readelf: Warning: note with invalid namesz and/or descsz found at offset 0x20 > readelf: Warning: type: 0x78, namesize: 0x00000100, descsize: 0x756e694c, alignment: 8 > > Since the note.gnu.property section in the vDSO is not checked by the > dynamic linker, discard the .note.gnu.property sections in the vDSO. > > Similar to commit 4caffe6a28d31 ("x86/vdso: Discard .note.gnu.property > sections in vDSO"), but for arm64. > > Signed-off-by: Bill Wendling Seems good to me. If we ever need the BTI markings, etc, for the vDSO, we can revisit it then. Reviewed-by: Kees Cook -Kees -- Kees Cook