From: Jakub Kicinski <kuba@kernel.org>
To: Sagi Maimon <maimon.sagi@gmail.com>
Cc: jonathan.lemon@gmail.com, vadim.fedorenko@linux.dev,
richardcochran@gmail.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2] ptp: ocp: Limit SMA/signal/freq counts in show/store functions
Date: Mon, 12 May 2025 17:07:02 -0700 [thread overview]
Message-ID: <20250512170702.1f6d0c07@kernel.org> (raw)
In-Reply-To: <CAMuE1bHL1-t_YD0B5v1LuY_b558U5qbseSYJXvnm734+Vb-v_w@mail.gmail.com>
On Sun, 11 May 2025 17:39:08 +0300 Sagi Maimon wrote:
> > > > What do you mean by out-of-bounds access here. Is there any access with
> > > > index > 4 possible? Or just with index > 1 for Adva?
>
> The sysfs interface restricts indices to a maximum of 4; however,
> since an array of 4 signals/frequencies is always created and fully
> accessible via sysfs—regardless of the actual number initialized—this
> bug impacts any board that initializes fewer than 4
> signals/frequencies.
Right, but the bug is that user may write to registers which don't
exist? Or something will crash? We need to give backporters more info
about the impact of this bug. Can this crash the kernel?
As for sysfs exposing 4 entries, I think it's controlled by what groups
of attributes are added. So I think were possible we should create
attribute groups with only 2 entries for Adva. Eg. copy
fb_timecard_groups[] with just the correct entries, and in
ptp_ocp_fb_board_init() add an if which selects the right array.
next prev parent reply other threads:[~2025-05-13 0:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-08 7:19 [PATCH v2] ptp: ocp: Limit SMA/signal/freq counts in show/store functions Sagi Maimon
2025-05-08 11:28 ` Vadim Fedorenko
2025-05-09 20:43 ` Simon Horman
2025-05-09 22:01 ` Jakub Kicinski
2025-05-11 8:16 ` Sagi Maimon
2025-05-11 9:03 ` Sagi Maimon
2025-05-11 14:39 ` Sagi Maimon
2025-05-13 0:07 ` Jakub Kicinski [this message]
2025-05-14 6:36 ` Sagi Maimon
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=20250512170702.1f6d0c07@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jonathan.lemon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maimon.sagi@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=vadim.fedorenko@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).