Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1643031pxb; Thu, 28 Oct 2021 07:30:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyarTHbU+UAk6khiC5rDHu5uyhDEp0dJAa5Yn7oQnNudQkfZdXXDNFvDYtCosS0hTqyXixm X-Received: by 2002:a17:902:8b81:b0:13f:3d30:f624 with SMTP id ay1-20020a1709028b8100b0013f3d30f624mr4245339plb.51.1635431402602; Thu, 28 Oct 2021 07:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635431402; cv=none; d=google.com; s=arc-20160816; b=SXEfb44VBUWQQqJInLWVPRuWSw+mKhUK/VlJ6EuP8j0VsVa/KsPyGkE+TtQYDsPtsX HImOFveKVtHnqr5nVucCXLTOQEshqUbQBGP/O0e5a1xYmGCNuktLUo0QrH0CmHsfdUxm XOZSjRy/LASPAfa8qf+XXXI8A8yJPV4EnMBsjah5c/G+TTQWe/c0dN7AMZFPDLKF3Lzv UyYOUvQkh8EOKwfLKjzfdxg6OPZxNtYOP2hM4k/UhkYG/owu2C0JNM6bP/CW7dRj9AT6 tjJSdfvxfgbYCqmRMPZxPAEddlrtFRTXoN16WCE8jy3H1jO1RIMTFFP4EigSMrSjUq+l 0a3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=AF3+Ctm+dfI9LtvR8qkNoNXyN1qkUByIWK/gSHIXFkk=; b=B9cP7c/GP4LSegNiApWRosqvn6cGsiASCYTfn9LB5VS9J3EQ4pbM+VoPS9AtlnRwMt ZCua5PwM/ebWyApmtdSJNL0RvZ1UwrSdjFyh11/fuX9onKr5U6pPiJDXPNtQQmv8eAkm SX1UGXXGsRVR7xSdxGcyKjUxyY2lxf/gNySRuvVDI6fFnEnUZ8su6SLO3LZyRJD8TBrZ 4YxPVQc3XQVmfrZFKbCyt0Jenh4LhX5t3/Ynpgqm2gT8Yoyk3/WDhTTBePspVZfQ52Dw WdHZpMTAwg+Q1Xpat2BEQNlJ091eDeYe3wC9gPCKw6xv4p2P23RSb14FpJfRuNFzHeBD PEeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j27si2439233pgn.389.2021.10.28.07.29.49; Thu, 28 Oct 2021 07:30:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231311AbhJ1O3p (ORCPT + 99 others); Thu, 28 Oct 2021 10:29:45 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:13986 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230258AbhJ1O3m (ORCPT ); Thu, 28 Oct 2021 10:29:42 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Hg7BF4GHhzZcW8; Thu, 28 Oct 2021 22:25:09 +0800 (CST) Received: from dggpeml500006.china.huawei.com (7.185.36.76) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 28 Oct 2021 22:27:06 +0800 Received: from compute.localdomain (10.175.112.70) by dggpeml500006.china.huawei.com (7.185.36.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 28 Oct 2021 22:27:06 +0800 From: Zhang Changzhong To: Robin van der Gracht , Oleksij Rempel , , Oliver Hartkopp , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski CC: Zhang Changzhong , , , Subject: [PATCH net v2 1/3] can: j1939: j1939_tp_cmd_recv(): ignore abort message in the BAM transport Date: Thu, 28 Oct 2021 22:38:25 +0800 Message-ID: <1635431907-15617-2-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635431907-15617-1-git-send-email-zhangchangzhong@huawei.com> References: <1635431907-15617-1-git-send-email-zhangchangzhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500006.china.huawei.com (7.185.36.76) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch prevents BAM transport from being closed by receiving abort message, as specified in SAE-J1939-82 2015 (A.3.3 Row 4). Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Zhang Changzhong --- net/can/j1939/transport.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c index 6c0a0eb..05eb3d0 100644 --- a/net/can/j1939/transport.c +++ b/net/can/j1939/transport.c @@ -2085,6 +2085,12 @@ static void j1939_tp_cmd_recv(struct j1939_priv *priv, struct sk_buff *skb) break; case J1939_ETP_CMD_ABORT: /* && J1939_TP_CMD_ABORT */ + if (j1939_cb_is_broadcast(skcb)) { + netdev_err_once(priv->ndev, "%s: abort to broadcast (%02x), ignoring!\n", + __func__, skcb->addr.sa); + return; + } + if (j1939_tp_im_transmitter(skcb)) j1939_xtp_rx_abort(priv, skb, true); -- 2.9.5