Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14303566ybl; Mon, 30 Dec 2019 07:40:54 -0800 (PST) X-Google-Smtp-Source: APXvYqxCnH6zXN+kNXSwH4ZdzYlbWUy5KIEdn4EM4wNP3DTudlB91a7aGIw9zj9FyLnNlqa45ngw X-Received: by 2002:aca:c5ca:: with SMTP id v193mr5604424oif.77.1577720454632; Mon, 30 Dec 2019 07:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577720454; cv=none; d=google.com; s=arc-20160816; b=aNyNvROraE5pBuvDvfw2Ibw8dNkDtAjbJ8ahbQEYdHFfBSG5UC/xXyTVlJ/H8Mt254 /xj8y4i7QAdBhJo2ln2Wlpme0IDkJ8cl+eSOoC2wIswCQFjJNa7cmEH2uP8vbxYnAF3l WIl7+lBCEEk1/BZm4spDt/tApcvevMdrz9AOocCchslboLE1P2LTSh40bG4RqAHlReIV 6BZzNC9vZZwjlmU4Gt6TIPzUUEJI0zhC+25hvx43tOVFQrJLNwn/S2f81DUJhuK+D6tR Ncv1ha7OoiW8hsA9PufpK0tInU1jw71tcGHppcV1ALKtOG8ds7uvRMTtBB1a5tC0fem+ ripA== 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:dkim-signature; bh=CK87jMF84FNwOROQRIV5ZAwjn83PsiNqVqwIKsgVKtQ=; b=ztXlIlt/A1J4R56wswvoeHqcOBBOJMW6RylHFw8c7MoacDOCH4BKWxqTKX8mmsYgVA mXLSP3NWM/fG/vJLWIkYlm6RAlMpyJepqO8rh7hbLAewQQ0FBI3VC5zeYcCS90dHnqmx BcgcbAXlOPmZa6EMf3DChcAQF78hahPI21uF2kPJt+Y6W47rrnK1Ha59lmCHFF/0pzrZ 6uFHYePlRMUV2JrDAfBnk0Njbk9YFolLRwa40FZMhJXGzvcLijjhRt/yaAbJi1Ol+i+m PQhX/dJU5u7dWEfZeXy2ZeToGg8LzvkezTgfN2Q8PIxuq57ynQhnWV8ULq1pIW5Zuj4F d29g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=Ok+zhrab; 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=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r132si19529815oig.263.2019.12.30.07.40.43; Mon, 30 Dec 2019 07:40:54 -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=@zx2c4.com header.s=mail header.b=Ok+zhrab; 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=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727608AbfL3Pjz (ORCPT + 99 others); Mon, 30 Dec 2019 10:39:55 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:40331 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727549AbfL3Pjz (ORCPT ); Mon, 30 Dec 2019 10:39:55 -0500 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 7d8bb28b; Mon, 30 Dec 2019 14:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=mail; bh=9flgwsrX1/nkYcte0hox9LfJaiQ=; b=Ok+zhr abdJ/E89MHYOIELdRxV37SfhkIa8drsZvxQBsHkeukgkxpKJjZMvHFuJ25xpKfw5 JJN2IzJRV3hPkntjeVa1TnX0nZFIn3SzCtPHv3lO842PGiTDbEesgG/aW7PmPbLk JZCluwQ7f46HW5ckE7scgokneYGB7h4gLwCOmTuIvA5aJijiEFmwcNGivMAag+iT pvSMPGaLVpnmHwFLRv8W+cslCh7TDR9B8l3WNCmj3dRtH/wCGWM8PMdFW9TM1Db0 F7tNOQTi9E25t8o5kEyzcGNglv7g0EaUeYLN2ir8AGah4Jx55qt9Wrrv8y0KZdvC IC7LQoGYTPkdbOKg== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 87a6a7bd (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 30 Dec 2019 14:41:45 +0000 (UTC) Received: by mail-oi1-f182.google.com with SMTP id a67so11036405oib.6; Mon, 30 Dec 2019 07:39:53 -0800 (PST) X-Gm-Message-State: APjAAAXMtdq4uF9TF38vUfc/OmhSWq6YVP3XUhpS82DF85eNQefoW+It wfJuzZIvbWdhFjkbg/xSBi2DRrpElbaL9uMHVXc= X-Received: by 2002:aca:39d6:: with SMTP id g205mr5058827oia.122.1577720392421; Mon, 30 Dec 2019 07:39:52 -0800 (PST) MIME-Version: 1.0 References: <20191223130834.GA102399@zx2c4.com> <20191224135404.389039-1-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Mon, 30 Dec 2019 16:39:41 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mips: vdso: conditionalize 32-bit time functions on COMPAT_32BIT_TIME To: Arnd Bergmann Cc: "linux-kernel@vger.kernel.org" , "open list:BROADCOM NVRAM DRIVER" , Paul Burton , Vincenzo Frascino , Christian Brauner 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 Mon, Dec 30, 2019 at 4:37 PM Arnd Bergmann wrote: > > On Mon, Dec 30, 2019 at 3:37 PM Jason A. Donenfeld wrote: > > > > On Mon, Dec 30, 2019 at 1:34 PM Arnd Bergmann wrote: > > > > > > - Why does it crash in the first place rather than returning -ENOSYS? > > > > There's a bit of speculation about this in the original thread that > > prompted this patch (you're CC'd). > > > > > > > > - 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? > > > > Actually, your patch fails here. The ts struct remains as it was > > before, filled with garbage. No good. My original patch in this > > thread, though, does result in the correct value being written to ts. > > Ok, that is the intended behavior then, clock_gettime() needs > to fail with -EINVAL or -ENOSYS here (depending on the libc > implementation), and of course the data is not updated. > > Returning success from clock_gettime() on a kernel with only > time64 support and a libc with only time32 support (or vice > versa) would be a bug. Ah, right, hence why the 32-bit compat code is behind a still-on-by-default-but-not-for-long menu option.