summaryrefslogtreecommitdiff
path: root/security/apparmor
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 16:37:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:09:51 -0800
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /security/apparmor
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff)
downloadlinux-next-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.gz
linux-next-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.zip
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/' to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument. Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically. For the same reason the 'flex' versions will be done as a separate conversion. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/apparmor')
-rw-r--r--security/apparmor/apparmorfs.c2
-rw-r--r--security/apparmor/lsm.c2
-rw-r--r--security/apparmor/match.c2
-rw-r--r--security/apparmor/policy_compat.c6
-rw-r--r--security/apparmor/policy_ns.c2
-rw-r--r--security/apparmor/policy_unpack.c14
6 files changed, 14 insertions, 14 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 283e622a7ccc..2f84bd23edb6 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -570,7 +570,7 @@ static ssize_t ns_revision_read(struct file *file, char __user *buf,
static int ns_revision_open(struct inode *inode, struct file *file)
{
- struct aa_revision *rev = kzalloc_obj(*rev, GFP_KERNEL);
+ struct aa_revision *rev = kzalloc_obj(*rev);
if (!rev)
return -ENOMEM;
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 92ea1bc7b9e0..c1d42fc72fdb 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -2468,7 +2468,7 @@ static int __init aa_setup_dfa_engine(void)
goto fail;
}
nullpdb->dfa = aa_get_dfa(nulldfa);
- nullpdb->perms = kzalloc_objs(struct aa_perms, 2, GFP_KERNEL);
+ nullpdb->perms = kzalloc_objs(struct aa_perms, 2);
if (!nullpdb->perms)
goto fail;
nullpdb->size = 2;
diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index 5ee25d4016e0..8fa0a1494acd 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -301,7 +301,7 @@ struct aa_dfa *aa_dfa_unpack(void *blob, size_t size, int flags)
int error = -ENOMEM;
char *data = blob;
struct table_header *table = NULL;
- struct aa_dfa *dfa = kzalloc_obj(struct aa_dfa, GFP_KERNEL);
+ struct aa_dfa *dfa = kzalloc_obj(struct aa_dfa);
if (!dfa)
goto fail;
diff --git a/security/apparmor/policy_compat.c b/security/apparmor/policy_compat.c
index 928dbb10cec1..5fc16d56fbf4 100644
--- a/security/apparmor/policy_compat.c
+++ b/security/apparmor/policy_compat.c
@@ -158,7 +158,7 @@ static struct aa_perms *compute_fperms(struct aa_dfa *dfa,
state_count = dfa->tables[YYTD_ID_BASE]->td_lolen;
/* DFAs are restricted from having a state_count of less than 2 */
- table = kvzalloc_objs(struct aa_perms, state_count * 2, GFP_KERNEL);
+ table = kvzalloc_objs(struct aa_perms, state_count * 2);
if (!table)
return NULL;
*size = state_count * 2;
@@ -182,7 +182,7 @@ static struct aa_perms *compute_xmatch_perms(struct aa_dfa *xmatch,
state_count = xmatch->tables[YYTD_ID_BASE]->td_lolen;
/* DFAs are restricted from having a state_count of less than 2 */
- perms = kvzalloc_objs(struct aa_perms, state_count, GFP_KERNEL);
+ perms = kvzalloc_objs(struct aa_perms, state_count);
if (!perms)
return NULL;
*size = state_count;
@@ -257,7 +257,7 @@ static struct aa_perms *compute_perms(struct aa_dfa *dfa, u32 version,
state_count = dfa->tables[YYTD_ID_BASE]->td_lolen;
/* DFAs are restricted from having a state_count of less than 2 */
- table = kvzalloc_objs(struct aa_perms, state_count, GFP_KERNEL);
+ table = kvzalloc_objs(struct aa_perms, state_count);
if (!table)
return NULL;
*size = state_count;
diff --git a/security/apparmor/policy_ns.c b/security/apparmor/policy_ns.c
index 099b71957ccb..01b653a3609b 100644
--- a/security/apparmor/policy_ns.c
+++ b/security/apparmor/policy_ns.c
@@ -106,7 +106,7 @@ static struct aa_ns *alloc_ns(const char *prefix, const char *name)
{
struct aa_ns *ns;
- ns = kzalloc_obj(*ns, GFP_KERNEL);
+ ns = kzalloc_obj(*ns);
AA_DEBUG(DEBUG_POLICY, "%s(%p)\n", __func__, ns);
if (!ns)
return NULL;
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 9001c6ebc235..2b7ccc4e3853 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -145,7 +145,7 @@ struct aa_loaddata *aa_loaddata_alloc(size_t size)
{
struct aa_loaddata *d;
- d = kzalloc_obj(*d, GFP_KERNEL);
+ d = kzalloc_obj(*d);
if (d == NULL)
return ERR_PTR(-ENOMEM);
d->data = kvzalloc(size, GFP_KERNEL);
@@ -528,7 +528,7 @@ static int unpack_strs_table(struct aa_ext *e, const char *name, bool multi,
* for size check here
*/
goto fail;
- table = kzalloc_objs(struct aa_str_table_ent, size, GFP_KERNEL);
+ table = kzalloc_objs(struct aa_str_table_ent, size);
if (!table) {
error = -ENOMEM;
goto fail;
@@ -809,7 +809,7 @@ static int unpack_tag_headers(struct aa_ext *e, struct aa_tags_struct *tags)
if (!aa_unpack_array(e, "hdrs", &size))
goto fail_reset;
- hdrs = kzalloc_objs(struct aa_tags_header, size, GFP_KERNEL);
+ hdrs = kzalloc_objs(struct aa_tags_header, size);
if (!hdrs) {
error = -ENOMEM;
goto fail_reset;
@@ -922,7 +922,7 @@ static ssize_t unpack_perms_table(struct aa_ext *e, struct aa_perms **perms)
goto fail_reset;
if (!aa_unpack_array(e, NULL, &size))
goto fail_reset;
- *perms = kzalloc_objs(struct aa_perms, size, GFP_KERNEL);
+ *perms = kzalloc_objs(struct aa_perms, size);
if (!*perms) {
e->pos = pos;
return -ENOMEM;
@@ -1320,7 +1320,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
error = -EPROTO;
if (aa_unpack_nameX(e, AA_STRUCT, "data")) {
info = "out of memory";
- profile->data = kzalloc_obj(*profile->data, GFP_KERNEL);
+ profile->data = kzalloc_obj(*profile->data);
if (!profile->data) {
error = -ENOMEM;
goto fail;
@@ -1338,7 +1338,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
}
while (aa_unpack_strdup(e, &key, NULL)) {
- data = kzalloc_obj(*data, GFP_KERNEL);
+ data = kzalloc_obj(*data);
if (!data) {
kfree_sensitive(key);
error = -ENOMEM;
@@ -1583,7 +1583,7 @@ void aa_load_ent_free(struct aa_load_ent *ent)
struct aa_load_ent *aa_load_ent_alloc(void)
{
- struct aa_load_ent *ent = kzalloc_obj(*ent, GFP_KERNEL);
+ struct aa_load_ent *ent = kzalloc_obj(*ent);
if (ent)
INIT_LIST_HEAD(&ent->list);
return ent;