mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-04 19:11:27 +02:00
26 lines
679 B
Diff
26 lines
679 B
Diff
From: John Johansen <jrjohansen@verizon.net>
|
|
Subject: [PATCH] AppArmor: Fix leak of filename for deleted files
|
|
|
|
This patch fixes a memory leak where the name doesn't get freed when
|
|
a file has been deleted.
|
|
|
|
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
|
|
---
|
|
security/apparmor/main.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
--- a/security/apparmor/main.c
|
|
+++ b/security/apparmor/main.c
|
|
@@ -500,10 +500,10 @@ static char *aa_get_name(struct dentry *
|
|
*buffer = buf;
|
|
return name;
|
|
}
|
|
+ kfree(buf);
|
|
if (PTR_ERR(name) != -ENAMETOOLONG)
|
|
return name;
|
|
|
|
- kfree(buf);
|
|
size <<= 1;
|
|
if (size > apparmor_path_max)
|
|
return ERR_PTR(-ENAMETOOLONG);
|