HomeFreeBSD

MAC/do: Fix jail_get() (PR_METHOD_GET)

Description

MAC/do: Fix jail_get() (PR_METHOD_GET)

  • Properly fill 'jsys' before copying it out (we would leak bytes from the kernel stack). When the current jail has its own 'struct rules', set it to the special value JAIL_SYS_DISABLE if it in fact holds no rules.
  • Don't forget to unlock the jail holding rules on error.
  • Correctly return errors.

Reviewed by: bapt
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47609

Details

Provenance
olceAuthored on Jul 3 2024, 3:22 PM
Reviewer
bapt
Differential Revision
D47609: MAC/do: Fix jail_get() (PR_METHOD_GET)
Parents
rGf3a06ced2568: MAC/do: Sysctl knobs/jail parameters under MAC's common nodes
Branches
Unknown
Tags
Unknown