Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp70216imu; Fri, 14 Dec 2018 14:38:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/U5WGjpeuZzFHi2+z9BMNMj+koocOfEvElBaK7u7Y0k1jvctSPsFIsSY4JA08ijPWzR3SsA X-Received: by 2002:a63:5320:: with SMTP id h32mr4322137pgb.414.1544827125313; Fri, 14 Dec 2018 14:38:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544827125; cv=none; d=google.com; s=arc-20160816; b=anuhadSH6h8cip6xcV8YxIdj+9znbDDH20TJuSlaDrRWOUD5QQju1zwc8U2AbKv6yq BKthIidXABH5zKcSzAFPSHp6j9vjkyQsQsXrcmZh6SK++bCgGAm/ct6lh+/zGr4OLB8t /Th4N3GCh3oWRsMOTycSKWUKqeOl4HLbwXHQtqfJ7xjZm3HV4gFcdCxtVlSC+EEKX9uI QoC0b2CmPxNg6P8DMq3cGyxblDaICdWYMrRVLUueiLele9q/aH32ooimySqsjStyLQdq qgqZkBQiPOy6HAxpUi51mU966E69I6BxTBQ0812kQQOOP8ErKTgm1rPca4m8KB4H6ggC Y3/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=Hpzgkb+ogGIKg/j787d6nVH8o5+QCYiKn6+Dg9Y4Tz8=; b=lfZn+Okkt0pGjMgDqFTFn+qzalNxgvTbBsNlfgIsG+ofPUU3YfeyWOXDxiJ5iehVnq hCzvFTk09b9JLvhwX1srICon2kvgl8cxy/khhEkgT5n1fImqk+uLCcwNBfCot1iZ8d4y r+lPXX6UleijoNEk6TDZzljvEmKKF1G/E4+JDP3ZgH3j2M806XpOPEi74fQwCWfXBlEx ow8HXclERCjMy5tfThmQnptL7/h8k+bas8NRr7w4pasiyV7FbOHvxebDglb3HxrtsQeg Hcl5DUuldfvlt8/s47XpY4pX9TcGuoWNwv5G+RVv/wWBu0sHp48r5c7ClWwpvSd3bRQo 62tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JhfNz3FO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t75si5124203pfa.170.2018.12.14.14.38.30; Fri, 14 Dec 2018 14:38:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JhfNz3FO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730403AbeLNWgl (ORCPT + 99 others); Fri, 14 Dec 2018 17:36:41 -0500 Received: from mail-qt1-f202.google.com ([209.85.160.202]:56249 "EHLO mail-qt1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730165AbeLNWgl (ORCPT ); Fri, 14 Dec 2018 17:36:41 -0500 Received: by mail-qt1-f202.google.com with SMTP id b16so6936003qtc.22 for ; Fri, 14 Dec 2018 14:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=Hpzgkb+ogGIKg/j787d6nVH8o5+QCYiKn6+Dg9Y4Tz8=; b=JhfNz3FOcVMstZ3FKMfb+iXqWygEqsknFsC3o5+DZ7P1tH/7VaXpiiHHuvAaMY7v8k dHIgWOsVZL+Iy+a80bCiJpVVOU/GeiVJi9dC00pfpeI9JyOMceRK+cB2yP0Z9GekHZg3 5NwzQnFB/EGr4FLOYWvWyxiRz3ohWbx2ukq0W0kaJudB2nwbFf+GUCIPCmplWy58hWWu g76Ic4n+ndaj5AOd1bm85ISwpiaQFlj3uLTfjLB5aBJqRVJeceU4YIgcMSO6RKgT0HEP wEIEnROaU63Pj3KXvUpvAKPNpYk0xLi6O7AOpvGewAP5hWeO8q7By5FhVg1a7NWRAcpr oWpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Hpzgkb+ogGIKg/j787d6nVH8o5+QCYiKn6+Dg9Y4Tz8=; b=doq4pQVowGqGEBqPmaHp4nju3dc0GD5GV+O32KPpYNLopOyjqziFxVTr6Ze0oTkW2l RgaE0kBw3Fpu7NpCIuDGrIKRQuIO5X+aTw/ZD2+w1HhtwmZOQioPm/9pCsjmsdEkleZv SwZTnvQjmKdIKGEdOjz2bw+78bBzGdOjkbKlnp111d09j1AQ5Nc5vTM6uZ/UB8nYLtCZ IHXHyGT8Y4UEo4RGc1P+t7gL3M2lAerTjIEgsWl8E8psDawMImlpe4GFjSpzDRJneSAc pyFOGU6czga2UAy9IUp+lbeofMHRgTcsdMoUBYOUy03kyDvyJnVi5hpNtNy1u2t+dkMl IC2A== X-Gm-Message-State: AA+aEWb83z2FuofvdZs3zCD1LxS17FK9tUa0SVz6QJu5ksj32g6jleW4 97IEZJhhnkga9p96oc8S4cWf3Govdtt4ZoxOWcnOYT9YcLaGIY/wp+A0DHa/Pkc+9t/DpuR70rn oI/zVj5Gw6teb2PLukRox1khf0zbQUNPMTABCIosXgsdqcSWW73YwAgx3EW0/m1gdh1Ts3sjo3u KGHw== X-Received: by 2002:a0c:9e60:: with SMTP id z32mr4798720qve.0.1544826999928; Fri, 14 Dec 2018 14:36:39 -0800 (PST) Date: Fri, 14 Dec 2018 14:36:37 -0800 Message-Id: <20181214223637.35954-1-astrachan@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.0.405.gbc1bbc6f85-goog Subject: [PATCH v2] x86: vdso: Pass --eh-frame-hdr to ld From: Alistair Strachan To: linux-kernel@vger.kernel.org Cc: Florian Weimer , "Carlos O'Donell" , "H. J. Lu" , Laura Abbott , stable@vger.kernel.org, Andy Lutomirski , Thomas Gleixner , "H. Peter Anvin" , X86 ML , Joel Fernandes , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201741 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1659295 Reported-by: Florian Weimer Reported-by: Carlos O'Donell Reported-by: "H. J. Lu" Tested-by: Laura Abbott Fixes: 379d98ddf413 ("x86: vdso: Use $LD instead of $CC to link") Cc: stable@vger.kernel.org Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: "H. Peter Anvin" Cc: X86 ML Cc: Joel Fernandes Cc: kernel-team@android.com Signed-off-by: Alistair Strachan --- v2: Updated commit message, no changes to the code 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 141d415a8c80..c3d7ccd25381 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -171,7 +171,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 # -- 2.20.0.405.gbc1bbc6f85-goog