bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ahabdels@gmail.com
Cc: kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net,
	kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com,
	john.fastabend@gmail.com, kpsingh@chromium.org,
	kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, yuehaibing@huawei.com,
	eric.dumazet@gmail.com, david.lebrun@uclouvain.be
Subject: Re: [net] seg6: fix seg6_validate_srh() to avoid slab-out-of-bounds
Date: Thu, 04 Jun 2020 15:40:20 -0700 (PDT)	[thread overview]
Message-ID: <20200604.154020.1609247845922031946.davem@davemloft.net> (raw)
In-Reply-To: <20200603065442.2745-1-ahabdels@gmail.com>

From: Ahmed Abdelsalam <ahabdels@gmail.com>
Date: Wed,  3 Jun 2020 06:54:42 +0000

> The seg6_validate_srh() is used to validate SRH for three cases:
> 
> case1: SRH of data-plane SRv6 packets to be processed by the Linux kernel.
> Case2: SRH of the netlink message received  from user-space (iproute2)
> Case3: SRH injected into packets through setsockopt
> 
> In case1, the SRH can be encoded in the Reduced way (i.e., first SID is
> carried in DA only and not represented as SID in the SRH) and the
> seg6_validate_srh() now handles this case correctly.
> 
> In case2 and case3, the SRH shouldn’t be encoded in the Reduced way
> otherwise we lose the first segment (i.e., the first hop).
> 
> The current implementation of the seg6_validate_srh() allow SRH of case2
> and case3 to be encoded in the Reduced way. This leads a slab-out-of-bounds
> problem.
> 
> This patch verifies SRH of case1, case2 and case3. Allowing case1 to be
> reduced while preventing SRH of case2 and case3 from being reduced .
> 
> Reported-by: syzbot+e8c028b62439eac42073@syzkaller.appspotmail.com
> Reported-by: YueHaibing <yuehaibing@huawei.com>
> Fixes: 0cb7498f234e ("seg6: fix SRH processing to comply with RFC8754")
> Signed-off-by: Ahmed Abdelsalam <ahabdels@gmail.com>

Applied, thanks.

      reply	other threads:[~2020-06-04 22:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03  6:54 [net] seg6: fix seg6_validate_srh() to avoid slab-out-of-bounds Ahmed Abdelsalam
2020-06-04 22:40 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200604.154020.1609247845922031946.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ahabdels@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=david.lebrun@uclouvain.be \
    --cc=eric.dumazet@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=kuba@kernel.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    --cc=yoshfuji@linux-ipv6.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).