]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 17:28:00 +0000 (18:28 +0100)
commit6c7cd7a91b5ddbef807895d035aae5bcb05c5970
tree187a1f3dd5a75fcfc555419b77ad00e8fe76c92a
parent8a67427dc854ac1ebab325047d906823d3b4469f
r8169: fix potential skb double free in an error path

[ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]

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: b423e9ae49d7 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/realtek/r8169.c