5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Avi Weiss [ Upstream commit 24614e72df484ad50ecba98aaa88c7df2448c122 ] skb_mpls_dec_ttl() decrements the u8 TTL before checking whether it expired. An incoming TTL of zero wraps to 255, causing the TC MPLS dec_ttl action to pass an expired packet instead of dropping it. Reject a zero TTL before the decrement while preserving the existing behavior for TTL one and valid TTL values. Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC") Signed-off-by: Avi Weiss Reviewed-by: Xia Yan Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261031114135.3784868-2-thnkslprpt@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 207c4d85fad78..408e4b9935a10 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -6026,7 +6026,7 @@ int skb_mpls_dec_ttl(struct sk_buff *skb) lse = be32_to_cpu(mpls_hdr(skb)->label_stack_entry); ttl = (lse & MPLS_LS_TTL_MASK) >> MPLS_LS_TTL_SHIFT; - if (!--ttl) + if (!ttl || !--ttl) return -EINVAL; lse &= ~MPLS_LS_TTL_MASK; -- 2.53.0