Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH can-next 00/22] can: memcg accounting, CAN_ISOTP fixes and cleanups
@ 2026-11-26 21:05 Oliver Hartkopp
  2026-11-26 21:05 ` [PATCH can-next 01/22] can: raw: read socket options under conf_lock in raw_getsockopt() Oliver Hartkopp
                   ` (22 more replies)
  0 siblings, 23 replies; 38+ messages in thread
From: Oliver Hartkopp @ 2026-11-26 21:05 UTC (permalink / raw)
  To: linux-can
  Cc: Marc Kleine-Budde, Oliver Hartkopp, Sashiko, Zihan Xi,
	Oleksij Rempel, Wentian Ye

Patches 1-3 are the remaining CAN patches of the former lock_sock() and
memcg series, whose first patches have been applied via the net tree.
They are followed by CAN_ISOTP fixes and cleanups that have been found
while preparing the CAN XL support for CAN_ISOTP.

Patches 1-2 read the CAN_RAW and CAN_ISOTP socket options under
conf_lock, so that a concurrent setsockopt() can not lead to a mix of
old and new values in getsockopt().

Patch 3 enables the memcg accounting for the CAN allocations that can
be triggered by unprivileged users (socket structures, receivers,
CAN_BCM ops and frames, CAN_RAW/J1939 filters, the CAN_ISOTP TX buffer
for large PDUs and the J1939 per device data).

Patches 4-8 improve the CAN_ISOTP socket options:
- check the CAN_ISOTP_OPTS values before applying them
- add the documented frame transmission time (N_As/N_Ar) to the
  protocol timeouts
- reject undefined CAN FD tx_flags, reserved STmin values and
  CAN_ISOTP_CHK_PAD_DATA without CAN_ISOTP_RX_PADDING

Patches 9-14 fix the CAN_ISOTP reception against ISO 15765-2:
- drop frames without N_PCI and FFs with an invalid length extension
- check FF_DLmin and the data length of the last CF
- do not send FC.OVFLW in listen mode
- ignore invalid SF/FF frames without terminating an ongoing reception

Patches 15-22 are cleanups in preparation of the CAN XL support for
CAN_ISOTP.

As patches 4-14 reject socket option values and frames that have been
accepted before, they are intended for can-next and do not carry Fixes
tags.

---
Oliver Hartkopp (22):
      can: raw: read socket options under conf_lock in raw_getsockopt()
      can: isotp: read socket options under conf_lock in isotp_getsockopt()
      can: enable memcg accounting for user triggered allocations
      can: isotp: check the CAN_ISOTP_OPTS values before applying them
      can: isotp: add the frame transmission time to the protocol timeouts
      can: isotp: check the CAN FD tx_flags in CAN_ISOTP_LL_OPTS
      can: isotp: reject reserved STmin values in CAN_ISOTP_RECV_FC
      can: isotp: reject CAN_ISOTP_CHK_PAD_DATA without CAN_ISOTP_RX_PADDING
      can: isotp: drop frames without N_PCI
      can: isotp: drop FF frames with invalid length extension
      can: isotp: check the minimum FF_DL
      can: isotp: check the data length of the last CF
      can: isotp: do not send FC.OVFLW in listen mode
      can: isotp: ignore invalid SF and FF frames during a reception
      can: isotp: drop inline keyword, let the compiler decide
      can: isotp: rename rx_lock as it has become state machine lock
      can: isotp: introduce isotp_invalid_canid() to verify proper CAN-IDs
      can: isotp: rename variable for the required content length
      can: isotp: rename checkpad functions returning bool values
      can: isotp: change return type of functions to void
      can: isotp: rename pointer in isotp_rcv() prototype
      can: isotp: introduce CAN_ISOTP_MIN_TX_DL

 include/uapi/linux/can/isotp.h |   3 +-
 net/can/af_can.c               |  12 +-
 net/can/bcm.c                  |  10 +-
 net/can/isotp.c                | 380 ++++++++++++++++++++++++-----------------
 net/can/j1939/main.c           |   2 +-
 net/can/j1939/socket.c         |  12 +-
 net/can/raw.c                  |  78 +++++----
 7 files changed, 291 insertions(+), 206 deletions(-)
---
base-commit: e1055cbfd6eb578417f3ce983cf44462e8465267
change-id: 20261126-getsockopt-memcg-isotp-052433c7adda

Best regards,
--  
Oliver Hartkopp <socketcan@hartkopp.net>


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

end of thread, other threads:[~2026-11-28 17:54 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 21:05 [PATCH can-next 00/22] can: memcg accounting, CAN_ISOTP fixes and cleanups Oliver Hartkopp
2026-11-26 21:05 ` [PATCH can-next 01/22] can: raw: read socket options under conf_lock in raw_getsockopt() Oliver Hartkopp
2026-11-26 21:05 ` [PATCH can-next 02/22] can: isotp: read socket options under conf_lock in isotp_getsockopt() Oliver Hartkopp
2026-11-26 21:05 ` [PATCH can-next 03/22] can: enable memcg accounting for user triggered allocations Oliver Hartkopp
2026-11-27 10:08   ` Oliver Hartkopp
2026-11-27 11:50     ` Oleksij Rempel
2026-11-27 11:58       ` Oliver Hartkopp
2026-11-26 21:05 ` [PATCH can-next 04/22] can: isotp: check the CAN_ISOTP_OPTS values before applying them Oliver Hartkopp
2026-11-26 21:05 ` [PATCH can-next 05/22] can: isotp: add the frame transmission time to the protocol timeouts Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 06/22] can: isotp: check the CAN FD tx_flags in CAN_ISOTP_LL_OPTS Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 07/22] can: isotp: reject reserved STmin values in CAN_ISOTP_RECV_FC Oliver Hartkopp
2026-11-26 21:05 ` [PATCH can-next 08/22] can: isotp: reject CAN_ISOTP_CHK_PAD_DATA without CAN_ISOTP_RX_PADDING Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 09/22] can: isotp: drop frames without N_PCI Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 10/22] can: isotp: drop FF frames with invalid length extension Oliver Hartkopp
2026-11-26 21:05 ` [PATCH can-next 11/22] can: isotp: check the minimum FF_DL Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 12/22] can: isotp: check the data length of the last CF Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 13/22] can: isotp: do not send FC.OVFLW in listen mode Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 14/22] can: isotp: ignore invalid SF and FF frames during a reception Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 15/22] can: isotp: drop inline keyword, let the compiler decide Oliver Hartkopp
2026-11-26 21:05 ` [PATCH can-next 16/22] can: isotp: rename rx_lock as it has become state machine lock Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:05 ` [PATCH can-next 17/22] can: isotp: introduce isotp_invalid_canid() to verify proper CAN-IDs Oliver Hartkopp
2026-11-26 21:06 ` [PATCH can-next 18/22] can: isotp: rename variable for the required content length Oliver Hartkopp
2026-11-26 21:06 ` [PATCH can-next 19/22] can: isotp: rename checkpad functions returning bool values Oliver Hartkopp
2026-11-26 21:06 ` [PATCH can-next 20/22] can: isotp: change return type of functions to void Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-26 21:06 ` [PATCH can-next 21/22] can: isotp: rename pointer in isotp_rcv() prototype Oliver Hartkopp
2026-11-26 21:06 ` [PATCH can-next 22/22] can: isotp: introduce CAN_ISOTP_MIN_TX_DL Oliver Hartkopp
2026-11-28 10:20   ` netdev-bot+sashiko
2026-11-28 17:54 ` [PATCH can-next 00/22] can: memcg accounting, CAN_ISOTP fixes and cleanups Oliver Hartkopp

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