Article View: linux.kernel.netdev
Article #26790[PATCH net-next v2] can: gw: reject frame format changes in UID updates
From: Hungyu Lin
Date: Fri, 04 Dec 2026 07:07
Date: Fri, 04 Dec 2026 07:07
36 lines
11762 bytes
11762 bytes
UID updates replace only the modification rules of an existing gateway
job. The job keeps its original flags, while cgw_parse_attr() selects
modification functions using the flags supplied with the update. A
request that changes CGW_FLAGS_CAN_FD can therefore install CAN FD data
operations on a Classical CAN job.
Require all flags to match when updating a job by UID. Changes to the
other flags are equally ineffective because the job keeps its original
settings.
Fixes: 456a8a646b25 ("can: gw: add support for CAN FD frames")
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
Changes in v2:
- Reject changes to all flags, as suggested by Oliver Hartkopp.
net/can/gw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/can/gw.c b/net/can/gw.c
index 8a5327d8a00e8..14fa2e5ef505c 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -1123,7 +1123,8 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh,
continue;
/* interfaces & filters must be identical */
- if (memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw))) {
+ if (gwj->flags != r->flags ||
+ memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw))) {
err = -EINVAL;
goto out_free_cf;
}
--
2.50.1 (Apple Git-155)
Technical Details
Message-ID:
<20261204070726.53955-1-dennylin0707@gmail.com>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377130-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377130-linux-kernel-netdev=dewy.ru
From: dennylin0707@gmail.com (Hungyu Lin)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2] can: gw: reject frame format changes in UID updates
Date: Fri, 4 Dec 2026 07:07:26 +0000
Organization: Usenet Network
Message-ID: <20261204070726.53955-1-dennylin0707@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2698819"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:KQTbizLll+tF37ZhhFrdRzfrRRo= sha256:rwyxiVsu25hQ4llZJObHo/8Ha/j68U8R02RIjr9T/JA=
sha1:aIc1+BBHIh9ZRDLpbeSzwkr4o7Q= sha256:LFrEtLv4VYgM+lgPXVZt3Bhw1rS4KnEEmiyUbXhlOZo=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id A7A56117B3D; Fri, 4 Dec 2026 10:07:53 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.297
X-Spam-Status: No, score=-3.297 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id yuAm27M4yU6a;
Fri, 4 Dec 2026 10:07:51 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377130-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 4E0E5116D9F; Fri, 4 Dec 2026 10:07:42 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 57C4225F66; Fri, 4 Dec 2026 07:07:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796368061;
b=hDiuZNfcbdFzpPTtU1lBX2nZNjmA3kngikHWINytEKLWB7BpWDIeO84TzpjbisA4t+wv
K1lm7mxK77FhX1u3N+SrBBZZahcIMR1y4d0/vNkGNlh9Ansgnv9k1fv2w8cDD0/Jd50d9
NoCPFtDbv88jIJ4SIMLG67iYsSISYmJTfsP19ne7Hxiibqd+rxXA86JqaJJSrj29A08Ev
jdgkwcGzJNp6o45YN20joNIpU9dvyqfjIqmXreu51pNk8SWDoaSXE2KxAkobwoWUqcFr/
bm5IKUIBhJgjo82QW33qCe2hmvxOrOaXNNz7ucAQ1P9et4cfb1D9Th0Gsddpt/HF57Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796368061;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=k4SntM4v7Do75udkpQx69fKDlkAQgwtSosAsYGmLEzk=;
b=M/JwhQCiT+j/36NMJhCvZ4EPnTbpHQn2BGqNYqXGCZU99SXxtJN3x+7ddFmVd/C5KX2p
L3SqbufQq8GhlzIgb72N2D/byZvnt9MS5oCDVHGVh7MZPbqGOMuaw5oyZYHR6o/DqnpuW
jwQCwYLKDwPgNAinBXpZ6Z8hg2BdlelwdC3LXuB2noGAwncckrGtsGKrm5xRP2ExDQIOh
HGpR2vHGW2KYPpAKQ4liooLNaUa/v5Hk6crf9f/qYgMmIVmTstf/D/W9WSxbtrYNsXEvk
0LCwAmkKXT3nGUWXXoUDAquXB/XuFnMSmh3YSVnzI4yuH2SUn66obzYoRsw4WP6G3KQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=OiJRieDz;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DD0C606A335;
Fri, 4 Dec 2026 07:07:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=OiJRieDz
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.227.136
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796368060;
b=NYNxQJIFmXK3RFDah/yAsK8A36GfBtOmgsYIiXMhszVjGqrT4HbFvY8eoIeryEgWOEaz
vzmNqo2V3S/PtTr7X2J5tOGWwcHwovS14SqwqNZBXmUjMJ2LRcyUU7kFd4TQT6l/dj8z8
np+yA1aqARK65Rt4qh2fvWJg8hsHopmINUcsA5aJ1cs5p5nLzHnwGgtME/EvZko+MnC00
8N7C55+r7znYB4SDLoG6GTrwA9F+y+VO7gZ7VSJPdrDojVJB1yfN62YQG0GiPK7BkKoHb
RTIEcJxrMuRp8+6KLhGthaqCrM6QGltuw6nra+ac+LYdGelwvr2gLGv0U2rneIl62Xg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796368060;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
Content-Transfer-Encoding;
bh=k4SntM4v7Do75udkpQx69fKDlkAQgwtSosAsYGmLEzk=;
b=qzvEAXmor0WG2YKno193fNoSGFZyTKhjzH2I9fZmVNcHhFVAB5lI6Z0BWIm2rKjL9kw/
7PHK8ye/qq4/xIio6txZojFAmITUgS711dUMFICNTMikZEbSdkIxz5ZMgwsJsSjzAZpt/
vz09OwCoOpprSw9nI/etk2Z1lgzjWSmv3+TdmJGKdYvo4x1XjEWguVfnflwl+beUpI/YK
fbq/qa9OQEbvhEARyK05PIs3GYJP30DrhqOzRyZTKY82z9g+139cbGVJ4tYWKgwLeKDzg
x9+Yk/al/dl16pDqpWp7ADHb6C/uqGZqK1tk9zuz6sev59yoTP+JGOYfBF5Nxv360SQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=OiJRieDz;
arc=none smtp.remote-ip=74.125.227.136
X-Received: from mail-pj2-f8.google.com (mail-pj2-f8.google.com [74.125.227.136])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03A2E606A322
for <netdev@vger.kernel.org>; Fri, 4 Dec 2026 07:07:39 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 03A2E606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pj2-f8.google.com with SMTP id 98e67ed59e1d1-3b3fa8df5c4so283562a91.0
for <netdev@vger.kernel.org>; Thu, 03 Dec 2026 23:07:39 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796368059; x=1796972859; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=k4SntM4v7Do75udkpQx69fKDlkAQgwtSosAsYGmLEzk=;
b=OiJRieDzLMhvzWVrsGLjCshwfw30+0OpAGDXxyng7PGioAy/IwzZX8uRiGP79W3HuQ
t8UnQFSuwgJc0OBjW9A0mHhmd9sGDy6h/gDHFvkRc5kcgpIfap/viPoiVMaa0LHtVKoG
DcbXD13Othxr9R3NrHKtAT1tjWemPSFiK69JyzB5mqt/rZkGDbinuvIkOR0F5Q2f55kZ
lSYBIA6rkOCKnyTyIAfyLI8nVCh5QjPoB8jsWwF76NVjWDlccFsCUzDgBbFq6Z7oY8cw
RAbTgiGUTU/M1iDO/SIxkoG/0mib7/4HfaDaAXi8k+8Yzotp48mVwqbGZ6b3FcRHozIi
M/pw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796368059; x=1796972859;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=k4SntM4v7Do75udkpQx69fKDlkAQgwtSosAsYGmLEzk=;
b=gIt+hRB3/nz1dkVYy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ZN0dwpcQppZEFhPaog7twiu/IUVEnqumsqX6wtaQ
FdlMki8Oy14YK3OKxCHk/Qsfqeyy0RFlr5PBAxqBF5Wb7qzD6mnqvLDhAnJG28MwjvsuI/+cfKw
IxEahFGq0NTuH259zMPKKpTfBG0oHM8qMiNIXAbFzu/4Jrls+9Oum84mzX1KufU8fk4sQZpPbCq
LQ0wr58iXS2/u/c47qb7gNHgl3tdN+aJeadguojUe
X-Received: by 2002:a17:90b:2f4c:b0:3b5:8f72:e47d with SMTP id 98e67ed59e1d1-3b5e06a232bmr1010156a91.48.1796368059071;
Thu, 03 Dec 2026 23:07:39 -0800 (PST)
X-Received: from localhost.localdomain ([76.33.234.50])
by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d10dadsm7860172a91.5.2026.12.03.23.07.38
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 03 Dec 2026 23:07:38 -0800 (PST)
X-Cc: linux-can@vger.kernel.org,
netdev@vger.kernel.org
X-Mailer: git-send-email 2.43.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list