From nobody Thu Jun 11 01:58:02 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 EF1E31427A for ; Mon, 4 May 2026 06:32:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777876357; cv=none; b=b/WLUmonJeRIuu/p9p5DiV2nEv0ysf98BQP6cCvu46QZLMvxdfwi45TEM6MmCvydTs+cv+AHuB0hHzbKPavQdfRoZNQFsAUph9k/VaTCv8roFj42S6JS/Xcdzl8Nn8UigDF0Cf/uCCP3PPDzOKvIxXsx07HvKVTzPiOynPuYy2Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777876357; c=relaxed/simple; bh=gQ4AIXb8ClG6idwX0/wl+cCjb3O0vADmIB0SuRDHU6w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=EHr8TVLE7UXW+KxacVK9iiYxkJICEYerzPcvoQhLngI2CcmbRkFdqdPTu+fqW5AWas/8CQsMDn7sSSM3wHu/Q7u6LLjniAwK1iqzTVv9mvaX6zpV5HKQ8hNz9QCeD49thGreBh7aV+fUt0snMGIweMbGOtgVbxaV2Las6EsTabg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QU4Pg4BL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tQMnnZkf; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QU4Pg4BL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tQMnnZkf" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777876354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pPkw4XkLQOMX78Tx7TYERdN+6yVJBPKFDY7LQLpQjDQ=; b=QU4Pg4BLpfRQGqePufrQSQ/dNwjEpHOV0cu4ohalhg5hgMOXyCcqVRkAA1QcxJpylMuaUe lT8ouxMrkyGH3c/Ca54JiPm2w13EyTam7IT/kauy7hZMOoY0u9o9IyjLAA4IhwkmHSoGBR zaFkzSmu/dqCVsQzED6580uDLRAtHFkw+qeH6Z/WNaCnSOdZ+qGaSEJNEK74KfMWGDlr8v JALotN8uuRzz1uZfx6gtezx8HmvZlJlVmMktbrx4S3fXZlwIwsHk5uo3uGHteMG90/rOO+ SflyH+zFc0urCtYUQuP/BTaULdNj8h6VGOEggHAMtk7IZL8Dg6/M5nj734hHpQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777876354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pPkw4XkLQOMX78Tx7TYERdN+6yVJBPKFDY7LQLpQjDQ=; b=tQMnnZkfqtnb+5vda12gG3xWnfkmzmttnP91S/f2VNXcTNPNIhvtQCCAoG+cG9mkYqXbNu uDpsiCZngIXwKBAw== Date: Mon, 04 May 2026 08:32:26 +0200 Subject: [PATCH v2] y2038: uapi: use 64-bit __kernel_old_timespec::tv_nsec on x32 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260504-timespec-x32-v2-1-0739c9047fc4@linutronix.de> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/1XMwQ6CMAzG8VchPTvTdYDKyfcwHBSKNNGNbLhgy N7dSeLB47/N91shsBcO0BQreI4SxNkctCugG6/2zkr63EBINRKVapYnh4k7tRhSOJw6XVVGG0L Ik8nzIMvGXdrco4TZ+femR/29/qDDPxS10grxlh+6PqIpzw+xr9k7K8u+Z2hTSh+yoxstrAAAA A== X-Change-ID: 20260224-timespec-x32-0f9c15531320 To: Arnd Bergmann , Deepa Dinamani Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1777876354; l=2140; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=gQ4AIXb8ClG6idwX0/wl+cCjb3O0vADmIB0SuRDHU6w=; b=VE6GKs03rYViw34dQcEtB7bZhbYW7an2KXeRyej6fd/g4ak+mPTnhlW870uOLWLzricSYw09t m+TLBP5KZzxDzlBQhOpgl2+gnSM0I1fRIY8Tn3zqrRRbXZ79/3UD9Y2 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= 'struct __kernel_old_timespec' represents the 'native' time ABI of the kernel. On 32-bit systems it uses 32-bit fields and on 64-bit systems it uses 64-bit fields. However the x86 x32 ABI uses the 64-bit time ABI natively. This is correctly handled for the 'tv_sec' fields, through the typedefs of '__kernel_old_time_t' -> '__kernel_long_t' -> 'long long'. The same treatment was missed for 'tv_nsec'. In practice this might not make much of a difference as the value of 'tv_nsec' will always fit into 32 bits and the missing bits fall into the padding of the structure. When introspecting the structure however, a difference can be observed. Switch to 64-bit tv_nsec on x32. No other architectures or ABIs are affected. While this could be interpreted as violating the POSIX requirement of 'timespec::tv_nsec' being 'long', * __kernel_old_timespec is not actually the POSIX timespec type, * the requirement is gone in newer versions of POSIX, * this matches glibc. Fixes: 94c467ddb273 ("y2038: add __kernel_old_timespec and __kernel_old_tim= e_t") Signed-off-by: Thomas Wei=C3=9Fschuh --- Changes in v2: - Rebase on v7.1-rc1 - Extend commit message a bit - Link to v1: https://lore.kernel.org/r/20260227-timespec-x32-v1-1-00b22716= 8034@linutronix.de --- Arnd, can you take this? I'm not entirely sure if this warrants a stable backport. --- include/uapi/linux/time_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/time_types.h b/include/uapi/linux/time_type= s.h index bcc0002115d3..03a0d8aaadca 100644 --- a/include/uapi/linux/time_types.h +++ b/include/uapi/linux/time_types.h @@ -30,7 +30,7 @@ struct __kernel_old_timeval { =20 struct __kernel_old_timespec { __kernel_old_time_t tv_sec; /* seconds */ - long tv_nsec; /* nanoseconds */ + __kernel_long_t tv_nsec; /* nanoseconds */ }; =20 struct __kernel_old_itimerval { --- base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731 change-id: 20260224-timespec-x32-0f9c15531320 Best regards, -- =20 Thomas Wei=C3=9Fschuh