From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 13C11455639; Sat, 12 Sep 2026 12:09:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789214984; cv=none; b=iG/mDrXPDNDjA0Ee7OiO6GFPveLj+a2Uu9skzxnLV5Xt/+Qnkyg8bLcGt6BT4x4t515eSQfX7L3zxn/M8eWFiLoXFYvskNechxRVV55Fy/zt12Ej/GO/zD2MvsFqYOc8OPJgIC4KQe51w1vpyISVjbeTO5vqeSKjLGGsVIGv9LU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789214984; c=relaxed/simple; bh=H7/1ZjTl3M0NpBnQ6Yx0UONXj3UcLAj35hC6hUquujg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=F/wk/K5n8AkH1jUBhM0KXoGsRegEgZz3K25qJikKTQTWwvRAC2O2C2mzKp635APZpg2BXOaLoj3RVffGeD/haDmPdBAfH/kR78zT1Ial9PF1yha7F6qBBaH7KaeieCG6qMhUHJ0zFPLguaVslYXFy4duRzvV1FhSUbODaH8x5js= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IiKPFtHi; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IiKPFtHi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C41431F000FF; Sat, 12 Sep 2026 12:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789214982; bh=JTMoqkSWyiGfyYaJOaOF+bLBSk3Vq4ZkqT/THPrqlwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IiKPFtHiAdkH7+JSiQ4Qlc+lKqabeE9BA6N5tS6x28sK73fyQf5N7K0rVpMtYY17B KJAGzpT1cwxreaH2CXsONvWXOgfJG9p0urq+ZWWDC7sma7xGOdNmj2yo2Vb1wyS3MV oz+oH7cFi8peBAj6sBwqdo53A09d+E7lnBtdZLZA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Thomas Gleixner , Sasha Levin Subject: [PATCH 6.12 0439/1376] y2038: uapi: Use 64-bit __kernel_old_timespec::tv_nsec on x32 Date: Sat, 12 Sep 2026 08:47:45 +0200 Message-ID: <20260912065617.317405343@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Weißschuh [ Upstream commit 79ced850e549e8c86b772a79ea417a1425b5c04b ] '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_time_t") Signed-off-by: Thomas Weißschuh Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260504-timespec-x32-v2-1-0739c9047fc4@linutronix.de Signed-off-by: Sasha Levin --- 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_types.h index bcc0002115d39..03a0d8aaadca5 100644 --- a/include/uapi/linux/time_types.h +++ b/include/uapi/linux/time_types.h @@ -30,7 +30,7 @@ struct __kernel_old_timeval { struct __kernel_old_timespec { __kernel_old_time_t tv_sec; /* seconds */ - long tv_nsec; /* nanoseconds */ + __kernel_long_t tv_nsec; /* nanoseconds */ }; struct __kernel_old_itimerval { -- 2.53.0