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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 30 Jun 2010 13:46:37 +0900
From:	Simon Horman <horms@...ge.net.au>
To:	Andreas Steffen <andreas.steffen@....ch>
Cc:	netdev@...r.kernel.org
Subject: Re: static inline int xfrm_mark_get() broken

On Mon, Jun 28, 2010 at 08:46:49PM +0200, Andreas Steffen wrote:
> Hi,
> 
> experimenting with the new XFRM_MARK feature of the 2.6.34 kernel
> I found out that the extraction of the mark mask might accidentally
> work on 64 bit platforms but on 32 bit platforms the function is
> awfully broken. The rather trivial patch attached to this mail fixes
> the problem. Otherwise the XFRM_MARK feature seems quite promising!
> 
> Best regards
> 
> Andreas
> 
> ======================================================================
> Andreas Steffen                         e-mail: andreas.steffen@....ch
> Institute for Internet Technologies and Applications
> Hochschule fuer Technik Rapperswil      phone:  +41 55 222 42 68
> CH-8640 Rapperswil (Switzerland)        mobile: +41 76 340 25 56
> ===========================================================[ITA-HSR]==

> --- linux/include/net/xfrm.h.ori	2010-06-28 18:53:28.229489876 +0200
> +++ linux/include/net/xfrm.h	2010-06-28 18:53:50.745487383 +0200
> @@ -1587,7 +1587,7 @@
>  static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m)
>  {
>  	if (attrs[XFRMA_MARK])
> -		memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(m));
> +		memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(struct xfrm_mark));

This fix looks correct to me, but
I believe that sizeof(*m) is the preferred style.

>  	else
>  		m->v = m->m = 0;
>  

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