Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions components/lwp/lwp_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,12 @@ rt_err_t lwp_signal_action(struct rt_lwp *lwp, int signo,
rt_list_t *thread_list;
rt_err_t ret = RT_EOK;

/* Signal numbers are 1-based, reject out-of-range values before indexing */
if (signo <= 0 || valid_signo_check(signo))
{
return -RT_EINVAL;
}

if (lwp)
{
/** acquire READ access to lwp */
Expand Down
5 changes: 5 additions & 0 deletions components/lwp/lwp_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -6752,6 +6752,11 @@ sysret_t sys_sigaction(int sig, const struct k_sigaction *act,
struct lwp_sigaction kact, *pkact = RT_NULL;
struct lwp_sigaction koact, *pkoact = RT_NULL;

if (sig <= 0 || (unsigned long)sig > _LWP_NSIG)
{
SET_ERRNO(EINVAL);
goto out;
}
if (!sigsetsize)
{
SET_ERRNO(EINVAL);
Expand Down
Loading