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: <20201113174246.300997fb@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Fri, 13 Nov 2020 17:42:46 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Pablo Neira Ayuso <pablo@...filter.org>
Cc:     netfilter-devel@...r.kernel.org, davem@...emloft.net,
        netdev@...r.kernel.org, razor@...ckwall.org, jeremy@...zel.net
Subject: Re: [PATCH net-next,v3 3/9] net: resolve forwarding path from
 virtual netdevice and HW destination address

On Wed, 11 Nov 2020 20:37:31 +0100 Pablo Neira Ayuso wrote:
> +int dev_fill_forward_path(const struct net_device *dev, const u8 *daddr,
> +			  struct net_device_path_stack *stack)
> +{
> +	const struct net_device *last_dev;
> +	struct net_device_path_ctx ctx;
> +	struct net_device_path *path;
> +	int ret = 0;
> +
> +	memset(&ctx, 0, sizeof(ctx));
> +	ctx.dev = dev;
> +	ctx.daddr = daddr;
> +
> +	while (ctx.dev && ctx.dev->netdev_ops->ndo_fill_forward_path) {
> +		last_dev = ctx.dev;
> +
> +		path = &stack->path[stack->num_paths++];

I don't see you checking that this stack doesn't overflow.

What am I missing?

> +		ret = ctx.dev->netdev_ops->ndo_fill_forward_path(&ctx, path);
> +		if (ret < 0)
> +			return -1;
> +
> +		if (WARN_ON_ONCE(last_dev == ctx.dev))
> +			return -1;
> +	}
> +	path = &stack->path[stack->num_paths++];
> +	path->type = DEV_PATH_ETHERNET;
> +	path->dev = ctx.dev;
> +
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(dev_fill_forward_path);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ