mirror of
				https://git.proxmox.com/git/mirror_zfs
				synced 2025-10-31 07:39:20 +00: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
							
								
									d8b2686603
								
							
						
					
					
						commit
						1a11ad9d20
					
				| @ -795,11 +795,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
	 Mark Johnston
						Mark Johnston