[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250612171437-450fb7d6-c73a-47e3-9e1c-5c009cba7fe1@linutronix.de>
Date: Thu, 12 Jun 2025 17:23:01 +0200
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Nicolin Chen <nicolinc@...dia.com>, Shuah Khan <shuah@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>, Willy Tarreau <w@....eu>,
Thomas Weißschuh <linux@...ssschuh.net>, Kees Cook <kees@...nel.org>,
Andy Lutomirski <luto@...capital.net>, Will Drewry <wad@...omium.org>, Mark Brown <broonie@...nel.org>,
Muhammad Usama Anjum <usama.anjum@...labora.com>, linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional
into test metadata
On Thu, Jun 12, 2025 at 11:58:01AM -0300, Jason Gunthorpe wrote:
> On Thu, Jun 12, 2025 at 04:27:41PM +0200, Thomas Weißschuh wrote:
>
> > If the assumption is that this is most likely a kernel bug,
> > shouldn't it be fixed properly rather than worked around?
> > After all the job of a selftest is to detect bugs to be fixed.
>
> I investigated the history for a bit and it seems likely we cannot
> change the kernel here. Call it an undocumented "feature".
I looked a bit and it seems to be mentioned in mmap(2):
For mmap(), offset must be a multiple of the underlying huge page size.
The system automatically aligns length to be a multiple of the underlying huge page size.
And MAP_FIXED is documented to wipe away whichever mapping was there before.
> MAP_HUGETLBFS rounds up the length to some value, userspace has to
> figure that out and not pass incorrect lengths. The selftest is doing
> that wrong.
The selftest would be more robust if MAP_FIXED is replaced by
MAP_FIXED_NOREPLACE. Even with the new explicit skip logic it should
make debugging easier if something goes wrong.
> > If the test is broken on ARM64 64k in general then I am also wondering how
> > it didn't fail before my change to the selftest harness.
>
> It got lucky and didn't overmap something important.
Oh, okay.
Powered by blists - more mailing lists