From: "Serge E. Hallyn" <serue@us.ibm.com>
To: James Morris <jmorris@namei.org>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, Stephen Smalley <sds@tycho.nsa.gov>,
Chris Wright <chrisw@sous-sol.org>,
David Quigley <dpquigl@tycho.nsa.gov>,
Eric Paris <eparis@redhat.com>
Subject: Re: [PATCH] SELinux: Add security hook definition for getioprio and insert hooks
Date: Fri, 30 Jun 2006 14:37:30 -0500 [thread overview]
Message-ID: <20060630193730.GC17589@sergelap.austin.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0606291702380.26876@d.namei>
Quoting James Morris (jmorris@namei.org):
...
> +static int get_task_ioprio(struct task_struct *p)
> +{
> + int ret;
> +
> + ret = security_task_getioprio(p);
> + if (ret)
> + goto out;
> + ret = p->ioprio;
> +out:
> + return ret;
> +}
...
> do_each_task_pid(who, PIDTYPE_PGID, p) {
> + tmpio = get_task_ioprio(p);
> + if (tmpio < 0)
> + continue;
> if (ret == -ESRCH)
> - ret = p->ioprio;
> + ret = tmpio;
> else
> - ret = ioprio_best(ret, p->ioprio);
> + ret = ioprio_best(ret, tmpio);
...
> + * @task_getioprio
> + * Check permission before getting the ioprio value of @p.
> + * @p contains the task_struct of process.
> + * Return 0 if permission is granted.
A return value >0 is a problem here but isn't mentioned. the
get_task_ioprio() helper will return the the security_task_getioprio()
return value in htat case, but the do_each_task_pid loop will take it
as a valid return value.
-serge
next prev parent reply other threads:[~2006-06-30 19:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-29 21:04 James Morris
2006-06-30 19:37 ` Serge E. Hallyn [this message]
2006-06-30 19:58 ` Stephen Smalley
2006-07-01 0:26 ` Serge E. Hallyn
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=20060630193730.GC17589@sergelap.austin.ibm.com \
--to=serue@us.ibm.com \
--cc=akpm@osdl.org \
--cc=chrisw@sous-sol.org \
--cc=dpquigl@tycho.nsa.gov \
--cc=eparis@redhat.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sds@tycho.nsa.gov \
/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®