Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion components/lwp/lwp_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down