From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Bryam Vargas via B4 Relay"
<devnull+hexlabsecurity.proton.me@kernel.org>,
hexlabsecurity@proton.me, linux-iio@vger.kernel.org,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Sean Nyekjaer" <sean@geanix.com>,
linux-kernel@vger.kernel.org,
"David Lechner" <dlechner@baylibre.com>
Subject: Re: [PATCH] iio: accel: fxls8962af: clamp the device-reported FIFO sample count
Date: Mon, 15 Jun 2026 13:16:55 +0300 [thread overview]
Message-ID: <ai_RF9BG17SZ7Tiz@ashevche-desk.local> (raw)
In-Reply-To: <20260614144337.3b3dab1a@jic23-huawei>
On Sun, Jun 14, 2026 at 02:43:37PM +0100, Jonathan Cameron wrote:
> On Sat, 13 Jun 2026 03:13:19 -0500
> Bryam Vargas via B4 Relay <devnull+hexlabsecurity.proton.me@kernel.org> wrote:
...
> > Fixes: 79e3a5bdd9ef ("iio: accel: fxls8962af: add hw buffered sampling")
>
> This is hardening against broken devices. Nice to have, but not a fix and
> not back port material. In general we do harden against the simple cases
> but to catch the more complex interactions would require both a hard to do
> audit and significant extra code.
On top of that using min_t(u8, ...) is prone to more interesting errors,
so one basically should immediately raise a red flag here. As Jonathan
said, use min() or even clamp() as the Subject states.
foo = clamp(bar, 0, GOO);
if (!foo)
return 0;
> So nice to have this but not a fix.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-06-15 10:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-13 8:13 Bryam Vargas via B4 Relay
2026-06-14 13:43 ` Jonathan Cameron
2026-06-15 10:16 ` Andy Shevchenko [this message]
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=ai_RF9BG17SZ7Tiz@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=devnull+hexlabsecurity.proton.me@kernel.org \
--cc=dlechner@baylibre.com \
--cc=hexlabsecurity@proton.me \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=sean@geanix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®