HomeFreeBSD

tmpfs: Fix OOB write when setting vfs.tmpfs.memory_percent

Description

tmpfs: Fix OOB write when setting vfs.tmpfs.memory_percent

tmpfs_mem_percent is an int not a long, so on a 64-bit system this
writes 4 bytes past the end of the variable. The read above is correct,
so this was likely a copy paste error from sysctl_mem_reserved.

Found by: CHERI
Fixes: 636592343c3e ("tmpfs: increase memory reserve to a percent of available memory + swap")

Details

Provenance
jrtc27Authored on Aug 15 2024, 7:33 PM
Parents
rGef9fc9609a1f: sys: Mark ACL conversion routines as __result_use_check
Branches
Unknown
Tags
Unknown