Files
rtems/cpukit/dev/can
Cheng Mingming e73cb3ee2b 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.
2026-06-18 16:30:42 +00:00
..