Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp176624pxy; Wed, 28 Apr 2021 01:53:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK9UeCvXIME4SpImWG1M53WLIVaqMRK+ktHV9sL1cVS4poxmiuyhqlQEKU5op+oj8gjGEE X-Received: by 2002:a17:906:4a90:: with SMTP id x16mr27774126eju.44.1619600012903; Wed, 28 Apr 2021 01:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619600012; cv=none; d=google.com; s=arc-20160816; b=SNGZy7XIX/sl2KvyLpBDSsuodlTS0LJjoYq7H1+3Zw2StLIhxKGT0/rTWo/vZeKEy5 0o0W9a+ojubk0/FPZP0Iq5LuimyClDu8a+uFvkfud0kQj3JkQ7eJ223wry0qk8dnhsZF 8z9HO5oxn8HbFIePUw9LlPkv0OIvpudXdF2SbQR6ZArV+ecRruuuaKBwAWHgOv6OlCIl fX2+x1WA2jUbw9kau9BY2G5dZgVew3zcnMAsBkB+HrhLW0MdJbN1IJvK2bnrelJx9Lsr fQZXX7JRaY/t7o+Fk35PVCxzCRlxLInqqE/AyxLNJqo/EqsP0KH6zZ/UsNNzwF6sPiLO 0HRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tVN9f9JUXKLjcXiALvY3oz9EgauDC1lk0x0jH21ydLQ=; b=sjEguHB1eAVmYOtTxuH/2v5XwUzmopwVqDKPpvfNPbURtzRJJJAmgIUv3oxavv/E20 LQpIISp1sbyOM/kEzFgXrKG/ykuuaA4XubbLncx3iQG022pE6D6NxuYsBsZREqL0d9Fo cp4yJ6OpRZQNfdmPha1jrhoLXHXM36ZwaUL3iwA1y/XA1RuLD592SFHNJBy5p1rftQM+ OWYVTS0dmmZSA5bVAqdvxriUvkKFglSbP7m1UPQXgl9t8uCTWT78XukkcYnlbSX+cztF TzsFA6gmK9N0+l7f9canzW3W+QUxeQZhJ9f+EovuJLYEzJQBGQpJy3bhO0uMNWHM28SJ KseA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAs9plRb; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si5074061edq.562.2021.04.28.01.53.09; Wed, 28 Apr 2021 01:53:32 -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=@kernel.org header.s=k20201202 header.b=TAs9plRb; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230192AbhD1Iwg (ORCPT + 99 others); Wed, 28 Apr 2021 04:52:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:39118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237167AbhD1Iwf (ORCPT ); Wed, 28 Apr 2021 04:52:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D56F261418 for ; Wed, 28 Apr 2021 08:51:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619599910; bh=DwC5HXGO+SMcxoToQXvRD9FRL1XMAMGE30AHfo+wM5w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TAs9plRb6NQSmWN05MVLB1ZoXs3NdyjMcxsnCi7PJ154aKb1fBLlVuoNgTg/g9ts3 vsyYfgxButiqJU+vrITsNfIIeqmb9dudGijLTro3DoFUmb+a4DCJqfG0y/zgM8EUYb vehaJMYRWdtC9zQhH9CMxbioP93Fj0z8DDxYjNQw/q+hl2P1Uaf5E+UoTG5Kzr/X5W GKOUIwPiqtLyv486Oddz5/44uAPW2dEDBtGP+/OfMpTEC4JiXxXoGbaKYNjjEDWGyw mgldd94fD08PnEfvzhzSGpu3ulZp2MlhqMEkGwKWanG4QbmmgUc3qS13tHbrt42JZP ql40+rbc6NVtg== Received: by mail-ot1-f49.google.com with SMTP id 65-20020a9d03470000b02902808b4aec6dso52981910otv.6 for ; Wed, 28 Apr 2021 01:51:50 -0700 (PDT) X-Gm-Message-State: AOAM531cito0qqxHfONqnYwY/inH9d9S6dVypWlhbbSYv8UYF3gS8pgt 2ypj1q5EAjmBNRaxa91671reafwKrahBJCLX2Ac= X-Received: by 2002:a9d:311:: with SMTP id 17mr22887790otv.77.1619599910047; Wed, 28 Apr 2021 01:51:50 -0700 (PDT) MIME-Version: 1.0 References: <20210423205159.830854-1-morbo@google.com> <202104271557.412DD365A@keescook> In-Reply-To: <202104271557.412DD365A@keescook> From: Ard Biesheuvel Date: Wed, 28 Apr 2021 10:51:38 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64/vdso: Discard .note.gnu.property sections in vDSO To: Kees Cook Cc: Bill Wendling , Catalin Marinas , Will Deacon , Linux Kernel Mailing List , Linux ARM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Apr 2021 at 00:58, Kees Cook wrote: > > 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 > Acked-by: Ard Biesheuvel