acl_copyin: avoid returning uninitialized memory

acl_copyin did not validate the return value of acl_copy_oldacl_into_acl
which could lead to uninitialized acl structure memory reads.

Reported by:    Synacktiv
Reviewed by:	markj, emaste
Sponsored by:   The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46125

(cherry picked from commit 6ee6c7b146)
This commit is contained in:
Pierre Pronchery 2024-07-25 14:44:17 +02:00 committed by Ed Maste
parent cbbc8d6730
commit 6bf5c32ad8

View file

@ -146,7 +146,7 @@ acl_copyin(const void *user_acl, struct acl *kernel_acl, acl_type_t type)
error = copyin(user_acl, &old, sizeof(old));
if (error != 0)
break;
acl_copy_oldacl_into_acl(&old, kernel_acl);
error = acl_copy_oldacl_into_acl(&old, kernel_acl);
break;
default: