From: Jiri Pirko <j...@resnulli.us>
Date: Sun, 28 Jul 2019 14:56:36 +0200

> From: Jiri Pirko <j...@mellanox.com>
> 
> Commit aca51397d014 ("netns: Fix arbitrary net_device-s corruptions
> on net_ns stop.") introduced a possibility to hit a BUG in case device
> is returning back to init_net and two following conditions are met:
> 1) dev->ifindex value is used in a name of another "dev%d"
>    device in init_net.
> 2) dev->name is used by another device in init_net.
> 
> Under real life circumstances this is hard to get. Therefore this has
> been present happily for over 10 years. To reproduce:
 ...
> Fix this by checking if a device with the same name exists in init_net
> and fallback to original code - dev%d to allocate name - in case it does.
> 
> This was found using syzkaller.
> 
> Fixes: aca51397d014 ("netns: Fix arbitrary net_device-s corruptions on net_ns 
> stop.")
> Signed-off-by: Jiri Pirko <j...@mellanox.com>

Very interesting :)

Applied and queued up for -stable, thanks.

Reply via email to