mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
Fix a potential use-after-free in zfs_setsecattr()
In general, VOPs must not load the "z_log" field until having called zfs_enter_verify_zp(). Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Mark Johnston <markj@FreeBSD.org> Closes #15752
This commit is contained in:
parent
22e4f08c30
commit
8b1c6db3d2
@ -801,11 +801,11 @@ zfs_setsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr)
|
||||
zfsvfs_t *zfsvfs = ZTOZSB(zp);
|
||||
int error;
|
||||
boolean_t skipaclchk = (flag & ATTR_NOACLCHECK) ? B_TRUE : B_FALSE;
|
||||
zilog_t *zilog = zfsvfs->z_log;
|
||||
zilog_t *zilog;
|
||||
|
||||
if ((error = zfs_enter_verify_zp(zfsvfs, zp, FTAG)) != 0)
|
||||
return (error);
|
||||
|
||||
zilog = zfsvfs->z_log;
|
||||
error = zfs_setacl(zp, vsecp, skipaclchk, cr);
|
||||
|
||||
if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
|
||||
|
Loading…
Reference in New Issue
Block a user