summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-05-17 16:03:27 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-05-23 17:55:56 -0700
commit90b7cde699641124139d6b7424a3fa9ce78a9940 (patch)
tree9bd562b404fc45fcd800bfdf6e258e6524400218
parentb5992408b90bbfab9544db5cf76646b5772ecf06 (diff)
xfs: free xfs_attrd_log_items correctlyattr-intent-uaf-fixes-5.19_2022-05-23
Technically speaking, objects allocated out of a specific slab cache are supposed to be freed to that slab cache. The popular slab backends will take care of this for us, but SLOB famously doesn't. Fix this, even if slob + xfs are not that common of a combination. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
-rw-r--r--fs/xfs/xfs_attr_item.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
index 4976b1ddc09f..4f1ee8b91a17 100644
--- a/fs/xfs/xfs_attr_item.c
+++ b/fs/xfs/xfs_attr_item.c
@@ -233,7 +233,7 @@ STATIC void
xfs_attrd_item_free(struct xfs_attrd_log_item *attrdp)
{
kmem_free(attrdp->attrd_item.li_lv_shadow);
- kmem_free(attrdp);
+ kmem_cache_free(xfs_attrd_cache, attrdp);
}
STATIC void