Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'linux-can-fixes-for-6.16-20250529' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2025-05-29

this is a pull request of 1 patch for net/main.

The patch is by Fedor Pchelkin and fixes a slab-out-of-bounds access
in the kvaser_pciefd driver.

linux-can-fixes-for-6.16-20250529

* tag 'linux-can-fixes-for-6.16-20250529' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
can: kvaser_pciefd: refine error prone echo_skb_max handling logic
====================

Link: https://patch.msgid.link/20250529075313.1101820-1-mkl@pengutronix.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Paolo Abeni f65dca17 54d34165

+1 -2
+1 -2
drivers/net/can/kvaser_pciefd.c
··· 966 966 u32 status, tx_nr_packets_max; 967 967 968 968 netdev = alloc_candev(sizeof(struct kvaser_pciefd_can), 969 - KVASER_PCIEFD_CAN_TX_MAX_COUNT); 969 + roundup_pow_of_two(KVASER_PCIEFD_CAN_TX_MAX_COUNT)); 970 970 if (!netdev) 971 971 return -ENOMEM; 972 972 ··· 995 995 can->tx_max_count = min(KVASER_PCIEFD_CAN_TX_MAX_COUNT, tx_nr_packets_max - 1); 996 996 997 997 can->can.clock.freq = pcie->freq; 998 - can->can.echo_skb_max = roundup_pow_of_two(can->tx_max_count); 999 998 spin_lock_init(&can->lock); 1000 999 1001 1000 can->can.bittiming_const = &kvaser_pciefd_bittiming_const;