4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-21 00:27:19 +08:00

[lwp]检查killpg的signo参数的有效性 (#9981)

* [lwp]对检查killpg的signo参数的有效性
This commit is contained in:
heyuanjie87 2025-02-18 14:33:56 +08:00 committed by GitHub
parent 91beec4239
commit 4b25b5ed9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,6 +27,11 @@
#include "sys/signal.h"
#include "syscall_generic.h"
rt_inline rt_err_t valid_signo_check(unsigned long sig)
{
return sig <= _LWP_NSIG ? 0 : -RT_EINVAL;
}
static lwp_siginfo_t siginfo_create(rt_thread_t current, int signo, int code, lwp_siginfo_ext_t ext)
{
lwp_siginfo_t siginfo;
@ -1432,7 +1437,8 @@ rt_err_t lwp_pgrp_signal_kill(rt_processgroup_t pgrp, long signo, long code,
PGRP_ASSERT_LOCKED(pgrp);
if (pgrp)
rc = valid_signo_check(signo);
if (pgrp && !rc)
{
rt_list_for_each_entry(lwp, &pgrp->process, pgrp_node)
{