Re: [PATCH v2 2/2] i2c: dev: don't allow user-space to deadlock the kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 18, 2023 at 3:59 PM Hillf Danton <hdanton@xxxxxxxx> wrote:
>
> On Thu, 29 Dec 2022 17:00:45 +0100 Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> >
> > @@ -44,8 +45,14 @@ struct i2c_dev {
> >       struct i2c_adapter *adap;
> >       struct device dev;
> >       struct cdev cdev;
> > +     struct rw_semaphore sem;
>
>         int                     state;
> #define STATE_RELEASED 1
> #define STATE_DETACHED 2
> >  };
>
> Because syscalls like read, write and ioctl have completed upon release,
> serializing the release and detach pathes is a cure to the issue.
>

Please elaborate because I have no idea what you mean by that.

Bart



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux