Received: by 10.223.176.5 with SMTP id f5csp1637057wra; Wed, 31 Jan 2018 09:15:16 -0800 (PST) X-Google-Smtp-Source: AH8x2276tRzC4V7GTpPOWC+LvheZOAP91F1T5880haCm+k49MthCcrvpEhzbT70rYbLxrdGkB2GA X-Received: by 10.98.68.91 with SMTP id r88mr34431523pfa.52.1517418916078; Wed, 31 Jan 2018 09:15:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517418916; cv=none; d=google.com; s=arc-20160816; b=cz5pW406EYqbvjcTJlEnRQapVhFcmVuJ/+br/JE7GrOmbIe7h/Q9cffG+4eszKWybS gz/dOI6uKaQ3eIJBEZ+GXfSbX5d+Xx/OwBJTT0PdVqcKi3NYHs7RFb5P6rwhZbgaC2a4 hkwyQ+GBOO4I1TsHJ3uM1Ae6YF7vG3h6TBHzbq9+xsbmKK5jCynDR+Q41m1eB2fnFHBF mknzgMPhkEHFUKzQ6FI9z+h2+K1LGV58s8Uvck6nxW7XZPsTd+lATQiA7cpVm/8FPf2j s96SHtT3pWY1u7Gsos2J6UGcFbE8UhqIhX+DUn/DnlmRNqVsOq58q5c0HppaxYlYdwlB V+4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=1eKm/rdpvhyfHW/OVHtK+zIgptvZreC2OeMt8zDfjOk=; b=YHTK+bH52cUX2V/Jf3b3Z52SRo6v/6Dtv7yYP6iQdUYzBF8r8QX3CnSGXh+j3KDI/T +1tPrJG8GGSRJY1oNRMnSRPhgbvM3BsI14oD2BOO52zoehQo4OShQhFrqht3o/INkDa1 8ad79VBaaVjKY3+hQAo4XkF6VacXg9gIRBwnvVrvgnnROGbJQKJADbByy0Q5wLEBQ1ZH sAYuoEVThz+kMYPlk+pJjP6isCWeNdkAg3oji3ADKuXrhtmMPI1LSV7Y/QZMazjA6GQU Ohjbzus2V/qu9mBUhJJ2ZsGjLnATibBoNpW/RPDSccE2ZWEe9SW8qUO28TvLTsaMn6mL +tbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=QrNMjnY/; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q80si1985323pfj.362.2018.01.31.09.15.00; Wed, 31 Jan 2018 09:15:16 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=QrNMjnY/; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753980AbeAaQfw (ORCPT + 99 others); Wed, 31 Jan 2018 11:35:52 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:34067 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752378AbeAaQfv (ORCPT ); Wed, 31 Jan 2018 11:35:51 -0500 Received: by mail-io0-f195.google.com with SMTP id c17so15832652iod.1 for ; Wed, 31 Jan 2018 08:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1eKm/rdpvhyfHW/OVHtK+zIgptvZreC2OeMt8zDfjOk=; b=QrNMjnY/eA1fgoIExxDgz90juh8HsWxV0HcX5GFJCxlIA94OUgY/nljoIrZ7n6NBDX Ic+E84oLL+5dmfCx+xR5N9/TAJVXDWEv2U+NZXa5kLOk4fjhYX/OJoybwUMrESjFB4Dl bWy6PT7QsAAAAa6l24G6gxsl5Iy3Qdz3su3iOrcmrq4pX4dIdrlP12iqsrmfkFRyI9q1 3HnzbCGN2LcHmiGgYq+LCugkWpesc2Zs4AWAykkfsW4thkxwUK2eGpYqQQ5TwFHhQjPP RYZqlcadQyx9DmuVCh6O16TxahxX7xQ8AmhbXsJYNWdsscB85qphfQV5EoVBILwJ3BfQ /PqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1eKm/rdpvhyfHW/OVHtK+zIgptvZreC2OeMt8zDfjOk=; b=CnGxRZZBgoofnn9h3IWv1Shw4aWUdapufE7Bm0u8WrXHI0pGieC0+AzUUQ0HcV860l DhhFPMs+w48VEJf2TzP1jAhOQOJVNz+RNs6EVpQ4+tToTmmjp4G8XlvoWqNKPFMf3NBd HswbdI7sJNmsrQahAgh48LB+bAfrEAv8qFrAsUHWdA1ZJzv4Uo2HPrTmjxBLDlDwlrn/ xuPTRFoYJwpgst1q9hxaCK2o4f8t65wa3JdVQXnKDm7+vSD0ZIluEEDvfWw2oJ2DIRFI AaT+4TiujC5o/GAs5gdATZ1jYyW535xAGle5bdPDDQxQd5WymBiZnC5Fv+d98K+B5bdh uS+g== X-Gm-Message-State: AKwxyte+PxRMhv2UVuLj8H5OtWOZkeCJU7ax6CdD7J8mRY+uAxiRQtoz yKLA8zPd0OKMKREijvzWFnK3uE0buinIdCYewUhQCdke X-Received: by 10.107.170.132 with SMTP id g4mr32560289ioj.183.1517416550474; Wed, 31 Jan 2018 08:35:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.84 with HTTP; Wed, 31 Jan 2018 08:35:30 -0800 (PST) In-Reply-To: <20180131163312.7144-1-bp@alien8.de> References: <20180131163312.7144-1-bp@alien8.de> From: Andy Lutomirski Date: Wed, 31 Jan 2018 08:35:30 -0800 Message-ID: Subject: Re: [RFC PATCH] x86/vdso: Remove retpoline flags To: Borislav Petkov Cc: X86 ML , Jiri Kosina , LKML 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 On Wed, Jan 31, 2018 at 8:33 AM, Borislav Petkov wrote: > From: Borislav Petkov > > So this does not fix an existing problem but a hypothetical one. The > below fires on an old Frankenstein distro kernel and I'm sending it > only because it is obviously The Right Thing(tm). And in case we change > things in the vdso in the future and thus manage to generate an indirect > call for whatever reason... > > So on those older vdsos, the compiler can generate indirect calls to the > retpoline thunks, which manifests itself as: > > /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: arch/x86/vdso/vclock_gettime.o: \ > relocation R_X86_64_PC32 against undefined symbol `__x86_indirect_thunk_rax' can not be used when \ > making a shared object; recompile with -fPIC > /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: final link failed: Bad value > collect2: error: ld returned 1 exit status > nm: 'arch/x86/vdso/vdso.so.dbg': No such file > objcopy: 'arch/x86/vdso/vdso.so.dbg': No such file > make[2]: *** [arch/x86/vdso/vdso.so] Error 1 > make[1]: *** [arch/x86/vdso] Error 2 > make[1]: *** Waiting for unfinished jobs.... > > However, since the vdso is not part of the kernel, it cannot reference > kernel symbols so we better not build with with retpoline CFLAGS either. > > Thus, export RETPOLINE_CFLAGS to the lower level Makefiles so that they > can be filtered out in vdso's Makefile. Hmm. I'm okay with this, but I'd also be okay doing nothing and figuring out WTF happened if an upstream kernel fails to build like this. --Andy