Skip to contentSkip to conversation

afs: Fix a use after free in afs_xattr_get_acl()

PATCH New Dan Carpenter 1 participant 1 message Aug 24, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 afs: Fix a use after free in afs_xattr_get_acl()

The "op" pointer is freed earlier when we call afs_put_operation().

Fixes e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept")
---
 fs/afs/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/afs/xattr.c +1 -1
index 84f3c4f57531..38884d6c57cd 100644
@@ -85,7 +85,7 @@ static int afs_xattr_get_acl(const struct xattr_handler *handler,
 			if (acl->size <= size)
 				memcpy(buffer, acl->data, acl->size);
 			else
-				op->error = -ERANGE;
+				ret = -ERANGE;
 		}
 	}
 
Signature · 1 line
2.28.0