From: Mike Rapoport (Microsoft) Date: Wed, 20 May 2026 08:18:56 +0000 (+0300) Subject: selinux: hooks: use __getname() to allocate path buffer X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54067bacb49caeada82b20b6bd706dca0cb99ffc;p=thirdparty%2Fkernel%2Flinux.git selinux: hooks: use __getname() to allocate path buffer selinux_genfs_get_sid() allocates memory for a path with __get_free_page() although there is a dedicated helper for allocation of file paths: __getname(). Replace __get_free_page() for allocation of a path buffer with __getname(). Signed-off-by: Mike Rapoport (Microsoft) Signed-off-by: Paul Moore --- diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 97801966bf32c..95d0fb20d84ec 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1336,7 +1336,7 @@ static int selinux_genfs_get_sid(struct dentry *dentry, struct super_block *sb = dentry->d_sb; char *buffer, *path; - buffer = (char *)__get_free_page(GFP_KERNEL); + buffer = __getname(); if (!buffer) return -ENOMEM; @@ -1361,7 +1361,7 @@ static int selinux_genfs_get_sid(struct dentry *dentry, rc = 0; } } - free_page((unsigned long)buffer); + __putname(buffer); return rc; }