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: <5371085E.2050407@colorfullife.com>
Date:	Mon, 12 May 2014 19:43:58 +0200
From:	Manfred Spraul <manfred@...orfullife.com>
To:	mtk.manpages@...il.com
CC:	Davidlohr Bueso <davidlohr.bueso@...com>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>, 1vier1@....de
Subject: Re: [PATCH 0/6] ipc/sem.c: Fix semctl(,,{GETNCNT,GETZCNT})

Hi Michael,

On 05/12/2014 10:02 AM, Michael Kerrisk (man-pages) wrote:
> Hi Manfred,
>
> On Sat, May 10, 2014 at 12:03 PM, Manfred Spraul
> <manfred@...orfullife.com> wrote:
>> Hi all,
>>
>> According to the man page of semop(), semzcnt or semncnt are increased
>> exactly for the operation that couldn't proceed.
> Perhaps it's woth noting here that the man page is also pretty close
> to the POSIX text that describes semzcnt and semncnt. Form the SUSv4
> <sys/sem.h> spec:
>
> semncnt: number of processes waiting for semval to become
>          greater than current value.
> semzcnt: Number of processes waiting for semval to become 0.
Good idea, I have updated the comments.

>> The Linux implementation always tried to be clever and to increase the counters
>> for all operations that might be the reason why a task sleeps.
>>
>> The following patches fix that and make the code conform to the
>> documentation.
>>
>> The series got fairly long, because I also noticed that semzcnt was calculated
>> incorrectly.
>>
>> What do you think?
>> I ran a few test cases, and the semncnt and semzcnt counts now match
>> the expectation.
> Are any of those test cases in a form that could be used by other to
> replicate your results? Also, are there any of those tests that could
> go into the source tree?
Unfortunately I have more or less given up writing specific tests, 
instead I use a generic "change" application that allows to create 
multi-semop operations.

# ./createary 5 3
# ./change 5 0 -1 1 -1 2 -1&
# ./getall 5 -v

I wrote a simple test for semncnt, too:
# ./ncnt

https://github.com/manfred-colorfu/ipcsemtest


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