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 A52523BE645; Sat, 12 Sep 2026 17:02:19 +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=1789232540; cv=none; b=FyZRHuHEvRDINYIf1StzTjTlQbDNgyITm2DKakfOcY7eps0eheowv5f8hD7L2S2tqi/1R5siFFgIM3E3luvcOFHCFunmS9ndimpdI1WlPo7jj2GFAOJuOKnkp0/3zE/JCrppJ+uyrBrZTShD9ItVuqTTLTFSynYTmXFMz8M4j+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789232540; c=relaxed/simple; bh=OjRkg0o0mWPzs3pQP4EFYc6+uH9wa881eTO02+yWIvY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iqJo+5pCsIXalTh88ghEgFQfeMtPRsWlp9DZeZbTkA5p6CoN2MxM4tZ5wX7iAH8tgxtEdoH25q9gm0X67yUE6NN6LMLAJkg9fIeBX+UatxMlnhLrDuM+KNHbgoQq5q/ZGQ56nTXPXIfRQ+NdkoeZEB1UVmb7EIWdgIYGe+b62fA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AKO4GNWi; 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="AKO4GNWi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A811F1F000FF; Sat, 12 Sep 2026 17:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789232539; bh=/G4xqRYg9iMTkccPaQMuJLzYcTg/OeG8JCWlBczPTIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AKO4GNWisJx+XG0ycOXnjlU3GDQw6wuLZHjvyFeVOSBH5znVit0qHKA+Vq8wX1zZ0 nAFnGGWFLY6EESBRY8DGcUrlNV0BF+bJ8z2HBkou53KTTcqs2xQfy0Thv6VdsO5Sf2 LEnMcu6EcxqGi5tXaMfbFCqO1rPMWg/Fwrs6CMiU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?J=C3=A9r=C3=A9my=20Jean?= , Thomas Gleixner Subject: [PATCH 5.15 005/935] timers/itimer: Zero-init old itimerval before copy to userspace Date: Sat, 12 Sep 2026 08:50:35 +0200 Message-ID: <20260912065526.964736569@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065526.833703348@linuxfoundation.org> References: <20260912065526.833703348@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jérémy Jean commit 18c7d85864e554adc8fad1e8d2e9d2cb6c3911c8 upstream. On native sparc64, struct __kernel_old_timeval contains a four-byte hole after tv_usec because tv_sec is 64-bit while __kernel_suseconds_t is 32-bit. put_itimerval() fills only the named fields in a stack-allocated __kernel_old_itimerval and copies the entire object to userspace, so getitimer() can expose the two padding holes. Zero-initialize the aggregate before assigning the fields so implicit padding is deterministic before it crosses the user/kernel boundary. Signed-off-by: Jérémy Jean Signed-off-by: Thomas Gleixner Assisted-by: Codex:gpt-5 Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260809190428.1523014-1-Jeremy.Jean@oss.cyber.gouv.fr Signed-off-by: Greg Kroah-Hartman --- kernel/time/itimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/time/itimer.c +++ b/kernel/time/itimer.c @@ -100,7 +100,7 @@ static int do_getitimer(int which, struc static int put_itimerval(struct __kernel_old_itimerval __user *o, const struct itimerspec64 *i) { - struct __kernel_old_itimerval v; + struct __kernel_old_itimerval v = {}; v.it_interval.tv_sec = i->it_interval.tv_sec; v.it_interval.tv_usec = i->it_interval.tv_nsec / NSEC_PER_USEC;