* [PATCH] apparmor: Fix harmless off by one in map_signal_num()
@ 2017-09-01 8:52 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-09-01 8:52 UTC (permalink / raw)
To: linux-security-module
This patch has no effect on runtime.
The sig_map[] array has MAXMAPPED_SIG (35) members so my static checker
complains that the <= should be <. But in this case it's not possible
for "sig" to be more than 31 because of the "else if (sig >= SIGRTMIN)"
condition since SIGRTMIN is 32. The last three elements, 32-34, of
sig_map[] are empty so this code works as designed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c
index 66fb9ede9447..5091c78062e4 100644
--- a/security/apparmor/ipc.c
+++ b/security/apparmor/ipc.c
@@ -128,7 +128,7 @@ static inline int map_signal_num(int sig)
return SIGUNKNOWN;
else if (sig >= SIGRTMIN)
return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */
- else if (sig <= MAXMAPPED_SIG)
+ else if (sig < MAXMAPPED_SIG)
return sig_map[sig];
return SIGUNKNOWN;
}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] apparmor: Fix harmless off by one in map_signal_num()
@ 2017-09-01 8:52 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-09-01 8:52 UTC (permalink / raw)
To: linux-security-module
This patch has no effect on runtime.
The sig_map[] array has MAXMAPPED_SIG (35) members so my static checker
complains that the <= should be <. But in this case it's not possible
for "sig" to be more than 31 because of the "else if (sig >= SIGRTMIN)"
condition since SIGRTMIN is 32. The last three elements, 32-34, of
sig_map[] are empty so this code works as designed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c
index 66fb9ede9447..5091c78062e4 100644
--- a/security/apparmor/ipc.c
+++ b/security/apparmor/ipc.c
@@ -128,7 +128,7 @@ static inline int map_signal_num(int sig)
return SIGUNKNOWN;
else if (sig >= SIGRTMIN)
return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */
- else if (sig <= MAXMAPPED_SIG)
+ else if (sig < MAXMAPPED_SIG)
return sig_map[sig];
return SIGUNKNOWN;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info@ http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] apparmor: Fix harmless off by one in map_signal_num()
2017-09-01 8:52 ` Dan Carpenter
@ 2017-09-25 14:25 ` John Johansen
-1 siblings, 0 replies; 8+ messages in thread
From: John Johansen @ 2017-09-25 14:25 UTC (permalink / raw)
To: linux-security-module
On 09/01/2017 04:52 AM, Dan Carpenter wrote:
> This patch has no effect on runtime.
>
> The sig_map[] array has MAXMAPPED_SIG (35) members so my static checker
> complains that the <= should be <. But in this case it's not possible
> for "sig" to be more than 31 because of the "else if (sig >= SIGRTMIN)"
> condition since SIGRTMIN is 32. The last three elements, 32-34, of
> sig_map[] are empty so this code works as designed.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c
> index 66fb9ede9447..5091c78062e4 100644
> --- a/security/apparmor/ipc.c
> +++ b/security/apparmor/ipc.c
> @@ -128,7 +128,7 @@ static inline int map_signal_num(int sig)
> return SIGUNKNOWN;
> else if (sig >= SIGRTMIN)
> return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */
> - else if (sig <= MAXMAPPED_SIG)
> + else if (sig < MAXMAPPED_SIG)
> return sig_map[sig];
> return SIGUNKNOWN;
> }
>
Colin King beat you to this one, its in apparmor-next
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] apparmor: Fix harmless off by one in map_signal_num()
@ 2017-09-25 14:25 ` John Johansen
0 siblings, 0 replies; 8+ messages in thread
From: John Johansen @ 2017-09-25 14:25 UTC (permalink / raw)
To: linux-security-module
On 09/01/2017 04:52 AM, Dan Carpenter wrote:
> This patch has no effect on runtime.
>
> The sig_map[] array has MAXMAPPED_SIG (35) members so my static checker
> complains that the <= should be <. But in this case it's not possible
> for "sig" to be more than 31 because of the "else if (sig >= SIGRTMIN)"
> condition since SIGRTMIN is 32. The last three elements, 32-34, of
> sig_map[] are empty so this code works as designed.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c
> index 66fb9ede9447..5091c78062e4 100644
> --- a/security/apparmor/ipc.c
> +++ b/security/apparmor/ipc.c
> @@ -128,7 +128,7 @@ static inline int map_signal_num(int sig)
> return SIGUNKNOWN;
> else if (sig >= SIGRTMIN)
> return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */
> - else if (sig <= MAXMAPPED_SIG)
> + else if (sig < MAXMAPPED_SIG)
> return sig_map[sig];
> return SIGUNKNOWN;
> }
>
Colin King beat you to this one, its in apparmor-next
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] apparmor: Fix harmless off by one in map_signal_num()
2017-09-25 14:25 ` John Johansen
@ 2017-09-25 15:09 ` Dan Carpenter
-1 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-09-25 15:09 UTC (permalink / raw)
To: linux-security-module
On Mon, Sep 25, 2017 at 10:25:01AM -0400, John Johansen wrote:
> On 09/01/2017 04:52 AM, Dan Carpenter wrote:
> > This patch has no effect on runtime.
> >
> > The sig_map[] array has MAXMAPPED_SIG (35) members so my static checker
> > complains that the <= should be <. But in this case it's not possible
> > for "sig" to be more than 31 because of the "else if (sig >= SIGRTMIN)"
> > condition since SIGRTMIN is 32. The last three elements, 32-34, of
> > sig_map[] are empty so this code works as designed.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c
> > index 66fb9ede9447..5091c78062e4 100644
> > --- a/security/apparmor/ipc.c
> > +++ b/security/apparmor/ipc.c
> > @@ -128,7 +128,7 @@ static inline int map_signal_num(int sig)
> > return SIGUNKNOWN;
> > else if (sig >= SIGRTMIN)
> > return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */
> > - else if (sig <= MAXMAPPED_SIG)
> > + else if (sig < MAXMAPPED_SIG)
> > return sig_map[sig];
> > return SIGUNKNOWN;
> > }
> >
>
> Colin King beat you to this one, its in apparmor-next
apparmor doesn't seem to be in linux-next at all. Why is that?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] apparmor: Fix harmless off by one in map_signal_num()
@ 2017-09-25 15:09 ` Dan Carpenter
0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2017-09-25 15:09 UTC (permalink / raw)
To: linux-security-module
On Mon, Sep 25, 2017 at 10:25:01AM -0400, John Johansen wrote:
> On 09/01/2017 04:52 AM, Dan Carpenter wrote:
> > This patch has no effect on runtime.
> >
> > The sig_map[] array has MAXMAPPED_SIG (35) members so my static checker
> > complains that the <= should be <. But in this case it's not possible
> > for "sig" to be more than 31 because of the "else if (sig >= SIGRTMIN)"
> > condition since SIGRTMIN is 32. The last three elements, 32-34, of
> > sig_map[] are empty so this code works as designed.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c
> > index 66fb9ede9447..5091c78062e4 100644
> > --- a/security/apparmor/ipc.c
> > +++ b/security/apparmor/ipc.c
> > @@ -128,7 +128,7 @@ static inline int map_signal_num(int sig)
> > return SIGUNKNOWN;
> > else if (sig >= SIGRTMIN)
> > return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */
> > - else if (sig <= MAXMAPPED_SIG)
> > + else if (sig < MAXMAPPED_SIG)
> > return sig_map[sig];
> > return SIGUNKNOWN;
> > }
> >
>
> Colin King beat you to this one, its in apparmor-next
apparmor doesn't seem to be in linux-next at all. Why is that?
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] apparmor: Fix harmless off by one in map_signal_num()
2017-09-25 15:09 ` Dan Carpenter
@ 2017-09-25 16:27 ` John Johansen
-1 siblings, 0 replies; 8+ messages in thread
From: John Johansen @ 2017-09-25 16:27 UTC (permalink / raw)
To: linux-security-module
On 09/25/2017 11:09 AM, Dan Carpenter wrote:
> On Mon, Sep 25, 2017 at 10:25:01AM -0400, John Johansen wrote:
>> On 09/01/2017 04:52 AM, Dan Carpenter wrote:
>>> This patch has no effect on runtime.
>>>
>>> The sig_map[] array has MAXMAPPED_SIG (35) members so my static checker
>>> complains that the <= should be <. But in this case it's not possible
>>> for "sig" to be more than 31 because of the "else if (sig >= SIGRTMIN)"
>>> condition since SIGRTMIN is 32. The last three elements, 32-34, of
>>> sig_map[] are empty so this code works as designed.
>>>
>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>>
>>> diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c
>>> index 66fb9ede9447..5091c78062e4 100644
>>> --- a/security/apparmor/ipc.c
>>> +++ b/security/apparmor/ipc.c
>>> @@ -128,7 +128,7 @@ static inline int map_signal_num(int sig)
>>> return SIGUNKNOWN;
>>> else if (sig >= SIGRTMIN)
>>> return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */
>>> - else if (sig <= MAXMAPPED_SIG)
>>> + else if (sig < MAXMAPPED_SIG)
>>> return sig_map[sig];
>>> return SIGUNKNOWN;
>>> }
>>>
>>
>> Colin King beat you to this one, its in apparmor-next
>
> apparmor doesn't seem to be in linux-next at all. Why is that?
>
hrmmm, apparmor is pulled in via security-next merges, but you are right
apparmor-next isn't being merged and we should set that up.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] apparmor: Fix harmless off by one in map_signal_num()
@ 2017-09-25 16:27 ` John Johansen
0 siblings, 0 replies; 8+ messages in thread
From: John Johansen @ 2017-09-25 16:27 UTC (permalink / raw)
To: linux-security-module
On 09/25/2017 11:09 AM, Dan Carpenter wrote:
> On Mon, Sep 25, 2017 at 10:25:01AM -0400, John Johansen wrote:
>> On 09/01/2017 04:52 AM, Dan Carpenter wrote:
>>> This patch has no effect on runtime.
>>>
>>> The sig_map[] array has MAXMAPPED_SIG (35) members so my static checker
>>> complains that the <= should be <. But in this case it's not possible
>>> for "sig" to be more than 31 because of the "else if (sig >= SIGRTMIN)"
>>> condition since SIGRTMIN is 32. The last three elements, 32-34, of
>>> sig_map[] are empty so this code works as designed.
>>>
>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>>
>>> diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c
>>> index 66fb9ede9447..5091c78062e4 100644
>>> --- a/security/apparmor/ipc.c
>>> +++ b/security/apparmor/ipc.c
>>> @@ -128,7 +128,7 @@ static inline int map_signal_num(int sig)
>>> return SIGUNKNOWN;
>>> else if (sig >= SIGRTMIN)
>>> return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */
>>> - else if (sig <= MAXMAPPED_SIG)
>>> + else if (sig < MAXMAPPED_SIG)
>>> return sig_map[sig];
>>> return SIGUNKNOWN;
>>> }
>>>
>>
>> Colin King beat you to this one, its in apparmor-next
>
> apparmor doesn't seem to be in linux-next at all. Why is that?
>
hrmmm, apparmor is pulled in via security-next merges, but you are right
apparmor-next isn't being merged and we should set that up.
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-09-25 16:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 8:52 [PATCH] apparmor: Fix harmless off by one in map_signal_num() Dan Carpenter
2017-09-01 8:52 ` Dan Carpenter
2017-09-25 14:25 ` John Johansen
2017-09-25 14:25 ` John Johansen
2017-09-25 15:09 ` Dan Carpenter
2017-09-25 15:09 ` Dan Carpenter
2017-09-25 16:27 ` John Johansen
2017-09-25 16:27 ` John Johansen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.