Findings:
Function KvaserCAN_SetBusParamsFd accepts invalid value 33 in field data.tseg1 of parameter params (KvaserUSB_BusParamsFd_t).
Remarks:
According to CAN FD specification the valid range for data phase parameter tseg1 shall be 1 to 32.
Affected:
- Leaf Pro HS v2
- Hybrid Pro 2x CAN/LIN
Rootcause:
The function itself does not check the range of the data field in the structure KvaserUSB_BusParamsFd_t. The affected devices (and only the affected devices) do not response with an error when given an invalid value in field data.tseg1.
Comment:
This behavior on driver level is assessed as a minor issue, because sanity checks for CAN FD bit-rate settings are implemented on user level (CAN API V3).
Testcase:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TC17: Set CAN FD bus params with field 'data.tseg1' set to invalid value
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
expected: Not CANUSB_SUCCESS
note: this test requires a CAN FD capable device
pre:
- initialize DUT1 with configured settings
test: loop over selected invalid bus params
- sub(1): 1Mbps : 8Mbps with field 'data.tseg1' set to 33
- sub(2): 500kbps : 4Mbps with field 'data.tseg1' set to 255
- sub(3): 250kbps : 2Mbps with field 'data.tseg1' set to 255
- sub(4): 125kbps : 1Mbps with field 'data.tseg1' set to 33
-- try to set invalid bus params into DUT1
-- if nevertheless successful get bus params from DUT1
-- and compare set and get bus params
post:
- shutdown DUT1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note: Value 255 is recognized as invalid by the affected devices and the corresponding sub-testcase passed.
Findings:
Function
KvaserCAN_SetBusParamsFdaccepts invalid value 33 in fielddata.tseg1of parameterparams(KvaserUSB_BusParamsFd_t).Remarks:
According to CAN FD specification the valid range for data phase parameter
tseg1shall be 1 to 32.Affected:
Rootcause:
The function itself does not check the range of the data field in the structure
KvaserUSB_BusParamsFd_t. The affected devices (and only the affected devices) do not response with an error when given an invalid value in fielddata.tseg1.Comment:
This behavior on driver level is assessed as a minor issue, because sanity checks for CAN FD bit-rate settings are implemented on user level (CAN API V3).
Testcase:
Note: Value 255 is recognized as invalid by the affected devices and the corresponding sub-testcase passed.