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: <1306526219.2533.3.camel@edumazet-laptop>
Date:	Fri, 27 May 2011 21:56:59 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Arun Sharma <asharma@...com>
Cc:	David Miller <davem@...emloft.net>,
	Maximilian Engelhardt <maxi@...monizer.de>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	StuStaNet Vorstand <vorstand@...sta.mhn.de>,
	Yann Dupont <Yann.Dupont@...v-nantes.fr>,
	Denys Fedoryshchenko <denys@...p.net.lb>
Subject: Re: Kernel crash after using new Intel NIC (igb)

Le vendredi 27 mai 2011 à 10:52 -0700, Arun Sharma a écrit :
> On 5/26/11 8:27 PM, Eric Dumazet wrote:
> 
> Looks good. Thanks for taking care of this.
> 
> > +static bool atomic_add_unless_return(atomic_t *ptr, int a, int u, int *newv)
> > +{
> > +	int cur, old = atomic_read(ptr);
> > +
> > +	while (old != u) {
> > +		*newv = old + a;
> > +		cur = atomic_cmpxchg(ptr, old, *newv);
> > +		if (cur == old)
> > +			return true;
> > +		old = cur;
> > +	}
> > +	return false;
> > +}
> 
> This looks very similar to atomic_add_unless(). If we had a
> 
> __atomic_add_unless() that returned "old", we could then do:
> 
> atomic_add_unless() { return __atomic_add_unless() != u }
> atomic_add_unless_return() { return __atomic_add_unless() + a}
> 

Sure !

I preferred to not touch lot of files in kernel (atomic_add_unless() is
defined in several files) because its a stable candidate patch (2.6.36+)

So a cleanup patch for 2.6.40+ is certainly doable, do you want to do
this ?

Thanks



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ