diff mbox series

[50/66] bsd-user: __acl_aclcheck_file should check t2h_freebsd_acl_type

Message ID 20260515-misc-2026q2-v1-50-5438ca41b27a@bsdimp.com
State New
Headers show
Series bsd-user: Upstream most of the remaining system calls | expand

Commit Message

Warner Losh May 15, 2026, 9:19 p.m. UTC
Check the return type of t2h_freebsd_acl_type so we don't use garbage.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 bsd-user/freebsd/os-extattr.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/bsd-user/freebsd/os-extattr.h b/bsd-user/freebsd/os-extattr.h
index 0414a2e479..97c0f76559 100644
--- a/bsd-user/freebsd/os-extattr.h
+++ b/bsd-user/freebsd/os-extattr.h
@@ -407,6 +407,9 @@  static inline abi_long do_freebsd__acl_aclcheck_file(abi_ulong arg1,
     acl_type_t type;
 
     ret = t2h_freebsd_acl_type(&type, arg2);
+    if (is_error(ret)) {
+        return ret;
+    }
     p = lock_user_string(arg1);
     if (p == NULL) {
         return -TARGET_EFAULT;