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]
Date:	Sat, 25 Sep 2010 20:33:08 +0900
From:	Namhyung Kim <namhyung@...il.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Oleg Nesterov <oleg@...hat.com>,
	Roland McGrath <roland@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] signal: annotate siglock acquisition

On Sat, Sep 25, 2010 at 18:42, Eric Dumazet <eric.dumazet@...il.com> wrote:
> Le samedi 25 septembre 2010 à 18:21 +0900, Namhyung Kim a écrit :
>> @@ -1403,7 +1404,9 @@ int send_sigqueue(struct sigqueue *q, struct task_struct *t, int group)
>>       BUG_ON(!(q->flags & SIGQUEUE_PREALLOC));
>>
>>       ret = -1;
>> -     if (!likely(lock_task_sighand(t, &flags)))
>> +     if (likely(lock_task_sighand(t, &flags)))
>> +             __acquire(&t->sighand->siglock);
>> +     else
>>               goto ret;
>>
>>       ret = 1; /* the signal is ignored */
>
> making sparse happy is good, but changing a likely clause is not,
> unless you meant it ;)
>
> maybe -->
>
>        if (!likely(lock_task_sighand(t, &flags)))
>                goto ret;
>        else
>                __acquire(&t->sighand->siglock);
>
>
>
>

What's the difference? I didn't change the semantics of likely clause
but simply exchange the order of then-else part because IMHO a
negative expression make it hard to understand, generally.
I've checked compiled binaries for both cases on x86 and they
produced exactly same code.

Thanks.


-- 
Regards,
Namhyung Kim
--
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