Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2540264ybi; Sun, 28 Jul 2019 11:17:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyloV5MKo4Ob4ns01IHeOjUqBPaxnvDqXMK9IYZfoLBKE7LAUDBJenhBqo6ULhCa4H8zdbq X-Received: by 2002:a17:90a:21ac:: with SMTP id q41mr110297200pjc.31.1564337827734; Sun, 28 Jul 2019 11:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564337827; cv=none; d=google.com; s=arc-20160816; b=tIzell1xoCCp46RXnl/m+A5WpDwHBscFq/5gCzzAcmNQ5SXtgrxX2ZsXusbW4cdfVj Vu81eZnZA5HaAVTmwKN3BZqMa4ft/d7mGCj/TmYJOdPd3bx13+X4Y5F6yt1PTgcVzP4b DnODsmnB+c0u7mLrH0hrl77/NQBEMtpeh4qJr9+tGWnk+2Hg05F3Vcvi/ZnSSaCCuiWu gdg2BLradTvrxC1HhsqmWFP5KMNv8/AFOr/M0Wop95uMsSc2hwHoLHKqAlnwpq1WOE7G E92DCVtME1cHJ8o0zhVFRe0FmvpJZzVXXPbEhldtcTJXFyLd7fL5SgEPq0NHU3kZ9zfe e5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=UMOTnhsskAKyLVIas7qyX66X1QdU9Y/OaHz/5yp1T9g=; b=FpNqEc3vIhJL1qyMBKzlXpfe2zI1f2NWQhIvid8C4x6NFzQFIjs96TgM95WRfHM9pz d8WlP040vLIu9Ed6ZxgHeZowqYKi/daBW87P2QlcKTh+gVifMk2q5Q0t+tDyCSltz3zk NS1K/T+yFm2xKK1/iAtHRFFMNpPzW1epXvHElpKDQugUvO9XW2mUKCg9WngpkeRFGLdt hfY7B4LAPpvuiYHdAp9mcGn52C/80gGE2UuNDonORHWmL8Q/CB80p7f7U52rMcMXBiGF HJSoOpYcu/ZLedkdj2/PniAQcKDcDZejMBeHKfc29nFsc1l22UkMQd+8IhDK+lRvKyNC tkmw== ARC-Authentication-Results: i=1; mx.google.com; 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 e1si21722670plt.276.2019.07.28.11.16.52; Sun, 28 Jul 2019 11:17:07 -0700 (PDT) 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; 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 S1726211AbfG1SOk (ORCPT + 99 others); Sun, 28 Jul 2019 14:14:40 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51907 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbfG1SOj (ORCPT ); Sun, 28 Jul 2019 14:14:39 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hrngi-0007fX-1T; Sun, 28 Jul 2019 20:14:28 +0200 Date: Sun, 28 Jul 2019 20:14:27 +0200 (CEST) From: Thomas Gleixner To: Arnd Bergmann cc: Andy Lutomirski , Sean Christopherson , Kees Cook , Vincenzo Frascino , X86 ML , LKML , Paul Bolle Subject: Re: [5.2 REGRESSION] Generic vDSO breaks seccomp-enabled userspace on i386 In-Reply-To: Message-ID: References: <201907221012.41504DCD@keescook> <201907221135.2C2D262D8@keescook> <201907221620.F31B9A082@keescook> <201907231437.DB20BEBD3@keescook> <201907231636.AD3ED717D@keescook> <20190726180103.GE3188@linux.intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 28 Jul 2019, Arnd Bergmann wrote: > On Sun, Jul 28, 2019 at 12:30 PM Thomas Gleixner wrote: > > On Sun, 28 Jul 2019, Arnd Bergmann wrote: > > > On Sat, Jul 27, 2019 at 7:53 PM Andy Lutomirski wrote: > > > Which is totally irrelevant because res is NULL and that NULL pointer check > > should simply return -EFAULT, which is what the syscall fallback returns > > because the pointer is NULL. > > > > But that NULL pointer check is inconsistent anyway: > > > > - 64 bit does not have it and never had > > > > - the vdso is not capable of handling faults properly anyway. If the > > pointer is not valid, then it will segfault. So just preventing the > > segfault for NULL is silly. > > > > I'm going to just remove it. > > Ah, you are right, I misread. > > Anyway, if we want to keep the traditional behavior and get fewer surprises > for users of seccomp and anything else that might observe clock_gettime > behavior, below is how I'd do it. (not even build tested, x86-only. I'll > send a proper patch if this is where we want to take it). I posted a series which fixes up the mess 2 hours before you sent this mail :)