[PATCH 2/2] cobalt/sched: tp: check partition id obtained from user
Jan Kiszka
jan.kiszka at siemens.com
Fri Aug 30 19:01:13 CEST 2019
On 30.08.19 18:05, Philippe Gerum wrote:
> Signed-off-by: Philippe Gerum <rpm at xenomai.org>
> ---
> kernel/cobalt/sched-tp.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/cobalt/sched-tp.c b/kernel/cobalt/sched-tp.c
> index d3e2586b0..ccff37428 100644
> --- a/kernel/cobalt/sched-tp.c
> +++ b/kernel/cobalt/sched-tp.c
> @@ -168,6 +168,10 @@ static int xnsched_tp_chkparam(struct xnthread *thread,
> {
> struct xnsched_tp *tp = &thread->sched->tp;
>
> + if (p->tp.ptid < 0 ||
> + p->tp.ptid >= CONFIG_XENO_OPT_SCHED_TP_NRPART)
> + return -EINVAL;
> +
> if (tp->gps == NULL ||
> p->tp.prio < XNSCHED_TP_MIN_PRIO ||
> p->tp.prio > XNSCHED_TP_MAX_PRIO)
>
Thanks, applied to next, queued for stable.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
More information about the Xenomai
mailing list