lsm: Fix signedness bug in selinux_secid_to_secctx()
Subsystems (2)
PATCH 1/1 lsm: Fix signedness bug in selinux_secid_to_secctx()
The "ret" variable needs to be signed for the error checking to work.
Fixes 95a3c11eb670 ("lsm: replace context+len with lsm_context")
Signed-off-by Dan Carpenter <[email protected]>
--- security/selinux/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/hooks.c +1 -1
@@ -6644,7 +6644,7 @@ static int selinux_ismaclabel(const char *name)static int selinux_secid_to_secctx (u32 secid,struct lsm_context *cp) {u32 seclen; -u32 ret; +int ret;if (cp) { cp->id =LSM_ID_SELINUX ;
Signature · 1 line
2.45.2
Quoted 1 line · Dan Carpenter
The "ret" variable needs to be signed for the error checking to work.
Doh.
Thank you.
Acked-by Casey Schaufler <[email protected]>
Quoted 20 lines
Fixes 95a3c11eb670 ("lsm: replace context+len with lsm_context")Signed-off-by Dan Carpenter <[email protected]>--- security/selinux/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)security/selinux/hooks.c +1
-1@@ -6644,7 +6644,7 @@ static int selinux_ismaclabel(const char *name)static int selinux_secid_to_secctx (u32 secid,struct lsm_context *cp) {u32 seclen; -u32 ret; +int ret;if (cp) { cp->id =LSM_ID_SELINUX ;
Quoted 8 lines · Dan Carpenter
The "ret" variable needs to be signed for the error checking to work.
Fixes 95a3c11eb670 ("lsm: replace context+len with lsm_context")Signed-off-by Dan Carpenter <[email protected]>--- security/selinux/hooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Merged into lsm/dev-staging, thanks Dan.
Signature · 1 line
paul-moore.com