From: Benjamin Berg <benjamin@sipsolutions.net>
To: linux-um@lists.infradead.org
Cc: Johannes Berg <johannes.berg@intel.com>,
Benjamin Berg <benjamin.berg@intel.com>
Subject: [PATCH 0/2] Remove incorrect host mincore call and add rodata handling
Date: Mon, 10 Feb 2025 17:09:24 +0100 [thread overview]
Message-ID: <20250210160926.420133-1-benjamin@sipsolutions.net> (raw)
From: Benjamin Berg <benjamin.berg@intel.com>
Hi,
using mincore() to check whether a page is owned by UML is not correct
as it returns whether the page is resident in memory and not whether
something has been mapped at the address. This means that UML could get
spurious failures in *_nofault functions like copy_from_kernel_nofault).
If this happens, it can create hard to debug issues. For us the problem
showed up because hostfs was randomly throwing ENOENT errors when
loading libraries (including ld.so). This can be traced back to
dentry_path_raw failing as it uses an optimization that requires the
use of copy_from_kernel_nofault internally (see the documentation of
prepend_name and prepend_copy).
Pull in the existing RODATA patch from Johannes (with light editing) and
then remove the call to mincore() as it is incorrect.
Benjamin
Benjamin Berg (1):
um: remove copy_from_kernel_nofault_allowed
Johannes Berg (1):
um: mark rodata read-only and implement _nofault accesses
arch/um/Kconfig | 1 +
arch/um/include/asm/processor-generic.h | 2 +
arch/um/include/asm/uaccess.h | 20 +++++++---
arch/um/include/shared/arch.h | 2 +
arch/um/include/shared/as-layout.h | 2 +-
arch/um/include/shared/irq_user.h | 3 +-
arch/um/include/shared/kern_util.h | 12 ++++--
arch/um/include/shared/os.h | 1 -
arch/um/kernel/Makefile | 2 +-
arch/um/kernel/irq.c | 3 +-
arch/um/kernel/maccess.c | 19 ---------
arch/um/kernel/mem.c | 10 +++++
arch/um/kernel/trap.c | 28 ++++++++++---
arch/um/os-Linux/process.c | 51 ------------------------
arch/um/os-Linux/signal.c | 4 +-
arch/um/os-Linux/skas/process.c | 8 ++--
arch/x86/um/os-Linux/mcontext.c | 12 ++++++
arch/x86/um/shared/sysdep/faultinfo_32.h | 12 ++++++
arch/x86/um/shared/sysdep/faultinfo_64.h | 12 ++++++
19 files changed, 109 insertions(+), 95 deletions(-)
delete mode 100644 arch/um/kernel/maccess.c
--
2.48.1
next reply other threads:[~2025-02-10 16:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 16:09 Benjamin Berg [this message]
2025-02-10 16:09 ` [PATCH 1/2] um: mark rodata read-only and implement _nofault accesses Benjamin Berg
2025-04-02 22:12 ` Nathan Chancellor
2025-04-03 6:20 ` Benjamin Berg
2025-04-03 19:19 ` Nathan Chancellor
2025-04-03 20:47 ` Johannes Berg
2025-02-10 16:09 ` [PATCH 2/2] um: remove copy_from_kernel_nofault_allowed Benjamin Berg
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=20250210160926.420133-1-benjamin@sipsolutions.net \
--to=benjamin@sipsolutions.net \
--cc=benjamin.berg@intel.com \
--cc=johannes.berg@intel.com \
--cc=linux-um@lists.infradead.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).