selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyj.lk@gmail.com>
To: Paul Moore <paul@paul-moore.com>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	Eric Paris <eparis@parisplace.org>,
	James Morris <james.l.morris@oracle.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	William Roberts <william.c.roberts@intel.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org
Subject: [PATCH -next] SELinux: fix error return code in policydb_read()
Date: Sat, 10 Sep 2016 07:43:48 +0000	[thread overview]
Message-ID: <1473493428-26786-1-git-send-email-weiyj.lk@gmail.com> (raw)

From: Wei Yongjun <weiyongjun1@huawei.com>

Fix to return error code -EINVAL from the error handling case instead
of 0(rc is overwrite to 0 when policyvers >= POLICYDB_VERSION_ROLETRANS),
as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 security/selinux/ss/policydb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 8c661f0..ace6838 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -2417,6 +2417,7 @@ int policydb_read(struct policydb *p, void *fp)
 		} else
 			tr->tclass = p->process_class;
 
+		rc = -EINVAL;
 		if (!policydb_role_isvalid(p, tr->role) ||
 		    !policydb_type_isvalid(p, tr->type) ||
 		    !policydb_class_isvalid(p, tr->tclass) ||

             reply	other threads:[~2016-09-10  7:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-10  7:43 Wei Yongjun [this message]
2016-09-13 21:19 ` [PATCH -next] SELinux: fix error return code in policydb_read() Paul Moore
2019-01-18 14:23 [PATCH -next] selinux: Fix " Wei Yongjun
2019-01-18 21:28 ` Paul Moore
2019-01-19  0:21   ` Stephen Rothwell
2019-01-20 20:04     ` Stephen Rothwell
2019-01-22 17:39       ` Paul Moore
2019-01-25 21:59         ` Paul Moore
2020-04-29  7:30 [PATCH -next] selinux: fix " Wei Yongjun
2020-04-29 13:07 ` Dan Carpenter
2020-04-29 13:32   ` Ondrej Mosnacek
2020-04-29 13:47     ` Dan Carpenter
2020-05-01 19:08     ` Paul Moore
2020-05-01 19:52       ` Ondrej Mosnacek
2020-05-01 16:46   ` Paul Moore
2020-05-04 19:17     ` Dan Carpenter
2020-05-01 19:04 ` Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473493428-26786-1-git-send-email-weiyj.lk@gmail.com \
    --to=weiyj.lk@gmail.com \
    --cc=eparis@parisplace.org \
    --cc=james.l.morris@oracle.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=serge@hallyn.com \
    --cc=weiyongjun1@huawei.com \
    --cc=william.c.roberts@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).