lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 20 Nov 2020 11:24:13 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Davide Caratti <dcaratti@...hat.com>
Cc:     Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org,
        gnault@...hat.com, marcelo.leitner@...il.com
Subject: Re: [PATCH net] net/sched: act_mpls: ensure LSE is pullable before
 reading it

On Wed, 18 Nov 2020 17:36:52 +0100 Davide Caratti wrote:
> when 'act_mpls' is used to mangle the LSE, the current value is read from
> the packet with mpls_hdr(): ensure that the label is contained in the skb
> "linear" area.
> 
> Found by code inspection.
> 
> Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")
> Signed-off-by: Davide Caratti <dcaratti@...hat.com>
> ---
>  net/sched/act_mpls.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c
> index 5c7456e5b5cf..03138ad59e9b 100644
> --- a/net/sched/act_mpls.c
> +++ b/net/sched/act_mpls.c
> @@ -105,6 +105,9 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a,
>  			goto drop;
>  		break;
>  	case TCA_MPLS_ACT_MODIFY:
> +		if (!pskb_may_pull(skb,
> +				   skb_network_offset(skb) + sizeof(new_lse)))

nit: MPLS_HLEN?

> +			goto drop;
>  		new_lse = tcf_mpls_get_lse(mpls_hdr(skb), p, false);
>  		if (skb_mpls_update_lse(skb, new_lse))
>  			goto drop;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ