RTEMS | cpukit/dev/can: Reject out-of-range CAN queue priority (!1310)

mingming cheng (@kymm) gitlab at rtems.org
Thu Jun 18 02:42:11 UTC 2026



mingming cheng created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1310

Project:Branches: kymm/rtems:fix-can-queue-priority to rtems/rtos/rtems:main
Author:   mingming cheng



## Summary

cpukit/dev/can: Reject out-of-range CAN queue priority

can_bus_ioctl_create_queue() validates the priority supplied by user
space via the RTEMS_CAN_CREATE_QUEUE ioctl. The valid range is 0 to
RTEMS_CAN_QUEUE_PRIO_NR - 1, since RTEMS_CAN_QUEUE_PRIO_NR is the
number of available priority classes.

The previous check rejected only values greater than
RTEMS_CAN_QUEUE_PRIO_NR, so a priority equal to RTEMS_CAN_QUEUE_PRIO_NR
passed validation and was stored in edge_prio. Reject this value at
the ioctl boundary instead of accepting an out-of-range priority and
relying on later internal handling.

Use >= so that only priorities within the documented range are
accepted.


## Generative AI

<!-- If you have used AI please use the "AI Contribution" template otherwise leave this blank see our fulls statement at https://www.rtems.org/generative-ai/-->


<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1310
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260618/5b861ca4/attachment.htm>


More information about the bugs mailing list