selinux: use isdigit() in selinux_genfs_get_sid()
PATCH 1/1 selinux: use isdigit() in selinux_genfs_get_sid()
Use isdigit() to replace the open-coded implementation.
--- security/selinux/hooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
security/selinux/hooks.c +2 -1
@@ -31,6 +31,7 @@#include <linux/lsm_hooks.h> #include <linux/xattr.h> #include <linux/capability.h> +#include <linux/ctype.h> #include <linux/unistd.h> #include <linux/mm.h> #include <linux/mman.h>
@@ -1357,7 +1358,7 @@ static int selinux_genfs_get_sid(struct dentry *dentry,/* each process gets a /proc/PID/ entry. Strip off the * PID part to get a valid selinux labeling. * e.g. /proc/1/net/rpc/nfs -> /net/rpc/nfs */ -while (path[1 ] >='0' && path[1 ] <='9' ) { +while (isdigit (path[1 ])) { path[1 ] ='/' ; path++; }
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 3 lines
Use
isdigit()to replace the open-coded implementation.Signed-off-by Thorsten Blum <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 4 lines · Thorsten Blum
Use
isdigit()to replace the open-coded implementation.Signed-off-by Thorsten Blum <[email protected]>
I seem to recall seeing this same patch possibly from someone else but regardless:
Paul Moore
maintainerQuoted 9 lines · Stephen Smalley
Quoted 4 lines · Thorsten Blum
Use
isdigit()to replace the open-coded implementation.Signed-off-by Thorsten Blum <[email protected]>I seem to recall seeing this same patch possibly from someone else but regardless:
Acked-by Stephen Smalley <[email protected]>
https://lore.kernel.org/selinux/[email protected]/
Signature · 1 line
paul-moore.com
Quoted 8 lines · On Oct 14, 2026 Thorsten Blum <[email protected]> wrote:
Use
isdigit()to replace the open-coded implementation.Signed-off-by Thorsten Blum <[email protected]>Acked-by Stephen Smalley <[email protected]>--- security/selinux/hooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
As mentioned earlier, this is a partial dup of a patch that is currently in the queue to be reviewed, however, that patch combines this change with another unrelated change, so merging this ahead of the other patch might be beneficial.
Merged into selinux/dev, thanks.
--
paul-moore.com