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

2021-03-07 Thread Alexandru Ardelean
On Sun, Mar 7, 2021 at 2:54 PM Lars-Peter Clausen wrote: > > On 3/7/21 1:36 PM, Jonathan Cameron wrote: > > On Sat, 6 Mar 2021 18:47:10 +0200 > > Alexandru Ardelean wrote: > > > >> Thanks to Lars for finding this. > >> The free of the 'attached_buffers' array should be done as late as > >>

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

2021-03-07 Thread Lars-Peter Clausen
On 3/7/21 1:36 PM, Jonathan Cameron wrote: On Sat, 6 Mar 2021 18:47:10 +0200 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

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

2021-03-07 Thread Jonathan Cameron
On Sat, 6 Mar 2021 18:47:10 +0200 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

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

2021-03-06 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