Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] can: gw: reject frame format changes in UID updates
@ 2026-12-03  2:30 Hungyu Lin
  2026-12-03  2:33 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: Hungyu Lin @ 2026-12-03  2:30 UTC (permalink / raw)
  To: socketcan, mkl; +Cc: linux-can, netdev

An existing gateway job keeps its original flags when its modifications
are replaced by a UID update. cgw_parse_attr() selects modification
functions using the flags from the update request. Changing
CGW_FLAGS_CAN_FD therefore installs CAN FD data operations on a
Classical CAN job. A CAN FD data modification can then touch 64 data
bytes on a frame that only carries 8.

Reject UID updates that change the CAN FD frame-format flag while leaving
updates to the other flags as before.

Fixes: 456a8a646b25 ("can: gw: add support for CAN FD frames")
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
 net/can/gw.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/can/gw.c b/net/can/gw.c
index 8a5327d8a00e8..ff2542f388b66 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -1122,8 +1122,9 @@ static int cgw_create_job(struct sk_buff *skb,  struct nlmsghdr *nlh,
 			if (old_cf->uid != mod->uid)
 				continue;
 
-			/* interfaces & filters must be identical */
-			if (memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw))) {
+			/* interfaces, filters and frame format must be identical */
+			if (((gwj->flags ^ r->flags) & CGW_FLAGS_CAN_FD) ||
+			    memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw))) {
 				err = -EINVAL;
 				goto out_free_cf;
 			}
-- 
2.50.1 (Apple Git-155)


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

* Re: [PATCH net-next] can: gw: reject frame format changes in UID updates
  2026-12-03  2:30 [PATCH net-next] can: gw: reject frame format changes in UID updates Hungyu Lin
@ 2026-12-03  2:33 ` netdev-bot+sinfo
  0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-12-03  2:33 UTC (permalink / raw)
  To: Hungyu Lin; +Cc: socketcan, mkl, linux-can, netdev

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by LLM and not proven at runtime). If it was triggered
   please include the symptoms, like the stack trace or kernel messages.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  2:30 [PATCH net-next] can: gw: reject frame format changes in UID updates Hungyu Lin
2026-12-03  2:33 ` netdev-bot+sinfo

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