From: Martin Wirth <Martin.Wirth@dlr.de>
To: Rusty Russell <rusty@rustcorp.com.au>, linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>
Subject: Re: [patch] futex-2.5.42-A2
Date: Wed, 16 Oct 2002 09:58:52 +0200 [thread overview]
Message-ID: <3DAD1C3C.3080001@dlr.de> (raw)
(My first reply seems to have been lost, so lets try a second time)
>Um, this test existed for a reason:
>
>> - /* Must be "naturally" aligned, and not on page boundary. */
>> - if ((pos_in_page % __alignof__(int)) != 0
>> - || pos_in_page + sizeof(int) > PAGE_SIZE)
>> + /* Must be "naturally" aligned */
>> + if (pos_in_page % sizeof(int))
>> return -EINVAL;
>
>If you do this, *please* add:
> /* Above check not sufficient if align of int < size. Break link. */
> if (__alignof__(int) < sizeof(int)) {
>
extern void __error_small_int_align();
>
__error_small_int_align();
> }
I suggested to tighten the above test, because if
__alignof__(int) < sizeof(int) the test leads to sporadic user space
errors if the futex variable accidentally crosses a page boundary. The
only sane way to control this is to force the user space compiler
to use __alignof__(int) == sizeof(int) for futex variables.
Anyway, the test dates back to times when the futex code did atomic
operations on the user space variable. But this is gone. The present
code only touches users space by get_user which does its on checks.
So from the point of keeping the kernel in a sane state we could drop the test
completely.
Martin
next reply other threads:[~2002-10-16 7:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-16 7:58 Martin Wirth [this message]
2002-10-16 8:23 ` [patch] futex-2.5.42-A2 Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2002-10-16 14:32 Oleg Nesterov
2002-10-15 20:17 Ingo Molnar
2002-10-16 2:26 ` Rusty Russell
2002-10-16 8:17 ` Ingo Molnar
2002-10-18 8:39 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DAD1C3C.3080001@dlr.de \
--to=martin.wirth@dlr.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.