From: Kyle Zeng <zengyhkyle@gmail.com>
To: richardcochran@gmail.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org
Subject: [PATCH] ptp: prevent info leak to userspace
Date: Wed, 17 Dec 2025 00:14:18 -0700 [thread overview]
Message-ID: <aUJYSv6kqb9QauMI@westworld> (raw)
Somehow the `memset` is lost after refactor, which leaks a lot of kernel
stack data to userspace directly. This patch clears the reserved data
region to prevent the info leak.
Signed-off-by: Kyle Zeng <zengyhkyle@gmail.com>
---
drivers/ptp/ptp_chardev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index c61cf9edac48..06f71011fb04 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -195,6 +195,8 @@ static long ptp_clock_getcaps(struct ptp_clock *ptp, void __user *arg)
if (caps.adjust_phase)
caps.max_phase_adj = ptp->info->getmaxphase(ptp->info);
+ memset(caps.rsv, 0, sizeof(caps.rsv));
+
return copy_to_user(arg, &caps, sizeof(caps)) ? -EFAULT : 0;
}
--
2.43.0
next reply other threads:[~2025-12-17 7:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-17 7:14 Kyle Zeng [this message]
2025-12-17 7:28 ` [PATCH] ptp: prevent info leak to userspace Gal Pressman
2025-12-17 7:38 ` Kyle Zeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aUJYSv6kqb9QauMI@westworld \
--to=zengyhkyle@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.