From patchwork Wed May 29 16:59:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kleber Sacilotto de Souza X-Patchwork-Id: 1107265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45DcQJ73ZPz9sCJ; Thu, 30 May 2019 02:59:52 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hW1vY-0007Nv-3V; Wed, 29 May 2019 16:59:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hW1vW-0007Nc-E1 for kernel-team@lists.ubuntu.com; Wed, 29 May 2019 16:59:46 +0000 Received: from mail-wm1-f70.google.com ([209.85.128.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hW1vW-0006EZ-3g for kernel-team@lists.ubuntu.com; Wed, 29 May 2019 16:59:46 +0000 Received: by mail-wm1-f70.google.com with SMTP id o127so1238090wmo.0 for ; Wed, 29 May 2019 09:59:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=wvPJhjHPH9/nnjm8tqqu8cB5POz6MsUnZG2cSRZ3W0o=; b=JFfcMklsR5xxcln5Sn1+7IBCmBVGcBQZg5mpRuRz3FXbbPqP4zEZJ+9GXtnNFhZnW3 HFm3ufIW9QNFISaDaIpLYcGK410WMwbDe323nk747fxcEcibRNNq8oaxe1oxI3VN+adY c7ZL2qqnTjOFZd5WzaxFym0SZGehpj8ywL6jFn7IWwc9pBdZWIwBUmtEui+lpsf2FBVv ecuRU96qU+5F0NyB5Vwd6lq5knAOKz0asTdih4pMXe12yXLlQUHsof0in12AAKngAROP zQWwBVe7fGvmvVm65/aUKlVGG5XBZwPIVU1l48GLPXngVL9r/voibN476/ADeWrSzDXP iH1g== X-Gm-Message-State: APjAAAVNRfcmlwcUdOnXnIRmKcM8VBrLd0HzSJFBP7a1O3yxDUwuXJBG HWkALIChh22Z9t7PBwWtFlz9DpeDvRHkJbZj2cGHngFRwYYqixnPmRGXVvs0sj05UGf00vz6wX4 qUh0CuZJf8y2omxKYmZfe9vkgoTo8Y8tt02y3hK9vDw== X-Received: by 2002:adf:e344:: with SMTP id n4mr30260282wrj.192.1559149185641; Wed, 29 May 2019 09:59:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9xK5ywDxL7h+UnIiNNJsCFIr65K8ROzJUQ95yglaRE64S1QxiTZsOLD/o8JSrs5LJlR1w/w== X-Received: by 2002:adf:e344:: with SMTP id n4mr30260273wrj.192.1559149185426; Wed, 29 May 2019 09:59:45 -0700 (PDT) Received: from localhost (ip5f5aee38.dynamic.kabel-deutschland.de. [95.90.238.56]) by smtp.gmail.com with ESMTPSA id z25sm6985500wmi.5.2019.05.29.09.59.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 May 2019 09:59:44 -0700 (PDT) From: Kleber Sacilotto de Souza To: kernel-team@lists.ubuntu.com Subject: [SRU][Xenial][PATCH 1/1] x86/vdso: Pass --eh-frame-hdr to the linker Date: Wed, 29 May 2019 18:59:44 +0200 Message-Id: <20190529165944.17004-2-kleber.souza@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190529165944.17004-1-kleber.souza@canonical.com> References: <20190529165944.17004-1-kleber.souza@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Alistair Strachan BugLink: https://bugs.launchpad.net/bugs/1830890 Commit 379d98ddf413 ("x86: vdso: Use $LD instead of $CC to link") accidentally broke unwinding from userspace, because ld would strip the .eh_frame sections when linking. Originally, the compiler would implicitly add --eh-frame-hdr when invoking the linker, but when this Makefile was converted from invoking ld via the compiler, to invoking it directly (like vmlinux does), the flag was missed. (The EH_FRAME section is important for the VDSO shared libraries, but not for vmlinux.) Fix the problem by explicitly specifying --eh-frame-hdr, which restores parity with the old method. See relevant bug reports for additional info: https://bugzilla.kernel.org/show_bug.cgi?id=201741 https://bugzilla.redhat.com/show_bug.cgi?id=1659295 Fixes: 379d98ddf413 ("x86: vdso: Use $LD instead of $CC to link") Reported-by: Florian Weimer Reported-by: Carlos O'Donell Reported-by: "H. J. Lu" Signed-off-by: Alistair Strachan Signed-off-by: Borislav Petkov Tested-by: Laura Abbott Cc: Andy Lutomirski Cc: Carlos O'Donell Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Joel Fernandes Cc: kernel-team@android.com Cc: Laura Abbott Cc: stable Cc: Thomas Gleixner Cc: X86 ML Link: https://lkml.kernel.org/r/20181214223637.35954-1-astrachan@google.com (cherry picked from commit cd01544a268ad8ee5b1dfe42c4393f1095f86879) Signed-off-by: Kleber Sacilotto de Souza Acked-by: Stefan Bader Acked-by: Connor Kuehl --- arch/x86/entry/vdso/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index 297dda4d5947..15ed35f5097d 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -159,7 +159,8 @@ quiet_cmd_vdso = VDSO $@ sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \ - $(call ld-option, --build-id) -Bsymbolic + $(call ld-option, --build-id) $(call ld-option, --eh-frame-hdr) \ + -Bsymbolic GCOV_PROFILE := n #