linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Eric Biggers <ebiggers@kernel.org>, x86 <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [tip: sched/urgent] sched: Fix RANDSTRUCT build fail
Date: Mon, 22 Jun 2020 07:36:58 -0700	[thread overview]
Message-ID: <86b83934-6498-28b0-8756-33254b900bc3@roeck-us.net> (raw)
In-Reply-To: <CAHk-=wgj17RR3zetey4fpbOxbC58A=jMt87bQ9QRe4QDnxE46w@mail.gmail.com>

On 6/20/20 9:32 AM, Linus Torvalds wrote:
> On Fri, Jun 19, 2020 at 8:14 PM Kees Cook <keescook@chromium.org> wrote:
>>
>> On Wed, Jun 10, 2020 at 10:34:16AM -0000, tip-bot2 for Peter Zijlstra wrote:
>>> The following commit has been merged into the sched/urgent branch of tip:
>>>
>>> Commit-ID:     bfb9fbe0f7e70ec5c8e51ee55b6968d4dff14456
>>> Gitweb:        https://git.kernel.org/tip/bfb9fbe0f7e70ec5c8e51ee55b6968d4dff14456
>>> Author:        Peter Zijlstra <peterz@infradead.org>
>>> AuthorDate:    Wed, 10 Jun 2020 12:14:09 +02:00
>>> Committer:     Peter Zijlstra <peterz@infradead.org>
>>> CommitterDate: Wed, 10 Jun 2020 12:30:19 +02:00
>>>
>>> sched: Fix RANDSTRUCT build fail
>>>
>>> As a temporary build fix, the proper cleanup needs more work.
>>>
>>> Reported-by: Guenter Roeck <linux@roeck-us.net>
>>> Reported-by: Eric Biggers <ebiggers@kernel.org>
>>> Suggested-by: Eric Biggers <ebiggers@kernel.org>
>>> Suggested-by: Kees Cook <keescook@chromium.org>
>>> Fixes: a148866489fb ("sched: Replace rq::wake_list")
>>> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>>
>> Hi, can this please get sent to Linus before -rc2? With a148866489fb in
>> -rc1, all the CI with the GCC plugins installed have been failing their
>> all*config builds. This entered -next 9 days ago (and fixed the -next
>> builds), but Linus's tree is still failing:
> 
> Ugh.
> 
> I actually think the problem goes deeper than that.
> 
> The code expects the list entries to be of type 'call_single_data_t'
> 
> Then they damn well should be that type.
> 
> Note how "call_single_data_t" also implies certain alignment rules
> that the hack in 'struct task_struct' does *not* have, and while that
> doesn't matter on x86, it could matter on other architectures.
> 

Yes, that came up before. At least, with this patch, I don't see any compile
or boot test failures. This patch wasn't supposed to be a clean solution
(Peter is working on that) but a quick fix that can be applied easily
and at least improves the situation.

As it is, the mainline kernel currently relies on having RANDSTRUCT
disabled, and still has all the other problems you mentioned here,
so it is definitely much worse.

On the other side, a148866489fb has been in the tree for more
than three weeks now. Maybe we can wait more time for a more
comprehensive solution which hopefully doesn't introduce other
problems.

Guenter

> So no, I don't think Peter's patch is correct. It may make the build
> pass, but that "check the offsets between two fields" is not
> sufficient.
> 
> Now, if we could create a new
> 
>    struct __call_single_list_entry {
>         struct llist_node llist;
>         unsigned int flags;
>    } call_single_list_entry_t;
> 
> and use that as part of thecall_single_data_t and only use that for
> tyhe traversal of the list, then that would avoid the alignment issue
> and the waste of space in struct task_struct.
> 
> Hmm?
> 
> Peter/Ingo?
> 
>                  Linus
> 


      parent reply	other threads:[~2020-06-22 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 10:34 [tip: sched/urgent] sched: Fix RANDSTRUCT build fail tip-bot2 for Peter Zijlstra
2020-06-20  3:13 ` Kees Cook
2020-06-20 16:32   ` Linus Torvalds
2020-06-22  8:10     ` Peter Zijlstra
2020-06-22  8:16       ` Peter Zijlstra
2020-06-22  8:18       ` Peter Zijlstra
2020-06-22 14:36     ` Guenter Roeck [this message]

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=86b83934-6498-28b0-8756-33254b900bc3@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=ebiggers@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).