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=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 58296C43331 for ; Fri, 27 Mar 2020 10:44:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2777720578 for ; Fri, 27 Mar 2020 10:44:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="Tt4Slj01" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727143AbgC0Ko6 (ORCPT ); Fri, 27 Mar 2020 06:44:58 -0400 Received: from mail.skyhub.de ([5.9.137.197]:38290 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbgC0Ko5 (ORCPT ); Fri, 27 Mar 2020 06:44:57 -0400 Received: from zn.tnic (p200300EC2F0CFA00088B6946FACBDF73.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:fa00:88b:6946:facb:df73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 1194F1EC0B55; Fri, 27 Mar 2020 11:44:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1585305895; 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:in-reply-to:in-reply-to: references:references; bh=36XQm7d4lMVCZuRlrLozamodSN2VpWOmzGzo6pyRJKE=; b=Tt4Slj01uST/5gy1rV78Uf0LbXrcpwnjNLrR6hesYZEwbLI/5lIgFAVRMJZIpMfYXOeJeL 2REanSZL6unXq+fB/wvNAeTdxf2xHakJpcLsocTdRqdjOSpF5oWHY1tUhSEm/F58ajID+d yHYHUvLu2Art8dYwjS6LZv1/CnRGKiM= Date: Fri, 27 Mar 2020 11:44:50 +0100 From: Borislav Petkov To: "H.J. Lu" Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Thomas Gleixner , Kees Cook , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, Yu-cheng Yu Subject: Re: [PATCH] x86: Discard .note.gnu.property sections in vDSO Message-ID: <20200327104450.GA8015@zn.tnic> References: <20200326174314.254662-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200326174314.254662-1-hjl.tools@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 10:43:14AM -0700, H.J. Lu wrote: > With the command-line option, -mx86-used-note=yes, the x86 assembler I see: -mx86-used-note=no -mx86-used-note=yes These options control whether the assembler should generate GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_FEATURE_2_USED GNU property notes. The default can be controlled by the --enable-x86-used-note configure option. Is there a plan to use this build option in the kernel in the future or all binutils will have it enabled or what's the story here? Because I don't see -mx86-used-note used anywhere in the kernel... > 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 > x86 kernel vDSO 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 */ > eh_frame_hdr 0x6474e550; > } > > The NOTE segment generated by vDSO linker script is aligned to 4 bytes. > But .note.gnu.property section must be aligned to 8 bytes on x86-64 and > we get > > [hjl@gnu-skx-1 vdso]$ 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 > [hjl@gnu-skx-1 vdso]$ > > Since note.gnu.property section in vDSO is not checked by dynamic linker, > this patch discards .note.gnu.property sections in vDSO by adding Avoid having "This patch" or "This commit" in the commit message. It is tautologically useless. Also, do $ git grep 'This patch' Documentation/process for more details. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette