public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net] ipv6: do not leave garbage in rt->fib6_metrics
Date: Fri, 5 Oct 2018 10:29:36 -0600	[thread overview]
Message-ID: <5c82ffec-bb35-9bc9-38f4-95962691641a@gmail.com> (raw)
In-Reply-To: <20181005161750.179275-1-edumazet@google.com>

On 10/5/18 10:17 AM, Eric Dumazet wrote:
> In case ip_fib_metrics_init() returns an error, we better
> rewrite rt->fib6_metrics with &dst_default_metrics so that
> we do not crash later in ip_fib_metrics_put()
> 
> Fixes: 767a2217533f ("net: common metrics init helper for FIB entries")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>

Where is syzbot sending the reports? I don't see it on netdev. I would
like to understand how it triggered the failure of a 68-byte malloc.


> ---
>  net/ipv6/route.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 6c1d817151cae45421dc976c5ea082b4115650be..74d97addf1af20dda0c2b6a2018e88696f9f7d5a 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -2976,6 +2976,8 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
>  	rt->fib6_metrics = ip_fib_metrics_init(net, cfg->fc_mx, cfg->fc_mx_len);
>  	if (IS_ERR(rt->fib6_metrics)) {
>  		err = PTR_ERR(rt->fib6_metrics);
> +		/* Do not leave garbage there. */
> +		rt->fib6_metrics = (struct dst_metrics *)&dst_default_metrics;
>  		goto out;
>  	}
>  
> 

Reviewed-by: David Ahern <dsahern@gmail.com>

Thanks, Eric.

  reply	other threads:[~2018-10-05 23:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 16:17 [PATCH net] ipv6: do not leave garbage in rt->fib6_metrics Eric Dumazet
2018-10-05 16:29 ` David Ahern [this message]
2018-10-05 16:33   ` Eric Dumazet
2018-10-05 18:57 ` David Miller
2018-10-05 19:01   ` Eric Dumazet

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=5c82ffec-bb35-9bc9-38f4-95962691641a@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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