From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 476B9C433B4 for ; Wed, 28 Apr 2021 08:51:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01FFB613B1 for ; Wed, 28 Apr 2021 08:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237716AbhD1Iwh (ORCPT ); Wed, 28 Apr 2021 04:52:37 -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-Google-Smtp-Source: ABdhPJzQdhdfR7hl9GS/+BN8nNAkCne6d9vHOW2kGmVMdLhDbOmWhIDAR0Hrl+u9Om22RRH9wejf0vcOt8LdWD122hg= 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