Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14126778ybl; Mon, 30 Dec 2019 04:36:06 -0800 (PST) X-Google-Smtp-Source: APXvYqywArNcAoOCVwPw9WB2YDJDdyPLHe9/BNZOXL9XfVMFlN4jZBouaZFPCRDnqKwtCztOSdXc X-Received: by 2002:a9d:6b03:: with SMTP id g3mr73706845otp.200.1577709366051; Mon, 30 Dec 2019 04:36:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577709366; cv=none; d=google.com; s=arc-20160816; b=nI/kIeucdBCt7fslscNIRs048tiTtJrz0ziauFVTz5BDxghPWCH3Alz6/wq5ITmWSa FZmMlRldMD/2yN8yCohAH6aylDeN+qOdCEtubxSylAZ/DvQGjcEs510fm4zDr0dj22ej eCDvzxWiUyO3Ds4USyKYeW1dcoKZBTfv2u8qgB3Q826woaIjV9g6wC/EEKncDuNt64M6 IxwiO4vGVp1i3VyQEkjdfHZulj05n2eVMFV2yuDIEwh7IgaM/uiYVTCIK2aJVwz171Zy N9aEWacl90wObSO17eeZoryePZfCYwhLni0bubZq2bI77XfDVaYcYY9u/3ZWxCaJF81+ wH1Q== 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 :in-reply-to:references:mime-version; bh=XwDnMw2ck6nIAx1TsmaoMaXoEBQ2trkRzlEJlRpYhWA=; b=YRWh6MVK17q4+bzdXrE3WJmUAVEDunuGIyotOZpzxYyFvgfqZBXxjI9fImBFmjCtmp ZCPESRtwW3V4UE8LRqh2gZBd+4CLRlMtJvMYGBYB4wq/gY2pcFq+5VFWUbBAwUEEt7ao PLFgm0LUnYwF3sFFjl6eA1dJ50qsIjIUhHws472cBGIiDxrKIzHBJfrIMfHsNI/O+nRR GCJ9W6XxTtxnWd/KhsgKJwLGxJOD5UA1NTGzqTXOZ0sG6W8xc99HPxfIBMcbD5kzNagE VW8sGP7Bc3w0ksrJZFItQtFuVv5R4k0VCDtzlgX8/3lfe1l0Q9wOGZKmp1NCC64aRSS2 CeAw== 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 i5si19756400otr.293.2019.12.30.04.35.53; Mon, 30 Dec 2019 04:36:06 -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; 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 S1727447AbfL3MeT (ORCPT + 99 others); Mon, 30 Dec 2019 07:34:19 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:46745 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727397AbfL3MeT (ORCPT ); Mon, 30 Dec 2019 07:34:19 -0500 Received: from mail-qv1-f44.google.com ([209.85.219.44]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1N2Ujn-1jkQEQ1z4B-013xVI; Mon, 30 Dec 2019 13:34:17 +0100 Received: by mail-qv1-f44.google.com with SMTP id z3so12315547qvn.0; Mon, 30 Dec 2019 04:34:17 -0800 (PST) X-Gm-Message-State: APjAAAVxg9/Va+7Lxa53J1oJEUS5unQ0od8K+WOzs4vwlTz68xbQRo/f UZF0ILfphuBq1xjYh+5pNRI0+5T9Zz6pQcGURCM= X-Received: by 2002:a0c:8e08:: with SMTP id v8mr37832199qvb.4.1577709256287; Mon, 30 Dec 2019 04:34:16 -0800 (PST) MIME-Version: 1.0 References: <20191223130834.GA102399@zx2c4.com> <20191224135404.389039-1-Jason@zx2c4.com> In-Reply-To: From: Arnd Bergmann Date: Mon, 30 Dec 2019 13:34:00 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mips: vdso: conditionalize 32-bit time functions on COMPAT_32BIT_TIME To: "Jason A. Donenfeld" Cc: "linux-kernel@vger.kernel.org" , "open list:BROADCOM NVRAM DRIVER" , Paul Burton , Vincenzo Frascino , Christian Brauner Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:Moo4o+r9ZXyOcQLpJBeMNmEX74RKaHhRTEX+rPGRUfwsVxXGuEO wqPV8DCbcTF5AGcgUSOaKy3SbeHqkLvg4UnsWUzMB+6ucXrwP+3t9votLoo2cAJiwU4/yA1 zPLALZCZ3QT3CGJegxuIe70Mu3k6E5tAW2JaDzJuBFCvUs55F3cCq7QYsnOT5zhl4v9RVJ2 tqyLiPugFvYVYWQCQ5FzQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:yNMXuiXTtMY=:LPMAgjEFvqvDIBLQq2+iLz tVFPJilUKTV1NBbipEgxDabgGPyrKNPhFbahyWC+c1m+OsqrX6NFo6PnhnjaduLdPRIGyR+Rs RLxMhhGBfm/AruwKQXOnSQaV9bDzYEejhqO0vuh/vonmoOJtAo+DJdMv8hibKdDqcgsIIRr0G 0nJBRHX2iYDt950KG7gMsdI4CEXrKL3muy7y5GvaHTviEx3s6l3fPsp808fhXrIdErdzBx5pF vGOoXAc9ZSxWZVR3zTajBEPNIEL4yrov1VzzQtP9qOzOV8aGWy1H3yF/mZoFusEzLsOqFEtNo fHexeGXEYV+C9W10T8FHA3Fo+l3U87HXo00tRgN0OZSRok45UIjtR0TDnrWYWgw/g/aIF15gN ZRv60bKKw/V07IUmwl066S0dJusTL1xAFSFRtJxh2ahvQ4IkP8LsRrUndX2sU4mTEMXHni4pF TuEajA9U87jswJaj3+KUN47zKaiIGbCFp9Vo1Az91XGvEgneAM6DwiLqlLc/ctScK5gGVq2ES GtJim8+tb7dVpt3gn/ZLSP1DLmCtrawDgeOZ9tcnHrSlrLD6TscQiWTO+X4RvkOBvi9T0ftJq BKKt7Z3O1gxA7Q7WJSEDrMjwBTQIO7Ucxp0rGgp564go8V8kdMCMkfrlZClUki8LbGXR1L6Y2 fbNMOt5+vE5uL0gamLadYNZw+iZWpHQyLCEUNiBqDyYbPtk85ox4oi64B7lAe8MBMuoYmPFZw WJLkQV4q/0jDkaj5kijhew8SslXA9TeCmxc8VPc75vaqxMkGt7iqtOPTHii8UM++fzQjVTNAH QTRnnAAQcb7tbckDD6gDuihCVVq3YiZCGQSBgr9buRyDgT6adO9JmH6fe9AIXZJ5+H3HNH7jI I+XN9AEENbtOh7gZy70w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 30, 2019 at 1:27 PM Jason A. Donenfeld wrote: > > On Mon, Dec 30, 2019 at 12:58 PM Arnd Bergmann wrote: > > Thanks for the bug report! I'm not completely sure why this fails in > > this particular > > way though. I assume you are using musl-1.1.20, not a musl-1.2.0 snapshot > > Yes, that's the one, sorry. > > > diff --git a/arch/mips/vdso/vdso.lds.S b/arch/mips/vdso/vdso.lds.S > > index da4627430aba..0bdc6a026be8 100644 > > --- a/arch/mips/vdso/vdso.lds.S > > +++ b/arch/mips/vdso/vdso.lds.S > > @@ -93,9 +93,11 @@ VERSION > > LINUX_2.6 { > > #ifndef DISABLE_MIPS_VDSO > > global: > > +#if (_MIPS_SIM == _MIPS_SIM_ABI64) || defined(CONFIG_COMPAT_32BIT_TIME) > > __vdso_clock_gettime; > > __vdso_gettimeofday; > > __vdso_clock_getres; > > +#endif > > #if _MIPS_SIM != _MIPS_SIM_ABI64 > > __vdso_clock_gettime64; > > #endif > > > > That should ensure that no user space can call the old vdso > > functions on a kernel that intentionally breaks the actual > > syscalls. > > I can confirm that patch fixes things. Thanks. Ok, that's good news, but I think we still need to answer two questions: - Why does it crash in the first place rather than returning -ENOSYS? - How does it actually work if you run an application built against an old musl version on a kernel that tries to make this not work? Do you just get a random time (uninitialized user space stack) and work with that without checking the error code? Arnd