From: Andrew Morton <akpm@linux-foundation.org>
To: Qingshuang Fu <fuqingshuang@kylinos.cn>
Cc: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
Shuah Khan <shuah@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
"Liam R . Howlett" <liam@infradead.org>,
Karl Mehltretter <kmehltretter@gmail.com>,
Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>,
linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/proc: include linux/mman.h for MREMAP_DONTUNMAP
Date: Thu, 19 Nov 2026 19:24:06 -0800 [thread overview]
Message-ID: <20261119192406.beb3f4ccc1451f87450f858a@linux-foundation.org> (raw)
In-Reply-To: <20261120022710.1585112-1-fuqingshuang@kylinos.cn>
On Fri, 20 Nov 2026 10:27:10 +0800 Qingshuang Fu <fuqingshuang@kylinos.cn> wrote:
> glibc versions before 2.32 do not define MREMAP_DONTUNMAP in
> <sys/mman.h>, so proc-maps-race fails to build against them (e.g.
> glibc 2.31):
>
> $ make -C tools/testing/selftests TARGETS=proc
> ...
> proc-maps-race.c:691:58: error: 'MREMAP_DONTUNMAP' undeclared
> (first use in this function)
>
> Include <linux/mman.h> to get the flag from the kernel UAPI headers
> instead of depending on the libc version. The proc Makefile already
> adds those headers to the include path via $(TOOLS_INCLUDES).
Boy, anyone who is running 6 year old glibc has bigger problems than
this. 2.31 is full of scary-looking CVEs.
> --- a/tools/testing/selftests/proc/proc-maps-race.c
> +++ b/tools/testing/selftests/proc/proc-maps-race.c
> @@ -33,6 +33,7 @@
> #include <string.h>
> #include <unistd.h>
> #include <linux/fs.h>
> +#include <linux/mman.h>
> #include <sys/ioctl.h>
> #include <sys/mman.h>
> #include <sys/stat.h>
but OK, patch looks harmless enough and lots of selftests/ are including
linux/mman.h.
prev parent reply other threads:[~2026-11-20 3:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 2:27 Qingshuang Fu
2026-11-20 3:24 ` Andrew Morton [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=20261119192406.beb3f4ccc1451f87450f858a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=fuqingshuang@kylinos.cn \
--cc=joe@perches.com \
--cc=kmehltretter@gmail.com \
--cc=liam@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=reddybalavignesh9979@gmail.com \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
/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
all inboxes | Powered by JetHome®