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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130603192140.GA28973@localhost>
Date:	Mon, 3 Jun 2013 21:21:40 +0200
From:	Pablo Neira Ayuso <pablo@...filter.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org, davem@...emloft.net, kaber@...sh.net
Subject: Re: [PATCHv2 net-next] netlink: allow large data transfers from
 user-space

On Mon, Jun 03, 2013 at 11:00:37AM -0700, Eric Dumazet wrote:
> On Mon, 2013-06-03 at 19:41 +0200, Pablo Neira Ayuso wrote:
> > Hi Eric!
> > 
> > On Mon, Jun 03, 2013 at 10:12:39AM -0700, Eric Dumazet wrote:
> > > On Mon, 2013-06-03 at 18:39 +0200, Pablo Neira Ayuso wrote:
> > > 
> > > > +	if (is_vmalloc_addr(skb->head)) {
> > > > +		vfree(skb->head);
> > > > +		skb->data = NULL;
> > > > +	}
> > > >  
> > > 
> > > You probably meant :
> > > 
> > > 	skb->head = NULL;
> > > 
> > > Now, cross our fingers we do not skb_orphan() these skb too early :)
> > 
> > skb_release_all checks for skb->data != NULL to release skb->head as
> > it would have been allocated via kmalloc. This didn't look very
> > intuitive to me when I hit a panic while testing my patch either.
> 
> Oh well, this is probably an old typo because of skb_release_data() name
> 
> So we indeed do :
> 
> 	if (likely(skb->data))
> 		skb_release_data(skb);
> 
> But it really should be
> 
> 	if (likely(skb->head))
> 		skb_release_head(skb);
> 
> as skb->data is not pointing to the beginning of the area to be freed.

Indeed, this change is recent, happened in 0ebd0ac.

> BTW, __alloc_skb_head() inits skb->data to NULL, and leaves skb->head
> uninitialized. Thats is really not nice...

Should be skb->head = NULL and leave skb->data unset.

I'll send a patch to fix that.
--
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