]> git.baikalelectronics.ru Git - kernel.git/commit
packet: Do not leak dev refcounts on error exit
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 8 Jan 2019 23:27:06 +0000 (23:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jan 2019 02:41:40 +0000 (21:41 -0500)
commit5e8a6e21ae104a2f6af8ad96933f9d1c68ace939
tree30b1ba6359a7ec06944d95b9359270a96aa4c82d
parenteb22b5142763dcb9a91f500b3b38771a45b383f4
packet: Do not leak dev refcounts on error exit

'dev' is non NULL when the addr_len check triggers so it must goto a label
that does the dev_put otherwise dev will have a leaked refcount.

This bug causes the ib_ipoib module to become unloadable when using
systemd-network as it triggers this check on InfiniBand links.

Fixes: f84c281d5f4d ("packet: validate address length")
Reported-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c