mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
batman-adv: frag: fix primary_if leak on failed linearization
commit353d2c1d54upstream. If the skb has a frag_list, it must be linearized before it can be split using skb_split(). But when this step failed, it must not only free the skb but also take care of the reference to the already found primary_if. Cc: stable@vger.kernel.org Reported-by: Sashiko <sashiko-bot@kernel.org> Fixes:a063f2fba3("batman-adv: Don't skb_split skbuffs with frag_list") Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
740542f11b
commit
d2148aeee9
@@ -551,7 +551,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
|
||||
*/
|
||||
if (skb_has_frag_list(skb) && __skb_linearize(skb)) {
|
||||
ret = -ENOMEM;
|
||||
goto free_skb;
|
||||
goto put_primary_if;
|
||||
}
|
||||
|
||||
/* Create one header to be copied to all fragments */
|
||||
|
||||
Reference in New Issue
Block a user