begin_new_exec() resets dumpability to owner-dumpable whenever the real
and effective ids match at exec time. A binary exec'd by a setuid
program that has already called setuid(0) therefore becomes dumpable as
root, and with a relative core_pattern plus an attacker-controlled
working directory the resulting core file can be dropped into a
privileged directory such as /etc/logrotate.d.

Full report with proof of concept:

  https://www.openwall.com/lists/oss-security/2021/10/20/2

Two fixes were proposed and neither was merged. Waiman Long's patch was
NAKed by Eric W. Biederman as an ineffective mitigation:

  https://lore.kernel.org/all/[email protected]/

Wander Lairson Costa's RFC v2 received design feedback and no v3 ever
followed:

  https://lore.kernel.org/all/[email protected]/

The flagged logic is unchanged today: fs/exec.c still selects
TASK_DUMPABLE_OWNER in that case, and fs/coredump.c only rejects
relative core paths when dumpable is 2, so the dumpable==1 case this CVE
describes is not covered.

Ubuntu records "no fix upstream as of 2022-01-27" and defers it for all
releases; Debian lists src:linux as unfixed:

  https://ubuntu.com/security/CVE-2021-3864
  https://security-tracker.debian.org/tracker/CVE-2021-3864

Red Hat rates RHEL 8 and later "Not affected" purely because their
default core_pattern does not write relative to the current directory:

  https://access.redhat.com/security/cve/CVE-2021-3864

Images that set an absolute path, a pipe or a socket core_pattern (for
example systemd-coredump) are not exploitable for the same reason.

CC: Paul Barker <[email protected]>
AI-Generated: Uses Claude (claude-opus-5)
Signed-off-by: Junjie Cao <[email protected]>
---
changes in v2:
- split out of the single combined patch, one CVE per patch as requested
- added primary source links (disclosures, distribution trackers, mailing
  list threads, upstream commits) to every commit message
- added the three CVEs with no upstream fix as "unpatched" entries instead
  of leaving them undocumented
- disclosed AI assistance per the contributor guide

v1: 
https://lore.kernel.org/openembedded-core/[email protected]/

 meta/recipes-kernel/linux/cve-exclusion.inc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/recipes-kernel/linux/cve-exclusion.inc 
b/meta/recipes-kernel/linux/cve-exclusion.inc
index 9012d328..d7ae3b03 100644
--- a/meta/recipes-kernel/linux/cve-exclusion.inc
+++ b/meta/recipes-kernel/linux/cve-exclusion.inc
@@ -206,3 +206,9 @@ host model, no kernel fix exists or is planned, mitigated 
by firewall configurat
 # https://bugzilla.redhat.com/show_bug.cgi?id=1931327
 CVE_STATUS[CVE-2021-3714] = "upstream-wontfix: inherent design limitation of \
 KSM page deduplication, closed WONTFIX by Red Hat, no upstream fix planned"
+
+# Two fix attempts, neither merged; the fs/exec.c logic is unchanged.
+# An absolute, piped or socket kernel.core_pattern prevents exploitation.
+# https://www.openwall.com/lists/oss-security/2021/10/20/2
+CVE_STATUS[CVE-2021-3864] = "upstream-wontfix: no accepted mainline fix after \
+several attempts, exploitation requires a relative kernel.core_pattern"
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#242629): 
https://lists.openembedded.org/g/openembedded-core/message/242629
Mute This Topic: https://lists.openembedded.org/mt/120574082/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to