[Midnightbsd-cvs] [MidnightBSD/src] a40f96: unlinkat: Respect AT_RESOLVE_BENEATH in unlinkat(2...

Lucas Holt noreply at github.com
Tue Jun 30 22:44:45 EDT 2026


  Branch: refs/heads/stable/4.0
  Home:   https://github.com/MidnightBSD/src
  Commit: a40f968ff4f15b295577a58caa1cdebce6f556d0
      https://github.com/MidnightBSD/src/commit/a40f968ff4f15b295577a58caa1cdebce6f556d0
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-06-30 (Tue, 30 Jun 2026)

  Changed paths:
    M sys/kern/vfs_syscalls.c

  Log Message:
  -----------
  unlinkat: Respect AT_RESOLVE_BENEATH in unlinkat(2)/funlinkat(2)

kern_funlinkat_ex() validated the AT_RESOLVE_BENEATH flag but then called
kern_frmdirat()/kern_funlinkat() with a hardcoded flag argument of 0,
silently dropping the flag so that path resolution was not actually
restricted.  It also hardcoded UIO_USERSPACE instead of passing through
its pathseg parameter.

Pass the flags (minus AT_REMOVEDIR) and pathseg through to the underlying
lookup, which already honors AT_RESOLVE_BENEATH via at2cnpflags().

A caller relying on AT_RESOLVE_BENEATH with unlinkat(2)/funlinkat(2) for
path containment could delete files outside the intended directory tree.

Ported from the FreeBSD fix for SA-26:42.unlinkat (FreeBSD commit
7982ae91a51a), by Mark Johnston.

Security:	FreeBSD-SA-26:42.unlinkat
Security:	CVE-2026-49421
Obtained from:	FreeBSD

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply at anthropic.com>


  Commit: 340c2068b1bb2938205c9b7c5acdc81080d0e6fc
      https://github.com/MidnightBSD/src/commit/340c2068b1bb2938205c9b7c5acdc81080d0e6fc
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-06-30 (Tue, 30 Jun 2026)

  Changed paths:
    M UPDATING

  Log Message:
  -----------
  UPDATING: Note SA-26:42.unlinkat fix

Security:	FreeBSD-SA-26:42.unlinkat
Security:	CVE-2026-49421

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply at anthropic.com>


Compare: https://github.com/MidnightBSD/src/compare/512d7383ea0e...340c2068b1bb

To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/src/settings/notifications


More information about the Midnightbsd-cvs mailing list