mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-16 19:04:53 +08:00
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.