Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3474888rwa; Tue, 23 Aug 2022 05:29:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR6XhkS2D1mHNRqnPSmb+VGxoVWJGj2ECY2laC6LRptqgGuvvoF6azg9uiCiyRSQcOJDcu/T X-Received: by 2002:a65:5806:0:b0:429:f9a2:10ca with SMTP id g6-20020a655806000000b00429f9a210camr20048508pgr.541.1661257760394; Tue, 23 Aug 2022 05:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257760; cv=none; d=google.com; s=arc-20160816; b=rjWijJt9s5+CpercqWNfdTJc/mv5agXYOPgdXmtGDdXLvwpo12DMEITLRhOYu6TIer 3LCthLRLKQ0kzN6wILq7uaw0rqKijxL75T0N9qDofGe8KHDF3Rmill0mFM28o8W/xRdS Vg+DcnGtEonljKX+41YqbS40yBYWOX45s5dB5LuENprwrl6Blp/RWFwCUg7yKdxmuTHZ Or5aLoNjbxlwvxgtDNboPLgeOrpmVTTv9vOTMGAWiXdbGbnkxIFY+2PJYcCg1Fa1ZG9z AHTQIqXsh8ASfBx63qG24up0JCMbEHSZuhvmIXlcM4W9yc+CHwJt1Xh60DQDrnwuLqUn +s0Q== 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=BoHFA6FtpTCMC2IEsmwbZA0OEOTCzddzEPU7+buipIG7mJEq65hlUFg01ZodSW4lNd HxAz6IQeyTOXjTeXILXv/lxDVhGuxG4QDkhvih/uVlu2/ynRgGfWaMnbaAWRDmvMp06R 6kXy7RDB9JA5Pqn/U8NrAJILXxeh0I08qHzoUxSgA/Y3zC2Xm1RhOhx7tBKqXhXUC1It uiTmcneG4ysbREh0XliD+jWD8ISYQEre0+3T8op7FQNhkOpMOtbdVdBDH1WAq0DWBq3X lg++Y3BFdedzI3arBA8DIDO5UWa6mUXWLngBCI1PFFKWAnMPtmfLsA6F2my6VA1wobA5 oIeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SmkyS7T3; 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 g21-20020a635215000000b0041bfb11f138si15640857pgb.442.2022.08.23.05.29.09; Tue, 23 Aug 2022 05:29:20 -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=SmkyS7T3; 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 S1353856AbiHWK3P (ORCPT + 99 others); Tue, 23 Aug 2022 06:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353263AbiHWKNP (ORCPT ); Tue, 23 Aug 2022 06:13:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 980BC72842; Tue, 23 Aug 2022 01:59:19 -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 441EEB81C28; Tue, 23 Aug 2022 08:59:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94A3BC433D6; Tue, 23 Aug 2022 08:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245157; bh=ou72801z8mN71VTlq2a6SZCJ4zfndl7r4LyeKMh+suU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SmkyS7T3PQZjmrucbx+rGwUNxj2WcSYmvIrhGZzrz00hY/mxkQp8pIQeQd2Fg+bhy D4QIB0eD1NWRUBKtsYGxk0lb3+5qHTX/ykcUYj0bdXRSQiljFfKCXgulpQqlvJXB1l 39ny+vrJwSpp9CjYyvNt7ymauEen2BgierlRkhsw= 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.15 234/244] can: j1939: j1939_sk_queue_activate_next_locked(): replace WARN_ON_ONCE with netdev_warn_once() Date: Tue, 23 Aug 2022 10:26:33 +0200 Message-Id: <20220823080107.372740096@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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 {