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: <20160507113025.67c3ab43@halley>
Date:	Sat, 7 May 2016 11:30:25 +0300
From:	Shmulik Ladkani <shmulik.ladkani@...il.com>
To:	David Ahern <dsa@...ulusnetworks.com>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6

Hi David,

On Fri,  6 May 2016 18:49:40 -0700 David Ahern <dsa@...ulusnetworks.com> wrote:
> +static bool ipv6_ndisc_frame(const struct sk_buff *skb)
> +{
> +	const struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb->data;
> +	size_t hlen = sizeof(*ipv6h);
> +	bool rc = false;
> +
> +	if (ipv6h->nexthdr == NEXTHDR_ICMP) {
> +		const struct icmp6hdr *icmph;
> +
> +		if (skb->len < hlen + sizeof(*icmph))
> +			goto out;
> +
> +		icmph = (struct icmp6hdr *)(skb->data + sizeof(*ipv6h));
> +		switch (icmph->icmp6_type) {

Don't we need an additional pskb_may_pull here?

If I get it right, 'ipv6_rcv' only assures sizeof(ipv6hdr) to be in the
linear header (unless it's a NEXTHDR_HOP, which is not the case here).

> +static inline
> +struct sk_buff *l3mdev_l3_rcv(struct sk_buff *skb, u16 proto)
> +{
> +	struct net_device *master = NULL;
> +
> +	if (netif_is_l3_slave(skb->dev))
> +		master = netdev_master_upper_dev_get_rcu(skb->dev);
> +
> +	else if (netif_is_l3_master(skb->dev))
> +		master = skb->dev;
> +
> +	if (master && master->l3mdev_ops->l3mdev_l3_rcv)
> +		skb = master->l3mdev_ops->l3mdev_l3_rcv(master, skb, proto);

In the case where netif_is_l3_master(skb->dev) is true, can you explain
why we need to pass it through the l3mdev_l3_rcv callback again?

Regards,
Shmulik

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ