Re: [PATCH v2 3/3] i2c: dev: clean up registration

From: Johan Hovold

Date: Tue Nov 10 2026 - 08:46:01 EST


On Tue, Nov 10, 2026 at 01:54:18PM +0100, Bartosz Golaszewski wrote:
> On Tue, Nov 10, 2026 at 01:42:29PM +0100, Johan Hovold wrote:

> > I had rejected that Sashiko finding as being too outlandish for us to
> > have to worry about. As I just in a reply to Bartosz:
> >
> > If a malicious actor has physical access to the machine, we have
> > bigger problems than worrying about them going out of their way
> > to cause a USB hub worker thread to hang. :)
> >
> > Limiting the critical section can possibly be done as a follow-up, but
> > it may not even be worth the effort doing that.
> >
>
> Why is limiting the scope of the semaphore such a big deal though? It's
> not a big change, literally just use scoped_guard() instead. Why would
> we commit incorrect code if we can correct it in a v3 with not much
> effort? You're fixing a use-case where user-space can hang a kernel
> thread, why not do it for corner-cases too?

A *malicious* actor with physical access (and CAP_SYS_PTRACE) can cause
a thread to hang while janking out an USB attached I2C adapter out a of
machine if they try really hard. Don't you see how silly that is?

I posted this patch months ago, but IIRC it will complicate things
somewhat without any relevant benefit. Probably just a larger diff which
is unnecessary for a patch marked for stable.

If Wolfram insists, I can revisit this, but I don't think it's needed.

Johan