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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpU_dbze9u2U+QjasAw6Rg3UPkax-rs=W1kwi3z4d5pwwg@mail.gmail.com>
Date:   Thu, 13 Feb 2020 14:50:42 -0800
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     Jason Baron <jbaron@...mai.com>
Cc:     David Miller <davem@...emloft.net>, Jiri Pirko <jiri@...nulli.us>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>,
        soukjin.bae@...sung.com, Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net] net: sched: correct flower port blocking

On Thu, Feb 13, 2020 at 12:31 PM Jason Baron <jbaron@...mai.com> wrote:
>
> tc flower rules that are based on src or dst port blocking are sometimes
> ineffective due to uninitialized stack data. __skb_flow_dissect() extracts
> ports from the skb for tc flower to match against. However, the port
> dissection is not done when when the FLOW_DIS_IS_FRAGMENT bit is set in
> key_control->flags. All callers of __skb_flow_dissect(), zero-out the
> key_control field except for fl_classify() as used by the flower
> classifier. Thus, the FLOW_DIS_IS_FRAGMENT may be set on entry to
> __skb_flow_dissect(), since key_control is allocated on the stack
> and may not be initialized.
>
> Since key_basic and key_control are present for all flow keys, let's
> make sure they are initialized.
>
> Fixes: 62230715fd24 ("flow_dissector: do not dissect l4 ports for fragments")
> Co-developed-by: Eric Dumazet <edumazet@...gle.com>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Signed-off-by: Jason Baron <jbaron@...mai.com>
> ---
>  include/linux/skbuff.h | 8 ++++++++
>  net/sched/cls_flower.c | 1 +
>  2 files changed, 9 insertions(+)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index ca8806b..f953bfa 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -1288,6 +1288,14 @@ bool __skb_flow_dissect(const struct net *net,
>                         void *data, __be16 proto, int nhoff, int hlen,
>                         unsigned int flags);
>
> +static inline void
> +skb_flow_dissect_init_key(struct flow_dissector_key_control *key_control,
> +                         struct flow_dissector_key_basic *key_basic)
> +{
> +       memset(key_control, 0, sizeof(*key_control));
> +       memset(key_basic, 0, sizeof(*key_basic));
> +}

I think this function has nothing to do with skb, therefore it fits
better in include/net/flow_dissector.h? And remove skb prefix from
its name too.

Other than this:

Acked-by: Cong Wang <xiyou.wangcong@...il.com>

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ