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]
Date:	Tue, 11 Mar 2014 16:20:29 +0100
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Michal Kubecek <mkubecek@...e.cz>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	kuznet@....inr.ac.ru, jmorris@...ei.org, yoshfuji@...ux-ipv6.org,
	kaber@...sh.net
Subject: Re: [PATCH net] ipv6: do not overwrite inetpeer metrics prematurely

On Tue, Mar 11, 2014 at 04:08:14PM +0100, Michal Kubecek wrote:
> +static int fib6_commit_metrics(struct dst_entry *old_dst, struct dst_entry *dst,
> +			       struct nlattr *mx, int mx_len)
> +{
> +	struct nlattr *nla;
> +	int remaining;
> +	u32 *mp;
> +
> +	/* no new metrics and not inheriting an inetpeer with old ones */
> +	if (!mx && (!(dst->flags & DST_HOST) || !old_dst ||
> +		    dst_metrics_read_only(old_dst)))
> +		return 0;
> +
> +	mp = dst_metrics_write_ptr(dst);
> +	if ((dst->flags & DST_HOST) &&
> +	    old_dst && !dst_metrics_read_only(old_dst))
> +		memset(mp, 0, RTAX_MAX * sizeof(u32));
> +

Small question:

Wouldn't make it easier if we move the kzalloc/dst_init_metrics part to
here in case we aren't a DST_HOST and remove it from ip6_route_add, too?

Otherwise (but really just a first look!), it seems ok to me.

Thanks,

  Hannes

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ