Skip to contentSkip to conversation

selinux: fix build warning by removing the unused sid variable

PATCH Applied Corentin Labbe 3 participants 6 messages Oct 4, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 selinux: fix build warning by removing the unused sid variable

This patch remove the unused variable sid
This fix the following build warning:
security/selinux/hooks.c:2921:6: warning: variable 'sid' set but not used [-Wunused-but-set-variable]

---
 security/selinux/hooks.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
security/selinux/hooks.c +1 -2
index f5d304736852..8507a56f85e4 100644
@@ -2918,13 +2918,12 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir,
 {
 	const struct task_security_struct *tsec = current_security();
 	struct superblock_security_struct *sbsec;
-	u32 sid, newsid, clen;
+	u32 newsid, clen;
 	int rc;
 	char *context;
 
 	sbsec = dir->i_sb->s_security;
 
-	sid = tsec->sid;
 	newsid = tsec->create_sid;
 
 	rc = selinux_determine_inode_label(current_security(),
Signature · 6 lines
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

PATCH 2/2 selinux: fix build warning

This patch make selinux_task_prlimit() static since it is not used
anywhere else.
This fix the following build warning:
security/selinux/hooks.c:3981:5: warning: no previous prototype for 'selinux_task_prlimit' [-Wmissing-prototypes]

---
 security/selinux/hooks.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
security/selinux/hooks.c +2 -2
index 8507a56f85e4..b8a022f4b4a7 100644
@@ -3977,8 +3977,8 @@ static int selinux_task_getioprio(struct task_struct *p)
 			    PROCESS__GETSCHED, NULL);
 }
 
-int selinux_task_prlimit(const struct cred *cred, const struct cred *tcred,
-			 unsigned int flags)
+static int selinux_task_prlimit(const struct cred *cred, const struct cred *tcred,
+				unsigned int flags)
 {
 	u32 av = 0;
 
Signature · 6 lines
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/2
#4 lore raw
In reply to Corentin Labbe
Quoted 6 lines · Corentin Labbe

This patch remove the unused variable sid
This fix the following build warning:
security/selinux/hooks.c:2921:6: warning: variable 'sid' set but not used [-Wunused-but-set-variable]

Quoted 22 lines

---
?security/selinux/hooks.c | 3 +--
?1 file changed, 1 insertion(+), 2 deletions(-)

security/selinux/hooks.c +0 -0
index f5d304736852..8507a56f85e4 100644
@@ -2918,13 +2918,12 @@ static int selinux_inode_init_security(struct
 inode *inode, struct inode *dir,
 ?{

? const struct task_security_struct *tsec =
current_security();
? struct superblock_security_struct *sbsec;

security/selinux/hooks.c +1 -1
-	u32 sid, newsid, clen;
+	u32 newsid, clen;

? int rc;
? char *context;
?
? sbsec = dir->i_sb->s_security;
?

security/selinux/hooks.c +0 -1
-	sid = tsec->sid;
Quoted 3 lines

? newsid = tsec->create_sid;
?
? rc = selinux_determine_inode_label(current_security(),

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] selinux: fix build warning

In reply to Corentin Labbe
Quoted 7 lines · Corentin Labbe

This patch make selinux_task_prlimit() static since it is not used anywhere else.
This fix the following build warning:
security/selinux/hooks.c:3981:5: warning: no previous prototype for 'selinux_task_prlimit' [-Wmissing-prototypes]

Quoted 19 lines

---
?security/selinux/hooks.c | 4 ++--
?1 file changed, 2 insertions(+), 2 deletions(-)

security/selinux/hooks.c +0 -0
index 8507a56f85e4..b8a022f4b4a7 100644
@@ -3977,8 +3977,8 @@ static int selinux_task_getioprio(struct
 task_struct *p)
 ?			????PROCESS__GETSCHED, NULL);
 ?}

?
-int selinux_task_prlimit(const struct cred *cred, const struct cred *tcred,

security/selinux/hooks.c +1 -1
-			?unsigned int flags)
+static int selinux_task_prlimit(const struct cred *cred, const

struct cred *tcred,

security/selinux/hooks.c +1 -0
+				unsigned int flags)
Quoted 3 lines

?{
? u32 av = 0;
?

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#5 lore raw
In reply to Stephen Smalley
Quoted 9 lines · Stephen Smalley
Quoted 6 lines · Corentin Labbe

This patch remove the unused variable sid
This fix the following build warning:
security/selinux/hooks.c:2921:6: warning: variable 'sid' set but not used [-Wunused-but-set-variable]

Looks good to me too, merged into selinux/next. Thanks.

Signature · 6 lines
paul moore
www.paul-moore.com
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Applied
#3 lore raw

Re: [PATCH 2/2] selinux: fix build warning

In reply to Stephen Smalley
Quoted 10 lines · Stephen Smalley
Quoted 7 lines · Corentin Labbe

This patch make selinux_task_prlimit() static since it is not used anywhere else.
This fix the following build warning:
security/selinux/hooks.c:3981:5: warning: no previous prototype for 'selinux_task_prlimit' [-Wmissing-prototypes]

Merged, thanks again.

Signature · 6 lines
paul moore
www.paul-moore.com
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html