Re: [PATCH 4.19 1/1] batman-adv: Avoid free/alloc race when handling OGM2 buffer

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

 



On Mon, Mar 16, 2020 at 11:51:15PM +0100, Sven Eckelmann wrote:
> commit a8d23cbbf6c9f515ed678204ad2962be7c336344 upstream.
> 
> A B.A.T.M.A.N. V virtual interface has an OGM2 packet buffer which is
> initialized using data from the netdevice notifier and other rtnetlink
> related hooks. It is sent regularly via various slave interfaces of the
> batadv virtual interface and in this process also modified (realloced) to
> integrate additional state information via TVLV containers.
> 
> It must be avoided that the worker item is executed without a common lock
> with the netdevice notifier/rtnetlink helpers. Otherwise it can either
> happen that half modified data is sent out or the functions modifying the
> OGM2 buffer try to access already freed memory regions.
> 
> Fixes: 0da0035942d4 ("batman-adv: OGMv2 - add basic infrastructure")
> Signed-off-by: Sven Eckelmann <sven@xxxxxxxxxxxxx>
> Signed-off-by: Simon Wunderlich <sw@xxxxxxxxxxxxxxxxxx>
> ---
>  net/batman-adv/bat_v_ogm.c | 42 ++++++++++++++++++++++++++++++--------
>  net/batman-adv/types.h     |  4 ++++
>  2 files changed, 38 insertions(+), 8 deletions(-)

Now applied, thanks!

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux