Re: [PATCH v2] iio: buffer: fix use-after-free for attached_buffers array

2021-03-13 Thread Jonathan Cameron
On Mon, 8 Mar 2021 09:29:39 +0200 Alexandru Ardelean wrote: > On Sun, Mar 7, 2021 at 8:55 PM Alexandru Ardelean > wrote: > > > > Thanks to Lars for finding this. > > The free of the 'attached_buffers' array should be done as late as > > possible. This change moves it to iio_buffers_put(), which

Re: [PATCH v2] iio: buffer: fix use-after-free for attached_buffers array

2021-03-07 Thread Alexandru Ardelean
On Sun, Mar 7, 2021 at 8:55 PM Alexandru Ardelean wrote: > > Thanks to Lars for finding this. > The free of the 'attached_buffers' array should be done as late as > possible. This change moves it to iio_buffers_put(), which looks like > the best place for it, since it takes place right before the

[PATCH v2] iio: buffer: fix use-after-free for attached_buffers array

2021-03-07 Thread Alexandru Ardelean
Thanks to Lars for finding this. The free of the 'attached_buffers' array should be done as late as possible. This change moves it to iio_buffers_put(), which looks like the best place for it, since it takes place right before the IIO device data is free'd. The free of this array will be handled by