Re: [PATCH net-next,v3 3/9] net: resolve forwarding path from virtual netdevice and HW destination address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 13, 2020 at 05:42:46PM -0800, Jakub Kicinski wrote:
> 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?

Yes, this check in missing indeed.

I'll fix it and will include it in the next patchset version including
Nikolay's request.

Thank you.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux