]> git.baikalelectronics.ru Git - kernel.git/commit
r8169: fix potential skb double free in an error path
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 5 Nov 2020 14:28:42 +0000 (15:28 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 7 Nov 2020 20:10:16 +0000 (12:10 -0800)
commit6c3786736bccf8e6073a65b9363cb456dfaace3a
tree141d253268458cd855e1fa7d882014e837a418f5
parent0a365af38a4f8394bc64f2ee9b5aa32bb74900ee
r8169: fix potential skb double free in an error path

The caller of rtl8169_tso_csum_v2() frees the skb if false is returned.
eth_skb_pad() internally frees the skb on error what would result in a
double free. Therefore use __skb_put_padto() directly and instruct it
to not free the skb on error.

Fixes: cce027ca23fb ("r8169: fix offloaded tx checksum for small packets.")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/f7e68191-acff-9ded-4263-c016428a8762@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/realtek/r8169_main.c