Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH can-next v3 0/6] can: bittiming: fix defects in the userspace bit rate conversion and reject invalid timing constants
@ 2026-11-30 13:06 Marc Kleine-Budde
  2026-11-30 13:06 ` [PATCH can-next v3 1/6] can: bittiming: can_calc_bittiming(): fix potential divide-by-zero Marc Kleine-Budde
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Marc Kleine-Budde @ 2026-11-30 13:06 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Oliver Hartkopp,
	Wolfgang Grandegger, David S. Miller
  Cc: kernel, linux-can, Sureshkumar S, stable, YuanZhe Liu, Bin Yu,
	Cheng Wen

This series combines all bit timing relates fixes into one series.
Patch #1 and #2 are by Sureshkumar S, they say:

can_calc_bittiming() converts a userspace supplied bit rate into hardware
timing parameters. Two defects in that conversion are fixed here, both
reachable through IFLA_CAN_BITTIMING on any CAN device that provides a
bittiming_const, and both caused by 32 bit arithmetic on a value that
userspace fully controls.

Patch #1 fixes a potential divide-by-zero. If the 32 bit tsegall *
bt->bitrate product wraps to zero for bit rates carrying enough factors of
two, the following division faults. A bit rate of 16777216 is already
enough, which is below the 20 Mbit/s CAN XL data bit rate ceiling.

Patch #2 fixes the candidate rating, which applies abs() to an unsigned
subtraction. A wrapped difference is read back as a small error, so a bit
rate far outside what the controller can reach passes the 5% gate and is
silently accepted instead of rejected.

Both were found with a netlink fuzzer against dummy_can and verified under
KASAN in QEMU. Testing covered the unpatched tree, patch #1 alone and the
full series: bit rates from 125 kbit/s to 10 Mbit/s produce byte-identical
bittiming at every step, patch #1 alone removes the oops, and patch #2
turns the silently accepted out-of-range bit rates into -EINVAL.

In addition to Sureshkumar S's patches fix another abs() on an unsigned
subtraction in patch #3,

YuanZhe Liu's patch #4 rejects unusable bit timing constants.

---
Changes in v3:
- patch #1: reject divisor exceeding 32 bit instead of using 64 bit math
- patch #4: rename constant
- patch #5: new
- patch #6: new
- Link to v2: https://patch.msgid.link/20261130-bittiming-fix-conversion-v2-0-36e8a0275923@pengutronix.de

---
Marc Kleine-Budde (3):
      can: bittiming: can_update_sample_point(): fix sample point error calculation on unsigned operands
      can: bittiming: can_bittiming_const_valid(): reject unusable BRP bit timing constant
      can: bittiming: can_fixup_bittiming(): reject too high values for prop-seg/phase-seg1

Sureshkumar S (2):
      can: bittiming: can_calc_bittiming(): fix potential divide-by-zero
      can: bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned operands

YuanZhe Liu (1):
      can: bittiming: register_candev(): reject unusable bit-timing constants

 drivers/net/can/dev/bittiming.c      |  8 +++-
 drivers/net/can/dev/calc_bittiming.c | 12 ++++--
 drivers/net/can/dev/dev.c            | 82 ++++++++++++++++++++++++++++++++++--
 3 files changed, 94 insertions(+), 8 deletions(-)
---
base-commit: 81159a672c331993566a12ad8e07532b38355cba
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git master
change-id: 20261021-bittiming-fix-conversion-24a033ebf153

Best regards,
--  
Marc Kleine-Budde <mkl@pengutronix.de>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH can-next v3 1/6] can: bittiming: can_calc_bittiming(): fix potential divide-by-zero
  2026-11-30 13:06 [PATCH can-next v3 0/6] can: bittiming: fix defects in the userspace bit rate conversion and reject invalid timing constants Marc Kleine-Budde
@ 2026-11-30 13:06 ` Marc Kleine-Budde
  2026-12-02  2:07   ` netdev-bot+sashiko
  2026-11-30 13:06 ` [PATCH can-next v3 2/6] can: bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned operands Marc Kleine-Budde
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Marc Kleine-Budde @ 2026-11-30 13:06 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Oliver Hartkopp,
	Wolfgang Grandegger, David S. Miller
  Cc: kernel, linux-can, Sureshkumar S, stable

From: Sureshkumar S <ssureshmsd7@gmail.com>

can_calc_bittiming() scans the possible time segment combinations and
computes the prescaler for each of them as:

	brp = priv->clock.freq / (tsegall * bt->bitrate)

bt->bitrate is supplied by userspace via IFLA_CAN_BITTIMING and
tsegall * bt->bitrate is a 32 bit multiplication, so the product wraps
to zero as soon as bt->bitrate carries enough factors of two for the
tsegall values walked by the loop. The division then faults:

  Oops: divide error: 0000 [#1] SMP KASAN NOPTI
  RIP: 0010:can_calc_bittiming+0x32e/0xcc0
  Call Trace:
   can_changelink+0x8ba/0x2060
   __rtnl_newlink+0x1013/0x18a0
   rtnl_newlink+0x6b/0xa0
   rtnetlink_rcv_msg+0x6f9/0xb70
   netlink_rcv_skb+0x11f/0x350
   netlink_unicast+0x5f5/0x860
   netlink_sendmsg+0x70a/0xba0

This does not require an absurd bitrate. With the segment limits of a
typical controller tsegall reaches 256, so a bitrate of 16777216 is
already enough to wrap the product, and that value is below the
20 Mbit/s CAN XL data bitrate ceiling. Any CAN driver providing a
bittiming_const is affected; reproduced on dummy_can. Triggering it
needs CAP_NET_ADMIN in the netns owning the device.

priv->bitrate_max cannot guard against this: it is populated from the
optional "max-bitrate" device tree property, so it is zero for most
drivers, and can_changelink() only consults it after can_get_bittiming()
has already returned.

One way to fix this problem would be to use a 64-bit multiplication for
`tsegall * bt->bitrate`. However, since the dividend `priv->clock.freq` is
32 bits wide, a divisor that exceeds 32 bits would result in a quotient of
0, which is not a valid value for brp.

Check whether `tsegall * bt->bitrate` exceeds the value of an unsigned int,
and abort the calculation for this value if this is the case.

Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface")
Signed-off-by: Sureshkumar S <ssureshmsd7@gmail.com>
Cc: stable@vger.kernel.org
Closes: https://sashiko.dev/#/bug/linux-880c95de-8fd9-4e53-8531-985d9b140f44
Co-developed-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/dev/calc_bittiming.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/dev/calc_bittiming.c b/drivers/net/can/dev/calc_bittiming.c
index 42498e9d3f38..8889d55fea65 100644
--- a/drivers/net/can/dev/calc_bittiming.c
+++ b/drivers/net/can/dev/calc_bittiming.c
@@ -6,6 +6,7 @@
  */
 
 #include <linux/units.h>
+#include <linux/overflow.h>
 #include <linux/can/dev.h>
 
 #define CAN_CALC_MAX_ERROR 500 /* max error 5% */
@@ -117,10 +118,15 @@ int can_calc_bittiming(const struct net_device *dev, struct can_bittiming *bt,
 	/* tseg even = round down, odd = round up */
 	for (tseg = (btc->tseg1_max + btc->tseg2_max) * 2 + 1;
 	     tseg >= (btc->tseg1_min + btc->tseg2_min) * 2; tseg--) {
+		unsigned int div;
+
 		tsegall = CAN_SYNC_SEG + tseg / 2;
 
+		if (check_mul_overflow(tsegall, bt->bitrate, &div))
+			continue;
+
 		/* Compute all possible tseg choices (tseg=tseg1+tseg2) */
-		brp = priv->clock.freq / (tsegall * bt->bitrate) + tseg % 2;
+		brp = priv->clock.freq / div + tseg % 2;
 
 		/* choose brp step which is possible in system */
 		brp = (brp / btc->brp_inc) * btc->brp_inc;

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH can-next v3 2/6] can: bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned operands
  2026-11-30 13:06 [PATCH can-next v3 0/6] can: bittiming: fix defects in the userspace bit rate conversion and reject invalid timing constants Marc Kleine-Budde
  2026-11-30 13:06 ` [PATCH can-next v3 1/6] can: bittiming: can_calc_bittiming(): fix potential divide-by-zero Marc Kleine-Budde
@ 2026-11-30 13:06 ` Marc Kleine-Budde
  2026-12-02  2:07   ` netdev-bot+sashiko
  2026-11-30 13:06 ` [PATCH can-next v3 3/6] can: bittiming: can_update_sample_point(): fix sample point " Marc Kleine-Budde
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Marc Kleine-Budde @ 2026-11-30 13:06 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Oliver Hartkopp,
	Wolfgang Grandegger, David S. Miller
  Cc: kernel, linux-can, Sureshkumar S

From: Sureshkumar S <ssureshmsd7@gmail.com>

can_calc_bittiming() rates each candidate against the requested bitrate
with:

	bitrate_error = abs(bt->bitrate - bitrate);

Both operands are unsigned int, so the subtraction wraps instead of
becoming negative, and abs() resolves an unsigned int argument to its
int branch. A wrapped difference is therefore reinterpreted as a small
positive value instead of the large error it actually represents.

A requested bitrate far above anything the controller can reach then
passes the CAN_CALC_MAX_ERROR gate. On a dummy_can device with a 160 MHz
clock, requesting 4294967294 bps reports an error of 0.01%, configures
415584 bps and returns success to userspace, where -EINVAL is expected.

Use abs_diff(), which subtracts the smaller operand from the larger one
and keeps the whole comparison unsigned.

Fixes: 7da29f97d6c8 ("can: dev: can-calc-bit-timing(): better sample point calculation")
Signed-off-by: Sureshkumar S <ssureshmsd7@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/dev/calc_bittiming.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/dev/calc_bittiming.c b/drivers/net/can/dev/calc_bittiming.c
index 8889d55fea65..84825f2252ca 100644
--- a/drivers/net/can/dev/calc_bittiming.c
+++ b/drivers/net/can/dev/calc_bittiming.c
@@ -134,7 +134,7 @@ int can_calc_bittiming(const struct net_device *dev, struct can_bittiming *bt,
 			continue;
 
 		bitrate = priv->clock.freq / (brp * tsegall);
-		bitrate_error = abs(bt->bitrate - bitrate);
+		bitrate_error = abs_diff(bt->bitrate, bitrate);
 
 		/* tseg brp biterror */
 		if (bitrate_error > best_bitrate_error)

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH can-next v3 3/6] can: bittiming: can_update_sample_point(): fix sample point error calculation on unsigned operands
  2026-11-30 13:06 [PATCH can-next v3 0/6] can: bittiming: fix defects in the userspace bit rate conversion and reject invalid timing constants Marc Kleine-Budde
  2026-11-30 13:06 ` [PATCH can-next v3 1/6] can: bittiming: can_calc_bittiming(): fix potential divide-by-zero Marc Kleine-Budde
  2026-11-30 13:06 ` [PATCH can-next v3 2/6] can: bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned operands Marc Kleine-Budde
@ 2026-11-30 13:06 ` Marc Kleine-Budde
  2026-12-02  2:07   ` netdev-bot+sashiko
  2026-11-30 13:06 ` [PATCH can-next v3 4/6] can: bittiming: register_candev(): reject unusable bit-timing constants Marc Kleine-Budde
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Marc Kleine-Budde @ 2026-11-30 13:06 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Oliver Hartkopp,
	Wolfgang Grandegger, David S. Miller
  Cc: kernel, linux-can

can_update_sample_point() rates each candidate against the requested
sample point with:

	sample_point_error = abs(sample_point_reference - sample_point);

Both operands are unsigned int, so the subtraction wraps instead of
becoming negative, and abs() resolves an unsigned int argument to its
int branch. A wrapped difference is therefore reinterpreted as a small
positive value instead of the large error it actually represents.

Use abs_diff(), which subtracts the smaller operand from the larger one
and keeps the whole comparison unsigned.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/dev/calc_bittiming.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/dev/calc_bittiming.c b/drivers/net/can/dev/calc_bittiming.c
index 84825f2252ca..480257772acb 100644
--- a/drivers/net/can/dev/calc_bittiming.c
+++ b/drivers/net/can/dev/calc_bittiming.c
@@ -74,7 +74,7 @@ can_update_sample_point(const struct can_bittiming_const *btc,
 
 		sample_point = 1000 * (tseg + CAN_SYNC_SEG - tseg2) /
 			(tseg + CAN_SYNC_SEG);
-		sample_point_error = abs(sample_point_reference - sample_point);
+		sample_point_error = abs_diff(sample_point_reference, sample_point);
 
 		if (sample_point <= sample_point_reference &&
 		    sample_point_error < best_sample_point_error) {

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH can-next v3 4/6] can: bittiming: register_candev(): reject unusable bit-timing constants
  2026-11-30 13:06 [PATCH can-next v3 0/6] can: bittiming: fix defects in the userspace bit rate conversion and reject invalid timing constants Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2026-11-30 13:06 ` [PATCH can-next v3 3/6] can: bittiming: can_update_sample_point(): fix sample point " Marc Kleine-Budde
@ 2026-11-30 13:06 ` Marc Kleine-Budde
  2026-12-02  2:07   ` netdev-bot+sashiko
  2026-11-30 13:06 ` [PATCH can-next v3 5/6] can: bittiming: can_bittiming_const_valid(): reject unusable BRP bit timing constant Marc Kleine-Budde
  2026-11-30 13:06 ` [PATCH can-next v3 6/6] can: bittiming: can_fixup_bittiming(): reject too high values for prop-seg/phase-seg1 Marc Kleine-Budde
  5 siblings, 1 reply; 13+ messages in thread
From: Marc Kleine-Budde @ 2026-11-30 13:06 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Oliver Hartkopp,
	Wolfgang Grandegger, David S. Miller
  Cc: kernel, linux-can, YuanZhe Liu, stable, Bin Yu, Cheng Wen

From: YuanZhe Liu <25031212351@stu.xidian.edu.cn>

can_bittiming_const_valid() is the hook register_candev() uses to verify
the constants a driver registers, but it only looks at sjw_max. The values
can_calc_bittiming() and can_calc_pwm() depend on are not checked.

gs_usb builds its struct can_bittiming_const and its clock frequency from
the response of the GS_USB_BREQ_BT_CONST control request, so both come from
the USB device. A device that reports brp_inc = 0 crashes the kernel with a
division by zero as soon as a user with CAP_NET_ADMIN configures a bitrate:

  Oops: divide error: 0000 [#1] SMP KASAN
  RIP: 0010:can_calc_bittiming+0x3dd/0xcd0
  Call Trace:
   can_get_bittiming (drivers/net/can/dev/bittiming.c:146)
   can_changelink (drivers/net/can/dev/netlink.c:594)
   rtnetlink_rcv_msg (net/core/rtnetlink.c:7137)

Controllers may read the bit timing constants via USB, check the
minimum/maximum values and avoid divide by zero in the calculation.

Also limit the bit time to CAN_MAX_BIT_TIME_TQ. The loop in
can_calc_bittiming() walks all time segment candidates from the maxima down
to the minima; with a bit time near U32_MAX its bounds wrap around and the
loop does not terminate while RTNL is held. The bit times of the currently
supported controllers stay well below the limit.

can_calc_bittiming() also divides by the clock frequency, gs_usb and ucan
take it from the device as well, so reject a zero frequency while the
device is registered. The data bit timing builds on the nominal bit timing:
CAN-FD requires CAN-CC, CAN XL requires CAN-FD, and the XL PWM constants
require CAN XL, validate the constants along the chain.

Reject unusable values during registration, so that a device or driver
handing out such values fails to probe instead of taking the kernel down
later.

Fixes: d58ac89d0d38 ("can: dev: register_candev(): ensure that bittiming const are valid")
Cc: stable@vger.kernel.org
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/dev/dev.c | 74 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 70 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c
index 3207c0e08712..705c1968b3a6 100644
--- a/drivers/net/can/dev/dev.c
+++ b/drivers/net/can/dev/dev.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/of.h>
+#include <linux/overflow.h>
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 
@@ -595,15 +596,54 @@ static int can_get_termination(struct net_device *ndev)
 	return 0;
 }
 
+/* Upper bound for the bit time in time quanta. The limit keeps the time segment scan in
+ * can_calc_bittiming() bounded.
+ */
+#define CAN_BIT_TIME_TQ_MAX 1024
+
 static bool
 can_bittiming_const_valid(const struct can_bittiming_const *btc)
 {
-	if (!btc)
-		return true;
+	u32 bit_time;
+
+	/* Controllers may read the bit timing constants via USB, check the
+	 * minimum/maximum values and avoid divide by zero in the calculation.
+	 */
+	if (!btc->tseg1_min || btc->tseg1_min > btc->tseg1_max)
+		return false;
+
+	if (!btc->tseg2_min || btc->tseg2_min > btc->tseg2_max)
+		return false;
 
 	if (!btc->sjw_max)
 		return false;
 
+	if (!btc->brp_min || btc->brp_min > btc->brp_max || !btc->brp_inc)
+		return false;
+
+	if (check_add_overflow(btc->tseg1_max, btc->tseg2_max, &bit_time) ||
+	    check_add_overflow(bit_time, CAN_SYNC_SEG, &bit_time) ||
+	    bit_time > CAN_BIT_TIME_TQ_MAX)
+		return false;
+
+	return true;
+}
+
+static bool
+can_pwm_const_valid(const struct can_pwm_const *pwm_const)
+{
+	u32 shortest_symbol;
+
+	if (pwm_const->pwms_min > pwm_const->pwms_max ||
+	    pwm_const->pwml_min > pwm_const->pwml_max ||
+	    pwm_const->pwmo_min > pwm_const->pwmo_max)
+		return false;
+
+	/* can_calc_pwm() divides by the shortest PWM symbol. */
+	if (check_add_overflow(pwm_const->pwms_min, pwm_const->pwml_min,
+			       &shortest_symbol) || !shortest_symbol)
+		return false;
+
 	return true;
 }
 
@@ -632,8 +672,34 @@ int register_candev(struct net_device *dev)
 	    (priv->bittiming_const || priv->fd.data_bittiming_const))
 		return -EINVAL;
 
-	if (!can_bittiming_const_valid(priv->bittiming_const) ||
-	    !can_bittiming_const_valid(priv->fd.data_bittiming_const))
+	/* Validate CAN clock and CAN-CC bittiming */
+	if (priv->bittiming_const &&
+	    (!priv->clock.freq ||
+	     !can_bittiming_const_valid(priv->bittiming_const)))
+		return -EINVAL;
+
+	/* For CAN-FD:
+	 * Ensure CAN-CC bittiming and validate CAN-FD bittiming
+	 */
+	if (priv->fd.data_bittiming_const &&
+	    (!priv->bittiming_const ||
+	     !can_bittiming_const_valid(priv->fd.data_bittiming_const)))
+		return -EINVAL;
+
+	/* For CAN XL:
+	 * Ensure CAN-FD bittiming and validate CAN XL bittiming
+	 */
+	if (priv->xl.data_bittiming_const &&
+	    (!priv->fd.data_bittiming_const ||
+	     !can_bittiming_const_valid(priv->xl.data_bittiming_const)))
+		return -EINVAL;
+
+	/* For CAN XL PWM:
+	 * Ensure CAN XL bittiming and validate CAN XL PWM constants
+	 */
+	if (priv->xl.pwm_const &&
+	    (!priv->xl.data_bittiming_const ||
+	     !can_pwm_const_valid(priv->xl.pwm_const)))
 		return -EINVAL;
 
 	if (!priv->termination_const) {

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH can-next v3 5/6] can: bittiming: can_bittiming_const_valid(): reject unusable BRP bit timing constant
  2026-11-30 13:06 [PATCH can-next v3 0/6] can: bittiming: fix defects in the userspace bit rate conversion and reject invalid timing constants Marc Kleine-Budde
                   ` (3 preceding siblings ...)
  2026-11-30 13:06 ` [PATCH can-next v3 4/6] can: bittiming: register_candev(): reject unusable bit-timing constants Marc Kleine-Budde
@ 2026-11-30 13:06 ` Marc Kleine-Budde
  2026-12-02  2:07   ` netdev-bot+sashiko
  2026-11-30 13:06 ` [PATCH can-next v3 6/6] can: bittiming: can_fixup_bittiming(): reject too high values for prop-seg/phase-seg1 Marc Kleine-Budde
  5 siblings, 1 reply; 13+ messages in thread
From: Marc Kleine-Budde @ 2026-11-30 13:06 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Oliver Hartkopp,
	Wolfgang Grandegger, David S. Miller
  Cc: kernel, linux-can

Controllers may read their bit timing constants via USB, limit `brp_max` to
a sensible value to avoid overflows in `can_fixup_bittiming()` and
`can_calc_bittiming()`.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/dev/dev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c
index 705c1968b3a6..24fdcd0c8842 100644
--- a/drivers/net/can/dev/dev.c
+++ b/drivers/net/can/dev/dev.c
@@ -601,6 +601,11 @@ static int can_get_termination(struct net_device *ndev)
  */
 #define CAN_BIT_TIME_TQ_MAX 1024
 
+/* Upper bound for the maximum bit rate prescaler. The limit keeps the multiplication
+ * `brp * can_bit_time()` bounded.
+ */
+#define CAN_BITTIMING_CONST_BRP_MAX 65536
+
 static bool
 can_bittiming_const_valid(const struct can_bittiming_const *btc)
 {
@@ -626,6 +631,9 @@ can_bittiming_const_valid(const struct can_bittiming_const *btc)
 	    bit_time > CAN_BIT_TIME_TQ_MAX)
 		return false;
 
+	if (btc->brp_max > CAN_BITTIMING_CONST_BRP_MAX)
+		return false;
+
 	return true;
 }
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH can-next v3 6/6] can: bittiming: can_fixup_bittiming(): reject too high values for prop-seg/phase-seg1
  2026-11-30 13:06 [PATCH can-next v3 0/6] can: bittiming: fix defects in the userspace bit rate conversion and reject invalid timing constants Marc Kleine-Budde
                   ` (4 preceding siblings ...)
  2026-11-30 13:06 ` [PATCH can-next v3 5/6] can: bittiming: can_bittiming_const_valid(): reject unusable BRP bit timing constant Marc Kleine-Budde
@ 2026-11-30 13:06 ` Marc Kleine-Budde
  2026-12-02  2:07   ` netdev-bot+sashiko
  5 siblings, 1 reply; 13+ messages in thread
From: Marc Kleine-Budde @ 2026-11-30 13:06 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Oliver Hartkopp,
	Wolfgang Grandegger, David S. Miller
  Cc: kernel, linux-can

In can_fixup_bittiming() the sum pf `bt->prop_seg + bt->phase_seg1` is
calculated. These are user space supplied values, and the sum can overflow
and still pass the following `tseg1_min` and `tseg1_max` checks.

Refuse too high values for `bt->prop_seg` and `bt->phase_seg1` by using
`check_add_overflow()` to calculate the sum.

Closes: https://sashiko.dev/#/bug/linux-afe8ea64-0e1f-42a4-a82c-6275ddeeaebc
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/dev/bittiming.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/dev/bittiming.c b/drivers/net/can/dev/bittiming.c
index 8f82418230ce..40a571f6f939 100644
--- a/drivers/net/can/dev/bittiming.c
+++ b/drivers/net/can/dev/bittiming.c
@@ -51,11 +51,17 @@ static int can_fixup_bittiming(const struct net_device *dev, struct can_bittimin
 			       const struct can_bittiming_const *btc,
 			       struct netlink_ext_ack *extack)
 {
-	const unsigned int tseg1 = bt->prop_seg + bt->phase_seg1;
 	const struct can_priv *priv = netdev_priv(dev);
+	unsigned int tseg1;
 	u64 brp64;
 	int err;
 
+	if (check_add_overflow(bt->prop_seg, bt->phase_seg1, &tseg1)) {
+		NL_SET_ERR_MSG_FMT(extack, "prop-seg + phase-seg1: greater than tseg1-max: %u",
+				   btc->tseg1_max);
+		return -EINVAL;
+	}
+
 	if (tseg1 < btc->tseg1_min) {
 		NL_SET_ERR_MSG_FMT(extack, "prop-seg + phase-seg1: %u less than tseg1-min: %u",
 				   tseg1, btc->tseg1_min);

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH can-next v3 1/6] can: bittiming: can_calc_bittiming(): fix potential divide-by-zero
  2026-11-30 13:06 ` [PATCH can-next v3 1/6] can: bittiming: can_calc_bittiming(): fix potential divide-by-zero Marc Kleine-Budde
@ 2026-12-02  2:07   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-12-02  2:07 UTC (permalink / raw)
  To: mkl
  Cc: mailhol, socketcan, wg, davem, kernel, linux-can, 25031212351,
	stable, byu, wencheng, kuba

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message is inaccurate about where priv->bitrate_max
  comes from.

--

can: bittiming: can_calc_bittiming(): fix potential divide-by-zero

This patch fixes a divide-by-zero in can_calc_bittiming(). The 32-bit
product tsegall * bt->bitrate can wrap to zero for a bitrate supplied by
userspace. It now uses check_mul_overflow() and skips any tseg value
whose divisor would overflow an unsigned int.

Closes: https://sashiko.dev/#/bug/linux-880c95de-8fd9-4e53-8531-985d9b140f44

> priv->bitrate_max cannot guard against this: it is populated from the
> optional "max-bitrate" device tree property, so it is zero for most
> drivers, and can_changelink() only consults it after can_get_bittiming()
> has already returned.

[Severity: Low]

Is the description of where bitrate_max comes from accurate?

of_can_transceiver() in drivers/net/can/dev/dev.c does read the
"max-bitrate" property. Several drivers also set the field in other ways.

dummy_can, the driver used for the reproducer, hard-codes it:

drivers/net/can/dummy_can.c:dummy_can_init() {
    ...
	priv->can.bitrate_max = 20 * MEGA /* BPS */;
    ...
}

at91_can, flexcan, m_can_platform and rcar_canfd copy it from the PHY
transceiver:

	priv->can.bitrate_max = transceiver->attrs.max_link_rate;

etas_es58x sets it from static values (1 * MEGA in es581_4.c, 8 * MEGA in
es58x_fd.c).

The ordering argument still holds. can_changelink() checks bitrate_max
only after can_get_bittiming() has returned:

drivers/net/can/dev/netlink.c:can_changelink() {
    ...
		err = can_get_bittiming(dev, &bt,
					priv->bittiming_const,
					priv->bitrate_const,
					priv->bitrate_const_cnt,
					extack);
		if (err)
			return err;

		if (priv->bitrate_max && bt.bitrate > priv->bitrate_max) {
    ...
}

Could the paragraph keep just the ordering argument, or describe the other
places where bitrate_max is set?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-bittiming-fix-conversion-v3-0-e61f92dc76d0%40pengutronix.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH can-next v3 2/6] can: bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned operands
  2026-11-30 13:06 ` [PATCH can-next v3 2/6] can: bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned operands Marc Kleine-Budde
@ 2026-12-02  2:07   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-12-02  2:07 UTC (permalink / raw)
  To: mkl
  Cc: mailhol, socketcan, wg, davem, kernel, linux-can, 25031212351,
	stable, byu, wencheng, kuba

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit message of "can: bittiming: can_calc_bittiming():
  fix bitrate error calculation on unsigned operands" describes a user-…

--

can: bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned operands

This commit replaces abs(bt->bitrate - bitrate) with
abs_diff(bt->bitrate, bitrate) in can_calc_bittiming(). The error between
the requested and the computed bitrate is then calculated using only
unsigned arithmetic.

> Both operands are unsigned int, so the subtraction wraps instead of
> becoming negative, and abs() resolves an unsigned int argument to its
> int branch. A wrapped difference is therefore reinterpreted as a small
> positive value instead of the large error it actually represents.
>
> A requested bitrate far above anything the controller can reach then
> passes the CAN_CALC_MAX_ERROR gate. On a dummy_can device with a 160 MHz
> clock, requesting 4294967294 bps reports an error of 0.01%, configures
> 415584 bps and returns success to userspace, where -EINVAL is expected.

[Severity: Medium]
Does this reproducer still work on top of the previous patch in the series,
"can: bittiming: can_calc_bittiming(): fix potential divide-by-zero"?

That patch added this check in can_calc_bittiming(). It runs before brp,
bitrate and bitrate_error are computed:

drivers/net/can/dev/calc_bittiming.c:can_calc_bittiming() {
    ...
		if (check_mul_overflow(tsegall, bt->bitrate, &div))
			continue;
    ...
}

dummy_can sets tseg1_min = 2 and tseg2_min = 2. The loop therefore only
runs while tseg >= 8, so tsegall is always >= 5. Since 5 * 4294967294
overflows u32, every candidate takes the continue.

best_bitrate_error then stays at UINT_MAX and the computed error is about
10000 (100%). That is above CAN_CALC_MAX_ERROR, so the function returns
-EINVAL.

The 415584 bps result (tsegall = 385, brp = 1) only seems reachable when
the multiplication is allowed to wrap, which means without the previous
patch.

More generally, any iteration that reaches the abs_diff() line has
tsegall >= 2, so bt->bitrate <= UINT_MAX / 2 = INT_MAX. The computed
bitrate = freq / (brp * tsegall) is also <= INT_MAX.

So the difference always lies within [-INT_MAX, INT_MAX]. In that range,
abs() through its int branch already returns the exact magnitude, and
abs_diff() gives the same result.

The description of the mechanism also looks inverted. When the subtraction
wraps (bitrate > bt->bitrate), abs() through int recovers the correct
value.

The failing case in the example (4294967294 vs 415584) is a difference
that does not wrap. It is larger than INT_MAX, so it reads as a negative
int, and abs() of that gives 415586.

Could the commit message either say that the issue is only reachable
without the overflow check from the previous patch, or describe this
change as hardening on top of it? The Fixes: tag together with the
current reproducer suggests a live userspace-visible bug in this tree.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-bittiming-fix-conversion-v3-0-e61f92dc76d0%40pengutronix.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH can-next v3 3/6] can: bittiming: can_update_sample_point(): fix sample point error calculation on unsigned operands
  2026-11-30 13:06 ` [PATCH can-next v3 3/6] can: bittiming: can_update_sample_point(): fix sample point " Marc Kleine-Budde
@ 2026-12-02  2:07   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-12-02  2:07 UTC (permalink / raw)
  To: mkl
  Cc: mailhol, socketcan, wg, davem, kernel, linux-can, 25031212351,
	stable, byu, wencheng, kuba

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit message says this patch fixes a bug, but the change
  does nothing at this call site.

--

can: bittiming: can_update_sample_point(): fix sample point error calculation on unsigned operands

This commit replaces abs(sample_point_reference - sample_point) with
abs_diff(sample_point_reference, sample_point) in
can_update_sample_point(). The commit message presents this as a fix for a
wrapped unsigned difference that gets reinterpreted as a small positive
value.

> can: bittiming: can_update_sample_point(): fix sample point error calculation on unsigned operands
>
> can_update_sample_point() rates each candidate against the requested
> sample point with:
>
>         sample_point_error = abs(sample_point_reference - sample_point);
>
> Both operands are unsigned int, so the subtraction wraps instead of
> becoming negative, and abs() resolves an unsigned int argument to its
> int branch. A wrapped difference is therefore reinterpreted as a small
> positive value instead of the large error it actually represents.

[Severity: Medium]
Does this description match what happens in can_update_sample_point()?
As far as I can tell, the old and new expressions give the same result in
every case where sample_point_error is actually used.

The error for each candidate is only kept when the candidate is at or
below the reference:

    if (sample_point <= sample_point_reference &&
        sample_point_error < best_sample_point_error) {

In that case the subtraction cannot wrap.

sample_point_reference is also always below 1000. It is either
bt->sample_point, which can_validate_bittiming() in
drivers/net/can/dev/netlink.c bounds:

    if (bt->sample_point >= 1000) {
        NL_SET_ERR_MSG(extack, "sample point must be between 0 and 100%");
        return -EINVAL;
    }

or it is a fixed default from can_calc_sample_point_nrz() or
can_calc_sample_point_pwm(). So the difference never gets close to
INT_MAX. That is the only range where the int branch of abs() would
return a wrong magnitude.

When sample_point > sample_point_reference the subtraction does wrap.
Casting it to int still gives the correct small value, not a "large
error". The check above also rejects that candidate.

The wording looks like it was carried over from the previous commit "can:
bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned
operands". There, bt->bitrate can be close to UINT_MAX, so the difference
can exceed INT_MAX. That reasoning doesn't seem to apply to the sample
point.

Could this be described as a consistency cleanup with "No functional
change intended" instead of a fix? Other fixes in this series are marked
for stable, so a "fix" subject here could get this patch selected for
stable backports. Later patches in the series don't change this.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-bittiming-fix-conversion-v3-0-e61f92dc76d0%40pengutronix.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH can-next v3 4/6] can: bittiming: register_candev(): reject unusable bit-timing constants
  2026-11-30 13:06 ` [PATCH can-next v3 4/6] can: bittiming: register_candev(): reject unusable bit-timing constants Marc Kleine-Budde
@ 2026-12-02  2:07   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-12-02  2:07 UTC (permalink / raw)
  To: mkl
  Cc: mailhol, socketcan, wg, davem, kernel, linux-can, 25031212351,
	stable, byu, wencheng, kuba

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message says "Also limit the bit time to
  CAN_MAX_BIT_TIME_TQ", but the patch defines and uses a macro named…

--

can: bittiming: register_candev(): reject unusable bit-timing constants

This commit extends can_bittiming_const_valid() so that register_candev()
rejects bit-timing constants that would cause a division by zero or an
unbounded loop in can_calc_bittiming(). It also adds
can_pwm_const_valid(), requires a non-zero clock frequency, and checks
that the CAN-CC, CAN-FD, CAN XL and XL PWM constants are registered in
the required order.

> Also limit the bit time to CAN_MAX_BIT_TIME_TQ. The loop in
> can_calc_bittiming() walks all time segment candidates from the maxima down
> to the minima; with a bit time near U32_MAX its bounds wrap around and the
> loop does not terminate while RTNL is held. The bit times of the currently
> supported controllers stay well below the limit.

[Severity: Low]
This isn't a bug, but the macro name in the commit message doesn't match
the code. The patch defines and uses CAN_BIT_TIME_TQ_MAX in
drivers/net/can/dev/dev.c:

    #define CAN_BIT_TIME_TQ_MAX 1024

and can_bittiming_const_valid() checks:

    bit_time > CAN_BIT_TIME_TQ_MAX

No symbol named CAN_MAX_BIT_TIME_TQ exists in the tree. Could the
changelog use CAN_BIT_TIME_TQ_MAX instead?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-bittiming-fix-conversion-v3-0-e61f92dc76d0%40pengutronix.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH can-next v3 5/6] can: bittiming: can_bittiming_const_valid(): reject unusable BRP bit timing constant
  2026-11-30 13:06 ` [PATCH can-next v3 5/6] can: bittiming: can_bittiming_const_valid(): reject unusable BRP bit timing constant Marc Kleine-Budde
@ 2026-12-02  2:07   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-12-02  2:07 UTC (permalink / raw)
  To: mkl
  Cc: mailhol, socketcan, wg, davem, kernel, linux-can, 25031212351,
	stable, byu, wencheng, kuba

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit message understates the bug and lacks Fixes: and
  Cc: stable tags.

--

can: bittiming: can_bittiming_const_valid(): reject unusable BRP bit timing constant

This commit caps brp_max at 65536 in can_bittiming_const_valid(). Drivers
that read their bit timing constants from a USB device can then no longer
register a brp_max large enough to overflow brp * can_bit_time() in
can_fixup_bittiming() and can_calc_bittiming().

> Controllers may read their bit timing constants via USB, limit `brp_max` to
> a sensible value to avoid overflows in `can_fixup_bittiming()` and
> `can_calc_bittiming()`.

[Severity: Medium]
Should the commit message say that this overflow ends in a divide by zero?
Should it also carry Fixes: and Cc: stable tags?

Before this patch, the only limit on brp_max was brp_min <= brp_max. gs_usb
and ucan take both brp_max and clock.freq from the device. The previous
patch limits the bit time to 1024 tq, but the u32 products used as divisors
can still wrap to 0.

In can_fixup_bittiming(), take clock.freq = 80 MHz, a user supplied tq of
52428800, brp_inc = 1 and a device reported brp_max >= 2^22. brp then ends
up as 2^22:

drivers/net/can/dev/bittiming.c:can_fixup_bittiming() {
    ...
	bt->bitrate = priv->clock.freq / (bt->brp * can_bit_time(bt));
    ...
}

With a bit time of 1024, the divisor is 2^32, which wraps to 0.

In can_calc_bittiming(), take clock.freq = 0xFFFFFFFF, tseg1_max +
tseg2_max = 1023 and a requested bitrate of 1. On the first iteration
tsegall = 1024 and div = 1024, so brp = 0xFFFFFFFF / 1024 + 1 = 2^22:

drivers/net/can/dev/calc_bittiming.c:can_calc_bittiming() {
    ...
		bitrate = priv->clock.freq / (brp * tsegall);
    ...
}

Here brp * tsegall also wraps to 0.

A CAP_NET_ADMIN user can reach both paths by sending IFLA_CAN_BITTIMING,
which goes through can_changelink() under RTNL. The new check limits the
product to 2^16 * 2^10, so the code change itself looks complete.

The previous patch in the series, "can: bittiming: register_candev():
reject unusable bit-timing constants", carries Fixes: d58ac89d0d38 and
Cc: stable. It also says such devices should "fail to probe instead of
taking the kernel down later".

If stable trees pick up only that patch, wouldn't this divide by zero
still be reachable there?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-bittiming-fix-conversion-v3-0-e61f92dc76d0%40pengutronix.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH can-next v3 6/6] can: bittiming: can_fixup_bittiming(): reject too high values for prop-seg/phase-seg1
  2026-11-30 13:06 ` [PATCH can-next v3 6/6] can: bittiming: can_fixup_bittiming(): reject too high values for prop-seg/phase-seg1 Marc Kleine-Budde
@ 2026-12-02  2:07   ` netdev-bot+sashiko
  0 siblings, 0 replies; 13+ messages in thread
From: netdev-bot+sashiko @ 2026-12-02  2:07 UTC (permalink / raw)
  To: mkl
  Cc: mailhol, socketcan, wg, davem, kernel, linux-can, 25031212351,
	stable, byu, wencheng, kuba

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit fixes an unsigned wrap in can_fixup_bittiming()
  (drivers/net/can/dev/bittiming.c) that user space can trigger.

--

can: bittiming: can_fixup_bittiming(): reject too high values for prop-seg/phase-seg1

This commit replaces the unchecked prop_seg + phase_seg1 sum in
can_fixup_bittiming() in drivers/net/can/dev/bittiming.c with
check_add_overflow(). User supplied values whose sum wraps around can then
no longer pass the tseg1_min and tseg1_max checks.

Closes: https://sashiko.dev/#/bug/linux-afe8ea64-0e1f-42a4-a82c-6275ddeeaebc

> Closes: https://sashiko.dev/#/bug/linux-afe8ea64-0e1f-42a4-a82c-6275ddeeaebc
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

[Severity: Low]

Should this commit carry Fixes: and Cc: stable tags?

The unchecked sum dates back to the original CAN netlink interface in
39549eef3587 ("can: CAN Network device driver and Netlink interface"),
where drivers/net/can/dev.c did:

    tseg1 = bt->prop_seg + bt->phase_seg1;

Both values come straight from user space. can_changelink() in
drivers/net/can/dev/netlink.c copies IFLA_CAN_BITTIMING unchanged:

    memcpy(&bt, nla_data(data[IFLA_CAN_BITTIMING]), sizeof(bt));

can_dbt_changelink() does the same for the data bit timing. The only
validation is can_get_bittiming()->can_fixup_bittiming().

Take prop_seg = 0xFFFFFFFF and phase_seg1 = tseg1_min + 1. The sum wraps
to tseg1_min and passes both tseg1 checks. The sjw checks only look at
phase_seg1 and phase_seg2, so they pass too.

The bogus prop_seg is then stored in priv->bittiming and passed to the
driver's do_set_bittiming(). It is also reported back to user space, and
the request succeeds instead of returning -EINVAL.

Other patches in this series that fix the same kind of IFLA_CAN_BITTIMING
overflow carry these tags. One example is "can: bittiming:
can_calc_bittiming(): fix potential divide-by-zero":

Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface")
Cc: stable@vger.kernel.org

Without them, stable kernels will not pick up this fix automatically.

Could the commit message also say what happens without the fix? An
out-of-range prop_seg is accepted and programmed into the controller.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-bittiming-fix-conversion-v3-0-e61f92dc76d0%40pengutronix.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-12-02  2:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 13:06 [PATCH can-next v3 0/6] can: bittiming: fix defects in the userspace bit rate conversion and reject invalid timing constants Marc Kleine-Budde
2026-11-30 13:06 ` [PATCH can-next v3 1/6] can: bittiming: can_calc_bittiming(): fix potential divide-by-zero Marc Kleine-Budde
2026-12-02  2:07   ` netdev-bot+sashiko
2026-11-30 13:06 ` [PATCH can-next v3 2/6] can: bittiming: can_calc_bittiming(): fix bitrate error calculation on unsigned operands Marc Kleine-Budde
2026-12-02  2:07   ` netdev-bot+sashiko
2026-11-30 13:06 ` [PATCH can-next v3 3/6] can: bittiming: can_update_sample_point(): fix sample point " Marc Kleine-Budde
2026-12-02  2:07   ` netdev-bot+sashiko
2026-11-30 13:06 ` [PATCH can-next v3 4/6] can: bittiming: register_candev(): reject unusable bit-timing constants Marc Kleine-Budde
2026-12-02  2:07   ` netdev-bot+sashiko
2026-11-30 13:06 ` [PATCH can-next v3 5/6] can: bittiming: can_bittiming_const_valid(): reject unusable BRP bit timing constant Marc Kleine-Budde
2026-12-02  2:07   ` netdev-bot+sashiko
2026-11-30 13:06 ` [PATCH can-next v3 6/6] can: bittiming: can_fixup_bittiming(): reject too high values for prop-seg/phase-seg1 Marc Kleine-Budde
2026-12-02  2:07   ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox