From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=81.169.146.161 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796372723; b=a1ihR9dsNGOi/Q9C0Xtz4Eo15+2ESJICKZTop0O1j92tiALvbJ521ZyfVa1H14jLG1Md w4p5Xo1FirhYxS8//579wrgUBxZI5i4P6iiFrMvqvyowA69SB0L9W7TMhxEmtxQz+lkd6 mgBhb7c9aJ/p5QpWcfnsDFR2vvRAr3g1+ADJM4JGX43YlN2/THRh5UQZPGmCV8s7xIbMd odYOUfGLxCLEsAY3fG/4QZ3Hl4a1rZRQOrk5mvf38uJrKDAl5iykJR15Xe84LMrmxn3+F AyNy0zKqgiiTfeyzRVSsd/Lcaa2pD+AhGnAvk/Jh6ZTSuDmPy/KpWh362k8jzJCgtfA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796372723; h=DMARC-Filter:X-RZG-CLASS-ID:DKIM-Signature:DKIM-Signature:X-RZG-AUTH: Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=sIoq2rL08X0sIQFPq+/IcjvgAiWhwqcf0xHnPqsdYNQ=; b=bGSwN1nvaP0aDBcYOMMFNWeU5kfvpSL4WkeZ9IusCKwOu/JhVeuy5bJkbut4XPKKGyKl uUs2Ny/VkSY6Po5iiN+DqH8x7HdGhzGPF9DYYCA/aofe71PPtNlHKt5Tr9oKkUN3BHhG8 ME2+VUDMViooCisMhKLZyb4A2LjL2MgNTc8w3eImbZpai29dl+h8R18DBb8mbJdjeJpLg XmgEm1WJLHDc19jR0GTRjN76p+3xxcsKLMSrctV8DYFz15aIzF8l09yXTF6xa9OIT/5Um sA1vmBT4+NsGgn8/QBcI447DOcwHSel1cb/sTWVXmmTi3pgsZSobtwKkTPba+6vV9Zg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=hartkopp.net; spf=fail smtp.mailfrom=hartkopp.net; dkim=pass header.d=hartkopp.net header.i=@hartkopp.net header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=XE32gSGL; dkim=pass header.d=hartkopp.net header.i=@hartkopp.net header.a=ed25519-sha256 header.s=strato-dkim-0003 header.b=knSz6xvf; arc=pass header.oldest-pass=0 smtp.remote-ip=81.169.146.161 Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12972606A32D; Fri, 4 Dec 2026 08:25:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 12972606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hartkopp.net Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=hartkopp.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=hartkopp.net header.i=@hartkopp.net header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=XE32gSGL; dkim=pass header.d=hartkopp.net header.i=@hartkopp.net header.a=ed25519-sha256 header.s=strato-dkim-0003 header.b=knSz6xvf ARC-Seal: i=1; a=rsa-sha256; t=1796372713; cv=none; d=strato.com; s=strato-dkim-0002; b=c4JPdNKjwbRvzQUqIDrkaQBnkj/PSaciC6X2nCWueC7gNu40gUSu6yx3ISBs1wbRgt jtCuCGH5MZ6Bfm3+kQ8hajLVEOiJfiS6dK/EMzGdh/aT6rsjZHm/iAyZ8bS0KRpPl5dN q+Q7+S47fz34vPVvHuyodjRSQPxeVoztjpD0h+hhDY8zReTKgtjsHYdXJzGqSak2oBU3 lxZ5luFg9S2LU7VSopTI0WnNvyZh/cuTbt731QgEDLj/YIuHfZ0VO9YGHACBXXxK0IHM YiftzHVjtxvpdT6rcheNiRqAZ2KL6RzMlTYjEINlwRwsJBUpdg6jxwrwj0eZw8aVWxZS QG2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1796372713; s=strato-dkim-0002; d=strato.com; h=In-Reply-To:From:References:Cc:To:Subject:Date:Message-ID:Cc:Date: From:Subject:Sender; bh=sIoq2rL08X0sIQFPq+/IcjvgAiWhwqcf0xHnPqsdYNQ=; b=rBfzLAf0rQdDxhsYaNe8boty25UIPg+DJfn8hvpgmOexeQaL0KbqJXbiKepJFbk0a+ pbGbSbSoJukecfW7IgvcsPFIL3SQ2Qv8vAMldvn/8uibLPMMJwsrtn4LCBqgHWamQ/oD aeFYq19bQJ6jhydqi15EbXF0qAM9euJFwd+J9GZq5eJmfdNrhMpw37CbxrFbBPMYm2J+ AHtApdnzU2YqdywXbw21GX/QW9zgCwOP1xH1fp7l70PgbZ+R2ZhfPvgACMCdDAd8lg/b K/G+GaYRpsh0OkCRDGBVJJrL5FFlY+5IqfBnI/sKFtp4CocgGqEczDRv6dpweyGT1Lv1 xIOg== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1796372713; s=strato-dkim-0002; d=hartkopp.net; h=In-Reply-To:From:References:Cc:To:Subject:Date:Message-ID:Cc:Date: From:Subject:Sender; bh=sIoq2rL08X0sIQFPq+/IcjvgAiWhwqcf0xHnPqsdYNQ=; b=XE32gSGLz6v6Re7EDwWgCpFGDbUaz6r03cUUuaZQ9E0BrqZfZHCNML7OdGM7WvSqbG G6+M7lWMqqgdZA4ZTBhe1Ns8E5OfsXlXVwgTUqejIkJRh0G4XNw+WahHD+0c6YlSFCdK km4/9uOknhKYmI/SMhl9T92/2RN0JxwSxQHPWvbBy7xoI52xU2eWliTtQVgmhheB9cTs eaNKPhN75Xl4Nc9284nlKiCzsfAh5qFqrXpL5bdwzvPmrNPd16l0mcHL1JYASnKt54HI teix1zL6pw4m6ZOIF41tNPnf4NiyAn8KUbnvKpJTW4qbEUj0fDj+UutX77J2tZdjUy7P 0aXw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1796372713; s=strato-dkim-0003; d=hartkopp.net; h=In-Reply-To:From:References:Cc:To:Subject:Date:Message-ID:Cc:Date: From:Subject:Sender; bh=sIoq2rL08X0sIQFPq+/IcjvgAiWhwqcf0xHnPqsdYNQ=; b=knSz6xvfSHFNirlkqL9fhGhNDBM+oZ8oprkOk6sLIWbu/vxCZzCRzpG4Vr7jG3+dqh mDKUM8Bf1CFfKz6EylCA== X-RZG-AUTH: ":P2MHfkW8eP4Mre39l357AZT/I7AY/7nT2yrDxb8mjH4JKvMdQv2tTUsMrZpkO3Mw3lZ/t54cFxeEQ7s8bDup0Q==" Received: from [IPV6:2a00:6020:4a38:6810::989] by smtp.strato.de (RZmta 55.6.3 AUTH) with ESMTPSA id Kfdf2a2B48PDW81 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 4 Dec 2026 09:25:13 +0100 (CET) Message-ID: Date: Fri, 4 Dec 2026 09:25:08 +0100 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2] can: gw: reject frame format changes in UID updates To: Hungyu Lin , mkl@pengutronix.de Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org References: <20261204070726.53955-1-dennylin0707@gmail.com> Content-Language: en-US From: Oliver Hartkopp In-Reply-To: <20261204070726.53955-1-dennylin0707@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello Hungyu, On 04.12.26 08:07, Hungyu Lin wrote: > 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") Please add Cc: stable@vger.kernel.org here. > Signed-off-by: Hungyu Lin > --- > 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))) { I've looked into cgw_remove_job() where limit_hops is also checked to identify the gw job: if (gwj->flags != r->flags) continue; if (gwj->limit_hops != limhops) continue; Therefore I would suggest to be consistent in the UID update: if (gwj->flags != r->flags || gwj->limit_hops != limhops || memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw))) { > err = -EINVAL; > goto out_free_cf; > } Many thanks, Oliver