mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: santosh nayak <santoshprasadnayak@gmail.com>
To: takedakn@nttdata.co.jp
Cc: penguin-kernel@I-love.SAKURA.ne.jp, james.l.morris@oracle.com,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Santosh Nayak <santoshprasadnayak@gmail.com>
Subject: [PATCH] TOMOYO: Return error if fails to delete a domain.
Date: Sun, 18 Mar 2012 07:37:44 +0530	[thread overview]
Message-ID: <1332036464-9538-1-git-send-email-santoshprasadnayak@gmail.com> (raw)

From: Santosh Nayak <santoshprasadnayak@gmail.com>

'tomoyo_write_domain' should return error from tomoyo_delete_domain()
to its caller.

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
---
 security/tomoyo/common.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index c47d3ce..d13b9a7 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -1081,7 +1081,7 @@ static int tomoyo_delete_domain(char *domainname)
 	name.name = domainname;
 	tomoyo_fill_path_info(&name);
 	if (mutex_lock_interruptible(&tomoyo_policy_lock))
-		return 0;
+		return -EINTR;
 	/* Is there an active domain? */
 	list_for_each_entry_rcu(domain, &tomoyo_domain_list, list) {
 		/* Never delete tomoyo_kernel_domain */
@@ -1164,15 +1164,16 @@ static int tomoyo_write_domain(struct tomoyo_io_buffer *head)
 	bool is_select = !is_delete && tomoyo_str_starts(&data, "select ");
 	unsigned int profile;
 	if (*data == '<') {
+		int ret = 0;
 		domain = NULL;
 		if (is_delete)
-			tomoyo_delete_domain(data);
+			ret = tomoyo_delete_domain(data);
 		else if (is_select)
 			domain = tomoyo_find_domain(data);
 		else
 			domain = tomoyo_assign_domain(data, false);
 		head->w.domain = domain;
-		return 0;
+		return ret;
 	}
 	if (!domain)
 		return -EINVAL;
-- 
1.7.4.4


             reply	other threads:[~2012-03-18  2:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-18  2:07 santosh nayak [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-16 18:55 santosh nayak
2012-03-18 14:29 ` walter harms

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=1332036464-9538-1-git-send-email-santoshprasadnayak@gmail.com \
    --to=santoshprasadnayak@gmail.com \
    --cc=james.l.morris@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=takedakn@nttdata.co.jp \
    /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

all inboxes | Powered by JetHome®