[PATCH v2 0/2] fix MAP_DROPPABLE not supported errno

Anthony Yznaga posted 2 patches 2 months, 1 week ago
There is a newer version of this series
mm/mmap.c                                 |  2 +-
tools/testing/selftests/mm/mlock2-tests.c | 87 ++++++++++++++++++++---
2 files changed, 79 insertions(+), 10 deletions(-)
[PATCH v2 0/2] fix MAP_DROPPABLE not supported errno
Posted by Anthony Yznaga 2 months, 1 week ago
Mark Brown reported seeing a regression in -next on 32 bit arm with the
mlock selftests. Before exiting and marking the tests failed, the following
message was logged after an attempt to create a MAP_DROPPABLE mapping:

Bail out! mmap error: Unknown error 524

It turns out error 524 is ENOTSUPP which is an error that userspace is not
supposed to see, but it indicates in this instance that MAP_DROPPABLE is
not supported.

The first patch changes the errno returned to EOPNOTSUPP. The second patch
is a second version of a prior patch to introduce selftests to verify
locking behavior with droppable mappings with the additonal change to skip
the tests when MAP_DROPPABLE is not supported.

v2:
- Remove unnecessary mlock() call from selftest (DavidH)
- Change tests to not exit on failure (DavidH)

Anthony Yznaga (2):
  mm: fix mmap errno value when MAP_DROPPABLE is not supported
  selftests/mm: verify droppable mappings cannot be locked

 mm/mmap.c                                 |  2 +-
 tools/testing/selftests/mm/mlock2-tests.c | 87 ++++++++++++++++++++---
 2 files changed, 79 insertions(+), 10 deletions(-)

-- 
2.47.3
Re: [PATCH v2 0/2] fix MAP_DROPPABLE not supported errno
Posted by Andrew Morton 2 months, 1 week ago
On Thu,  2 Apr 2026 16:59:31 -0700 Anthony Yznaga <anthony.yznaga@oracle.com> wrote:

> Mark Brown reported seeing a regression in -next on 32 bit arm with the
> mlock selftests. Before exiting and marking the tests failed, the following
> message was logged after an attempt to create a MAP_DROPPABLE mapping:
> 
> Bail out! mmap error: Unknown error 524
> 
> It turns out error 524 is ENOTSUPP which is an error that userspace is not
> supposed to see, but it indicates in this instance that MAP_DROPPABLE is
> not supported.
> 
> The first patch changes the errno returned to EOPNOTSUPP. The second patch
> is a second version of a prior patch to introduce selftests to verify
> locking behavior with droppable mappings with the additonal change to skip
> the tests when MAP_DROPPABLE is not supported.

Thanks, I updated mm.git's mm-unstable branch to this version.

In [1/2] I added Mark's Reported.by:.  We had David's Acked-by: on v1's
[1/2] patch so I reinstated that.