From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74A3229408; Mon, 13 Apr 2026 16:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096018; cv=none; b=gX6FjhYloa30ZJJejYXdAZbUxlQaDtt0KrjWNbboRKuSe2R5/Me5w+onZ1AV/ZTAoVe3gp4VCruh17Yi7AZmResKLlueBpyRvW11y/eu5ojsg/dROi+wbFVgau7CwkP0It4R1sHXCOppcrOOcMcRfh5D8+h9dhTFbWyAUKpYZL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096018; c=relaxed/simple; bh=i7fK206NwhnRyk4dMUwoIo5kTsp3EBbIF39VgZZ7qrQ=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=kJEbbg/EMIBBOBWcDlf98iJMMa4FuDa/o/HTbWyy8PtqHuitsYCKsUNxRC8sm15efCRYddtl3XcpRYdsR4rP9eaHIjPY5hN4t6nluybJwvz0jy1F157sD8Fzt7SNlGe+gVnpZeqPSgc6QcnR6/uUgMn1kqEsaig6r5L9tHKXris= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=kJA6OGRc; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Jvg7F7L8; arc=none smtp.client-ip=202.12.124.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="kJA6OGRc"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jvg7F7L8" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id C4D1C1D0022B; Mon, 13 Apr 2026 12:00:15 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Mon, 13 Apr 2026 12:00:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1776096015; x=1776182415; bh=/iv/pcTfVSlpNC7zw/ioPJR8syUP7va6YCEpuLUEAwc=; b= kJA6OGRcjNDnTIHp9/+o9ZSHh9U87mPaZgP1CwmmfY7MzwbD1aaqBmf4pqbx2oj9 CA9nc2uYHzCwWiDRhdD7xdmxeE5hww1zGg6XE0EIGZKdpY9fdY1dAybDwqY050jV CHeGqwVoOWucCrUshb8+nbkMzeavCz5a+gZq8qC6yEIbnBuhu/YB9Q+asq66prQ6 6H0vsKgJAbjd3hUF0HU0r4s6qMlifDEIrqTtstf0PARc4QnZQHMFW6Q53s7S54LZ Np1WO1WbzjIZCt6MNhqsmbUujAjnIeqkgIdGgAsk+Sux/e3t1j83u2O6e9FQft47 Hw17JZ5GfI7gL2eHhRxawA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1776096015; x= 1776182415; bh=/iv/pcTfVSlpNC7zw/ioPJR8syUP7va6YCEpuLUEAwc=; b=J vg7F7L8FyJXYdEnshDaciGCf9pIcFLCzR6Ene0aVah8RXDmBfwO4I/D3d9sZ5SRL PJ5TX3D01Eh3m3eBBavB/Pb70oI+jTdcr8jTI5SXajknnjpj5aaxnapPdTk6i4xm lAB2XOZMRDqDU1MTlTs/0hcb5iVewpXmtj20v73LEUw1qCm68NzWZtlIxHOuYpJr 5GvirjO2QGVhHrJ9h1Jmrv5wHA1TACl3EoY2djQvAlOKfDy5FVi05eEDciHnCi/P dr9LcTzns3NdtlWMgS9B1MUkd7FYCsscuTLLgvfcasG3xlv/yfl1DMsLMwWNmVzv 6+zbP9hjfWjpb7I/mghRw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdefkeeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdetrhhnugcu uegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtthgvrh hnpedvhfdvkeeuudevfffftefgvdevfedvleehvddvgeejvdefhedtgeegveehfeeljeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnug esrghrnhgusgdruggvpdhnsggprhgtphhtthhopedvuddpmhhouggvpehsmhhtphhouhht pdhrtghpthhtohepsghpsegrlhhivghnkedruggvpdhrtghpthhtohepthhssghoghgvnh gusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopegtrghtrghlihhnrdhm rghrihhnrghssegrrhhmrdgtohhmpdhrtghpthhtohepvhhinhgtvghniihordhfrhgrsh gtihhnohesrghrmhdrtghomhdprhgtphhtthhopehlihhnuhigsegrrhhmlhhinhhugidr ohhrghdruhhkpdhrtghpthhtohepmhhpvgesvghllhgvrhhmrghnrdhiugdrrghupdhrtg hpthhtohepnhhpihhgghhinhesghhmrghilhdrtghomhdprhgtphhtthhopegthhhlvghr ohihsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehluhhtoheskhgvrhhnvghlrdhorh hg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 6BE7270006D; Mon, 13 Apr 2026 12:00:13 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: ARwL1vy566MZ Date: Mon, 13 Apr 2026 17:59:52 +0200 From: "Arnd Bergmann" To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Cc: "H. Peter Anvin" , "Andy Lutomirski" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , x86@kernel.org, "Russell King" , "Catalin Marinas" , "Will Deacon" , "Madhavan Srinivasan" , "Michael Ellerman" , "Nicholas Piggin" , "Christophe Leroy" , "Thomas Bogendoerfer" , "Vincenzo Frascino" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org Message-Id: <15925544-1ae5-406a-b9cc-af5935cc9f02@app.fastmail.com> In-Reply-To: <20260410091131-46b6354c-9d06-4e47-9345-ee224d8528f7@linutronix.de> References: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> <20260227-vdso-compat_32bit_time-v1-1-3f0286a7bac3@linutronix.de> <03cd1e21-a2f2-46a1-a674-cbaef9712016@app.fastmail.com> <20260227103226-cc3bb32c-0107-4c09-b81a-ca33ea03ad5c@linutronix.de> <49b7c9f9-198a-49f7-880b-6ae74d7bd985@zytor.com> <2b1ac7b9-fcc8-4aa3-a0ad-eb37e4bce030@app.fastmail.com> <20260410091131-46b6354c-9d06-4e47-9345-ee224d8528f7@linutronix.de> Subject: Re: [PATCH 1/7] x86/vdso: Respect COMPAT_32BIT_TIME Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, Apr 10, 2026, at 09:24, Thomas Wei=C3=9Fschuh wrote: > On Tue, Mar 03, 2026 at 09:50:33PM +0100, Arnd Bergmann wrote: >> On Tue, Mar 3, 2026, at 19:11, H. Peter Anvin wrote: >> > >> > The time zone in the kernel has never worked anyway, as it would re= quire the >> > kernel to contain at least the forward portion of the zoneinfo/tzda= ta table in >> > order to actually work correctly. The only plausible use of it woul= d be for >> > local time-based filesystems like FAT, but I don't think we bother. >> > >> > A bigger question is whether or not we should omit these from the v= DSO >> > completely (potentially causing link failures) or replace them with= stubs >> > returning -ENOSYS. >>=20 >> I see no harm in keeping gettimeofday() in the vdso when >> COMPAT_32BIT_TIME is turned on, as existing code will call it >> no matter whether it's in the vdso or the syscall. > > We would still always keep them for 64-bit ABIs, right? Yes, I think we can't easily change that now. It was probably a mistake to keep them in the generic syscall table after we dropped them for 32-bit non-time32 targets, so riscv64 and loongarch should have not had these in the first place. >> Equally, I see no point in having either version of >> gettimeofday() or settimeofday() when COMPAT_32BIT_TIME is >> disabled, as clearly anything calling it would pass incorrect >> data for times past 2038. > > Should we also drop the syscalls in these cases? > We will need to keep settimeofday() in some form to support the > timewarping call done by init. > > Recap/Proposal: > > * Keep the gettimeofday()/time() syscalls when they are y2038 safe or > CONFIG_COMPAT_32BIT_TIME is set. > * The vDSO functions always mirror the systemcall availability. These sound good. > * Always provide settimeofday(). If CONFIG_COMPAT_32BIT_TIME is *not* > set, reject passing any 'tv' argument where it may not be y2038 safe. This sounds wrong to me now: the case I'm worried about is a 32-bit system calling settimeofday() based on the value of an RTC or NTP. The idea of CONFIG_COMPAT_32BIT_TIME=3Dn is to catch this by causing an intentional ENOSYS error even for valid times, so it doesn't suddenly start breaking in 2038. Arnd