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: <1401043188.22191.16.camel@joe-AO725>
Date:	Sun, 25 May 2014 11:39:48 -0700
From:	Joe Perches <joe@...ches.com>
To:	Manfred Spraul <manfred@...orfullife.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Davidlohr Bueso <davidlohr.bueso@...com>,
	Michael Kerrisk <mtk.manpages@...il.com>, 1vier1@....de
Subject: Re: [PATCH 7/6] ipc/sem.c: add a printk_once for
 semctl(GETNCNT/GETZCNT)

On Sun, 2014-05-25 at 20:21 +0200, Manfred Spraul wrote:
> The actual Linux implementation for semctl(GETNCNT) and semctl(GETZCNT)
> always (since 0.99.10) reported a thread as sleeping on all semaphores
> that are listed in the semop() call.
> The documented behavior (both in the Linux man page and in the Single Unix
> Specification) is that a task should be reported on exactly one semaphore:
> The semaphore that caused the thread to got to sleep.
> 
> This patch adds a printk_once() that is triggered if a thread hits
> the relevant case.
[]
> diff --git a/ipc/sem.c b/ipc/sem.c
[]
> @@ -1000,6 +1000,18 @@ static int check_qop(struct sem_array *sma, int semnum, struct sem_queue *q,
>  {
>  	struct sembuf *sop = q->blocking;
>  
> +	/*
> +	 * Linux always (since 0.99.10) reported a task as sleeping on all
> +	 * semaphores. This violates SUS, therefore it was changed to the
> +	 * standard compliant behavior.
> +	 * Give the administrators a chance to notice that an application
> +	 * might misbehave because it relies on the Linux behavior.
> +	 */
> +	printk_once(KERN_INFO "semctl(GETNCNT/GETZCNT) is since 3.16 Single " \
> +				"Unix Specification compliant.\n" \
> +				"The task %d triggered the difference, " \
> +				"watch for misbehavior.", current->pid);

Unnecessary line continuations.
Missing terminating newline after "misbehavior"
Ideally coalesced or broken at linebreaks like:

	pr_info_once("semctl(GETNCNT/GETZCNT) is Single Unix Specification compliant since kernel v3.16\n"
		     "Task %d triggered the difference, watch for misbehavior\n",
		     current->pid);

>  	if (sop->sem_num != semnum)
>  		return 0;
>  

Should the printk_once (which could be pr_info_once or _ratelimited
or maybe even emitted at KERN_DEBUG) be done only when
the return is 1?


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