This is a note to let you know that I've just added the patch titled net: skbuff: ensure LSE is pullable before decrementing the MPLS ttl to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-skbuff-ensure-lse-is-pullable-before-decrementing-the-mpls-ttl.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Sun Dec 6 10:20:28 AM CET 2020 From: Davide Caratti <dcaratti@xxxxxxxxxx> Date: Thu, 3 Dec 2020 10:58:21 +0100 Subject: net: skbuff: ensure LSE is pullable before decrementing the MPLS ttl From: Davide Caratti <dcaratti@xxxxxxxxxx> [ Upstream commit 13de4ed9e3a9ccbe54d05f7d5c773f69ecaf6c64 ] skb_mpls_dec_ttl() reads the LSE without ensuring that it is contained in the skb "linear" area. Fix this calling pskb_may_pull() before reading the current ttl. Found by code inspection. Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC") Reported-by: Marcelo Ricardo Leitner <marcelo.leitner@xxxxxxxxx> Signed-off-by: Davide Caratti <dcaratti@xxxxxxxxxx> Link: https://lore.kernel.org/r/53659f28be8bc336c113b5254dc637cc76bbae91.1606987074.git.dcaratti@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/core/skbuff.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5618,6 +5618,9 @@ int skb_mpls_dec_ttl(struct sk_buff *skb if (unlikely(!eth_p_mpls(skb->protocol))) return -EINVAL; + if (!pskb_may_pull(skb, skb_network_offset(skb) + MPLS_HLEN)) + return -ENOMEM; + lse = be32_to_cpu(mpls_hdr(skb)->label_stack_entry); ttl = (lse & MPLS_LS_TTL_MASK) >> MPLS_LS_TTL_SHIFT; if (!--ttl) Patches currently in stable-queue which might be from dcaratti@xxxxxxxxxx are queue-5.4/net-openvswitch-ensure-lse-is-pullable-before-reading-it.patch queue-5.4/net-skbuff-ensure-lse-is-pullable-before-decrementing-the-mpls-ttl.patch queue-5.4/net-sched-act_mpls-ensure-lse-is-pullable-before-reading-it.patch