Re: Boolean algebra error in 2.6.24?
- From: Gil Hamilton <gil_hamilton@xxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 13:48:54 +0100 (CET)
Rainer Weikusat <rweikusat@xxxxxxxxxxx> wrote in
news:87skyc83u4.fsf@xxxxxxxxxxxxxxxxx:
static int check_kill_permission(int sig, struct siginfo *info,[snip]
struct task_struct *t)
if (info == SEND_SIG_NOINFO || (!is_si_special(info) &&
SI_FROMUSER(info))) {
return error;
int cap_task_kill(struct task_struct *p, struct siginfo *info,
int sig, u32 secid)
{
if (info != SEND_SIG_NOINFO && (is_si_special(info) ||
SI_FROMKERNEL(info)))
return 0;
Defining a ::= 'signal has info', b ::= 'info is special' and
c ::= 'sent from user', the first condition can be written as
!a || (!b && c) [1]
and the second as
a && (b || !c) [2]
[1] can be transformed as follows:
!(a && (b || !c)) [3, !!]
meaning [2] is actually the opposite of [1], IOW when check_ oks the
signal, cap_ will deny it.
Am I missing something here?
I think I agree that the two conditions being checked are exactly
opposite as you say. However, it appears to me that the resulting
action is also opposite. Defining your "(a && (b || !c))" [2] condition
as X, the first case (check_kill_permission) is doing essentially
"if (!X) deny"
while the second case (cap_task_kill) is doing
"if (X) allow"
That seems consistent to me.
GH
.
- Follow-Ups:
- Re: Boolean algebra error in 2.6.24?
- From: Rainer Weikusat
- Re: Boolean algebra error in 2.6.24?
- References:
- Boolean algebra error in 2.6.24?
- From: Rainer Weikusat
- Boolean algebra error in 2.6.24?
- Prev by Date: Re: physical memory allocated to a program
- Next by Date: Re: Boolean algebra error in 2.6.24?
- Previous by thread: Boolean algebra error in 2.6.24?
- Next by thread: Re: Boolean algebra error in 2.6.24?
- Index(es):