* converting cap_set_pg() to for_each_task_pid()
@ 2002-12-18 5:57 William Lee Irwin III
2002-12-18 6:05 ` Greg KH
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: William Lee Irwin III @ 2002-12-18 5:57 UTC (permalink / raw)
To: chris; +Cc: greg, linux-kernel
I have a pending patch that converts cap_set_pg() to the
for_each_task_pid() API. Could you review this, and if it
pass, include it in your tree?
Thanks,
Bill
cap_set_pg() wants to find all processes in a given process group. This
converts it to use for_each_task_pid().
capability.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff -urpN wli-2.5.51-bk1-4/kernel/capability.c wli-2.5.51-bk1-5/kernel/capability.c
--- wli-2.5.51-bk1-4/kernel/capability.c 2002-12-09 18:45:43.000000000 -0800
+++ wli-2.5.51-bk1-5/kernel/capability.c 2002-12-11 18:32:44.000000000 -0800
@@ -84,13 +84,15 @@ static inline void cap_set_pg(int pgrp,
kernel_cap_t *inheritable,
kernel_cap_t *permitted)
{
- task_t *g, *target;
-
- do_each_thread(g, target) {
- if (target->pgrp != pgrp)
- continue;
- security_capset_set(target, effective, inheritable, permitted);
- } while_each_thread(g, target);
+ task_t *g, *target;
+ struct list_head *l;
+ struct pid *pid;
+
+ for_each_task_pid(pgrp, PIDTYPE_PGID, g, l, pid) {
+ target = g;
+ while_each_thread(g, target)
+ security_capset_set(target, effective, inheritable, permitted);
+ }
}
/*
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: converting cap_set_pg() to for_each_task_pid()
2002-12-18 5:57 converting cap_set_pg() to for_each_task_pid() William Lee Irwin III
@ 2002-12-18 6:05 ` Greg KH
2002-12-18 6:17 ` William Lee Irwin III
2002-12-18 18:04 ` Chris Wright
2002-12-18 23:08 ` Greg KH
2 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2002-12-18 6:05 UTC (permalink / raw)
To: William Lee Irwin III, chris, linux-kernel
On Tue, Dec 17, 2002 at 09:57:42PM -0800, William Lee Irwin III wrote:
> I have a pending patch that converts cap_set_pg() to the
> for_each_task_pid() API. Could you review this, and if it
> pass, include it in your tree?
This is functionally the same, right?
And if so, why do the change, is this now faster somehow?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: converting cap_set_pg() to for_each_task_pid()
2002-12-18 6:05 ` Greg KH
@ 2002-12-18 6:17 ` William Lee Irwin III
0 siblings, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2002-12-18 6:17 UTC (permalink / raw)
To: Greg KH; +Cc: chris, linux-kernel
On Tue, Dec 17, 2002 at 09:57:42PM -0800, William Lee Irwin III wrote:
>> I have a pending patch that converts cap_set_pg() to the
>> for_each_task_pid() API. Could you review this, and if it
>> pass, include it in your tree?
On Tue, Dec 17, 2002 at 10:05:51PM -0800, Greg KH wrote:
> This is functionally the same, right?
> And if so, why do the change, is this now faster somehow?
It is functionally equivalent. The motivation is not so much
performance as API conversion. I am personally taking it upon
myself to deprecate for_each_process() and do_each_thread() and
update the mergeably correctible callers. The deprecation motives
are both efficiency and correctness related.
It should improve performance in whatever sense performance is
interesting from the point of view of this function; however,
it is not motivated by that fact (and performance is not of interest
with respect to most security functions). It is API conversion.
Thanks,
Bill
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: converting cap_set_pg() to for_each_task_pid()
2002-12-18 5:57 converting cap_set_pg() to for_each_task_pid() William Lee Irwin III
2002-12-18 6:05 ` Greg KH
@ 2002-12-18 18:04 ` Chris Wright
2002-12-18 23:08 ` Greg KH
2 siblings, 0 replies; 5+ messages in thread
From: Chris Wright @ 2002-12-18 18:04 UTC (permalink / raw)
To: William Lee Irwin III, chris, greg, linux-kernel
* William Lee Irwin III (wli@holomorphy.com) wrote:
> I have a pending patch that converts cap_set_pg() to the
> for_each_task_pid() API. Could you review this, and if it
> pass, include it in your tree?
I have no problem with this change.
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: converting cap_set_pg() to for_each_task_pid()
2002-12-18 5:57 converting cap_set_pg() to for_each_task_pid() William Lee Irwin III
2002-12-18 6:05 ` Greg KH
2002-12-18 18:04 ` Chris Wright
@ 2002-12-18 23:08 ` Greg KH
2 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2002-12-18 23:08 UTC (permalink / raw)
To: William Lee Irwin III, chris, linux-kernel
On Tue, Dec 17, 2002 at 09:57:42PM -0800, William Lee Irwin III wrote:
> I have a pending patch that converts cap_set_pg() to the
> for_each_task_pid() API. Could you review this, and if it
> pass, include it in your tree?
Applied to my tree, I'll send it to Linus in a bit.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-12-18 23:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-18 5:57 converting cap_set_pg() to for_each_task_pid() William Lee Irwin III
2002-12-18 6:05 ` Greg KH
2002-12-18 6:17 ` William Lee Irwin III
2002-12-18 18:04 ` Chris Wright
2002-12-18 23:08 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox