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:	Sat, 05 Apr 2008 22:46:23 +0900 (JST)
From:	YOSHIFUJI Hideaki / 吉藤英明 
	<yoshfuji@...ux-ipv6.org>
To:	roszenrami@...il.com, davem@...emloft.net
Cc:	netdev@...r.kernel.org, yoshfuji@...ux-ipv6.org
Subject: Re: [GIT PULL net-2.6.26] [IPV6] MROUTE: Support multicast routing.

Hello.

In article <b25312890804050348w24bcba83y7391c89b1a9b25bc@...l.gmail.com> (at Sat, 5 Apr 2008 13:48:30 +0300), "Rami Rosen" <roszenrami@...il.com> says:

> It seems to me that there is an error in this patch, when building on
> 64 machines.
:
> ...
> net/ipv6/ip6mr.c: In function 'ip6mr_cache_resolve':
> net/ipv6/ip6mr.c:736: error: invalid operands to binary -
> net/ipv6/ip6mr.c: In function 'ip6mr_fill_mroute':
> net/ipv6/ip6mr.c:1565: warning: initialization makes pointer from
> integer without a cast
> net/ipv6/ip6mr.c:1585: error: invalid operands to binary -
> make[2]: *** [net/ipv6/ip6mr.o] Error 1
> make[1]: *** [net/ipv6] Error 2
> make: *** [net] Error 2
> ...
> ...
:
> It seems to me that this could be solved by calling skb_tail_pointer(), thus:
> nlh->nlmsg_len = skb_tail_pointer(skb) - (u8 *)nlh;

Good point, thanks.

I've pushed the following fix into the tree:
	git://git.linux-ipv6.org/gitroot/yoshfuji/linux-2.6-dev.git net-2.6.26-mroute-20080405
on top of current net-2.6.26 tree.

Regards,

--yoshfuji
---------------
Subject: [IPV6] MROUTE: Use skb_tail_pointer(skb) instead of skb->tail.

This bug resulted in compilation error on 64bit machines.
Pointed out by Rami Rosen <roszenrami@...il.com>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
---
 net/ipv6/ip6mr.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 2b70774..da673ef 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -733,7 +733,7 @@ static void ip6mr_cache_resolve(struct mfc6_cache *uc, struct mfc6_cache *c)
 			struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct ipv6hdr));
 
 			if (ip6mr_fill_mroute(skb, c, NLMSG_DATA(nlh)) > 0) {
-				nlh->nlmsg_len = skb->tail - (u8 *)nlh;
+				nlh->nlmsg_len = skb_tail_pointer(skb) - (u8 *)nlh;
 			} else {
 				nlh->nlmsg_type = NLMSG_ERROR;
 				nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr));
@@ -1562,7 +1562,7 @@ ip6mr_fill_mroute(struct sk_buff *skb, struct mfc6_cache *c, struct rtmsg *rtm)
 	int ct;
 	struct rtnexthop *nhp;
 	struct net_device *dev = vif6_table[c->mf6c_parent].dev;
-	u8 *b = skb->tail;
+	u8 *b = skb_tail_pointer(skb);
 	struct rtattr *mp_head;
 
 	if (dev)
@@ -1582,7 +1582,7 @@ ip6mr_fill_mroute(struct sk_buff *skb, struct mfc6_cache *c, struct rtmsg *rtm)
 		}
 	}
 	mp_head->rta_type = RTA_MULTIPATH;
-	mp_head->rta_len = skb->tail - (u8 *)mp_head;
+	mp_head->rta_len = skb_tail_pointer(skb) - (u8 *)mp_head;
 	rtm->rtm_type = RTN_MULTICAST;
 	return 1;
 
-- 
1.4.4.4

--
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