]> git.baikalelectronics.ru Git - kernel.git/commit
net: skbuff: ensure LSE is pullable before decrementing the MPLS ttl
authorDavide Caratti <dcaratti@redhat.com>
Thu, 3 Dec 2020 09:58:21 +0000 (10:58 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Dec 2020 19:13:21 +0000 (11:13 -0800)
commit814772c385fd8bbd867e0d88935c639f99e29f56
tree3c31c25a52609be88914c1b5f78aa8d4c06f31f4
parentb45b68767d8796f56819e57eaa8380218cfafd01
net: skbuff: ensure LSE is pullable before decrementing the MPLS ttl

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: 08c1ecd9d277 ("net: sched: add mpls manipulation actions to TC")
Reported-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Link: https://lore.kernel.org/r/53659f28be8bc336c113b5254dc637cc76bbae91.1606987074.git.dcaratti@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skbuff.c