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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A85A7C433ED for ; Tue, 27 Apr 2021 22:58:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74F6D61402 for ; Tue, 27 Apr 2021 22:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235420AbhD0W7P (ORCPT ); Tue, 27 Apr 2021 18:59:15 -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-Google-Smtp-Source: ABdhPJz2smX0IXcQ12KDTvvczsej3/4e1ExBTvxs12ZncPpHAXGAlCAocFZngK+A9ulNrmxn+uRjiA== 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