[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whTO-VwB2ARhL9jg1k63L26YR0sfnpOKaGsEi=Va5zVtQ@mail.gmail.com>
Date: Sat, 4 Mar 2023 15:52:39 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Yury Norov <yury.norov@...il.com>
Cc: Mateusz Guzik <mjguzik@...il.com>,
Alexander Potapenko <glider@...gle.com>,
Al Viro <viro@...iv.linux.org.uk>,
Kees Cook <keescook@...omium.org>,
Eric Biggers <ebiggers@...gle.com>,
Christian Brauner <brauner@...nel.org>, serge@...lyn.com,
paul@...l-moore.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org
Subject: Re: [PATCH v3 2/2] vfs: avoid duplicating creds in faccessat if possible
On Sat, Mar 4, 2023 at 3:08 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> Well, this particular patch at least boots for me for my normal
> config. Not that I've run any extensive tests, but I'm writing this
> email while running this patch, so ..
Hmm. I enabled the KUNIT tests, and used an odd CONFIG_NR_CPUS to test
this a bit more.
So in my situation, I have 64 threads, and so nr_cpu_ids is 64, and
CONFIG_NR_CPUS is 150.
Then one cpumask KUNIT test fails with
# test_cpumask_weight: EXPECTATION FAILED at lib/cpumask_kunit.c:70
Expected ((unsigned int)150) == cpumask_weight(&mask_all), but
((unsigned int)150) == 150 (0x96)
cpumask_weight(&mask_all) == 64 (0x40)
&mask_all contains CPUs 0-63
but I think that's actually a KUNIT test bug.
The KUNIT test there is
KUNIT_EXPECT_EQ_MSG(test, nr_cpumask_bits,
cpumask_weight(&mask_all), MASK_MSG(&mask_all));
and it should *not* expect the cpumask weight to be nr_cpumask_bits,
it should expect it to be nr_cpu_ids.
That only matters now that nr_cpumask_bits isn't the same as nr_cpu_ids./
Anyway, I still think that patch of mine is fine, and I think this
test failure only ends up being about the test, not the patch.
Linus
Powered by blists - more mailing lists