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] [day] [month] [year] [list]
Date:	Mon, 26 Sep 2011 17:22:26 +0200
From:	Manfred Spraul <manfred@...orfullife.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC:	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Mike Galbraith <efault@....de>
Subject: Re: [PATCH 3/3] [RFC] ipc/sem.c: replace busy loop with completion

On 09/26/2011 10:00 AM, Peter Zijlstra wrote:
> On Sat, 2011-09-24 at 19:37 +0200, Manfred Spraul wrote:
>
> 	sma = sem_lock(ns, semid);
>
>> @@ -1456,8 +1414,17 @@ sleep_again:
>>          /*
>>           * Wait until it's guaranteed that no wakeup_sem_queue_do() is ongoing.
>>           */
>> -       error = get_queue_result(&queue);
>> -
>> +       error = queue.status;
>> +       if (error != -EINTR) {
>> +               /* If there is a return code, then we can leave immediately. */
>> +               if (!IS_ERR(sma)) {
>> +                       sem_unlock(sma);
>> +               }
>> +               /* Except that we must wait for the hands-off */
>> +               wait_for_completion(&queue.done);
>> +               goto out_free;
> 		you just lost a sem_unlock() in the IS_ERR() case.
>
>> +       }
If IS_ERR(), then sem_lock() failed - thus there must be no unlock.

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