Re: [syzbot] [keyrings?] [lsm?] [ext4?] possible deadlock in keyring_clear (2)

From: Edward Adam Davis
Date: Sun Sep 22 2024 - 07:33:36 EST


Use GFP_NOFS

#syz test

diff --git a/lib/assoc_array.c b/lib/assoc_array.c
index 388e656ac974..b6fd9e909b79 100644
--- a/lib/assoc_array.c
+++ b/lib/assoc_array.c
@@ -977,7 +977,7 @@ struct assoc_array_edit *assoc_array_insert(struct assoc_array *array,
*/
BUG_ON(assoc_array_ptr_is_meta(object));

- edit = kzalloc(sizeof(struct assoc_array_edit), GFP_KERNEL);
+ edit = kzalloc(sizeof(struct assoc_array_edit), GFP_NOFS);
if (!edit)
return ERR_PTR(-ENOMEM);
edit->array = array;