Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3296341rwa; Tue, 23 Aug 2022 02:12:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR5KctcwkzKDnEkNk5U1ZYB0+vx3J6o13O5YJ8XeevCrZtf+8s4PVMFjTk67hvhu8FVaNP3Q X-Received: by 2002:a17:907:2894:b0:73d:9072:ade5 with SMTP id em20-20020a170907289400b0073d9072ade5mr3552637ejc.2.1661245922311; Tue, 23 Aug 2022 02:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661245922; cv=none; d=google.com; s=arc-20160816; b=mjKXzvGzzMFxfVDDzbSxySpHEl/QZdZRTxf2EA0rdjpbpzNHx2/+uNLRUAykUj/R0X g/ONM3SXFmOf1zdby+NrE5lcW8G8mAqJ0DzZHNzK4tc1wEpFBFZdiCLX0onYFSHQbPeF GrRl8sclog0T1tNJ863OzPPnadFfUTEBhSqhFsOz2CrL5HYRI2zc1lT7TOyHWbFbGpGh jKbfsO5Z6mF27+8ZAm9ag0+BLVJpBY6cJqao9S6NIars+ZWf91cw25W4yIPUsx6T6rjr tuCVKca++hMeFPMSpxqccmdsRERlQB6ygVakG8wefOAIQR0XKUUj0grmVioUyNium8T5 5upg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s23brktr9ikEIIY/Vsl904cpGAtQTMlrmtOeDAF0cy8=; b=EkT+R8TM8AU2S/w/6DP71EAyt5HjrMsNBIL3EPlUbUNwOh3ry3+Sego8H3hxtrdNdR FRV9/YxYPJlleAzwD2r9yrTQ0NYbDKsi12KJ0CYf8WPqdOwTaK7LiLSx6ynetSL02j8J DjZebTu4sJj/AIo83Bpw9jaRrrOxhOTyLZ/3yvqvqsi6tojfVMb+xnXrOv7JCj3EMOKC EIXdZ6ekc6bpyeARfYjHBjRt3z1j/aAgg35Uskpfg7tXmJB4qImCT711wi8tSezWlUgf 6u1GFr+wiICAVa6B9qAj77Ec7P3J84Eetjir47Lhk4QdY8yzhxRBRL/XPbfl9Zd60S3p FgEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0vYkN+9E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne16-20020a1709077b9000b0073123a3bea1si12720984ejc.532.2022.08.23.02.11.34; Tue, 23 Aug 2022 02:12:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0vYkN+9E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240547AbiHWJIT (ORCPT + 99 others); Tue, 23 Aug 2022 05:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347930AbiHWJG5 (ORCPT ); Tue, 23 Aug 2022 05:06:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 457BB83F1C; Tue, 23 Aug 2022 01:30:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C07D8B81C4D; Tue, 23 Aug 2022 08:28:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 234CAC433D6; Tue, 23 Aug 2022 08:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243322; bh=ou72801z8mN71VTlq2a6SZCJ4zfndl7r4LyeKMh+suU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0vYkN+9ES34B8KQE21bpiZ04ONYTuAharV2cJVAHq4JyXreOkWHNjmPcSaDRZKole Apds4kGt8rz2EimGUg4wi2H5zbfM8J+KUV/dnl77bKxeSthkorN6whkRN+vk/+Hk13 vwLQpZj6Ezjd/aDa0W0lrDHpQs8s9reEKKZOkr7g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fedor Pchelkin , Alexey Khoroshilov , Oleksij Rempel , Marc Kleine-Budde Subject: [PATCH 5.19 241/365] can: j1939: j1939_sk_queue_activate_next_locked(): replace WARN_ON_ONCE with netdev_warn_once() Date: Tue, 23 Aug 2022 10:02:22 +0200 Message-Id: <20220823080128.319300150@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fedor Pchelkin commit 8ef49f7f8244424adcf4a546dba4cbbeb0b09c09 upstream. We should warn user-space that it is doing something wrong when trying to activate sessions with identical parameters but WARN_ON_ONCE macro can not be used here as it serves a different purpose. So it would be good to replace it with netdev_warn_once() message. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Fedor Pchelkin Signed-off-by: Alexey Khoroshilov Acked-by: Oleksij Rempel Link: https://lore.kernel.org/all/20220729143655.1108297-1-pchelkin@ispras.ru [mkl: fix indention] Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- net/can/j1939/socket.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/net/can/j1939/socket.c +++ b/net/can/j1939/socket.c @@ -178,7 +178,10 @@ activate_next: if (!first) return; - if (WARN_ON_ONCE(j1939_session_activate(first))) { + if (j1939_session_activate(first)) { + netdev_warn_once(first->priv->ndev, + "%s: 0x%p: Identical session is already activated.\n", + __func__, first); first->err = -EBUSY; goto activate_next; } else {