Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp591149imn; Thu, 28 Jul 2022 09:48:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sCmcqcdltJJaMIUb0wMyZfDpaVeYxDsQRYA/UKyPpINjSgYripvBdgeDgzVdkDHDgI8e+2 X-Received: by 2002:a63:db09:0:b0:41b:6744:a255 with SMTP id e9-20020a63db09000000b0041b6744a255mr3051708pgg.556.1659026911938; Thu, 28 Jul 2022 09:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659026911; cv=none; d=google.com; s=arc-20160816; b=mEVpC0t9PQtodODesMGc1D06PFb55It3cjqih+1PkOAAJiA28ZwLs9MrOsMqQdzygJ 0vvBpjSrLU+4VyINrEMekGaY/vR9akX0UVAtnkV6CuVCJne4r/Pg+wHrxC5ATjcMM+yT /RR67IFH/1e2jTr0chYd+G+nfkENSNcF1WfxBwHwLe/aXJ8npPln9YZDoIf/cc0Vdcxh 7fD1SlIT5PCdfdHxxoT5XAv6zwPWB6JESmefL1wxlWaXwIX+psNf8ClED6uMl8MMzMK7 mHU8KVDzczKUSp3mxLWxxD9So49+f1+mQJlPM8ZNii6dbSZTHO1eocWWX9VZL8n5NtKp rC/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=yvteC71ZRQT6w6FjCYT1X8Bv9y12WD9IgWGLonMMEoM=; b=xAc6Gse9ry8tbPERNLyKCnUOYZZt0HKS5+DStBuaniI69uS2TkG+fzIgEmC4HyhEzP yU++qATuMcvBi0TMNdOWmS8FYSEi928UGWS+K6NYf1ZB21yLoAKwymzDxjITDl2BxPUm roJ+Xz0TZ57oYWLo69z03Ofnn0gezTKW2IkFQ3oCPom09cKJEnnQlw2EhId5aliBYeS+ nqwoBleb6HiN39IAVEfPGzhbzSEeeqnUdPawh8tumROyajiBHdIG1NfnVmBkbEGrSFiu aOUvo23AJpOEDv1DDIhCyfOFgcNJSk6ggEfjzD9c9S6oWJU8anpWNpPy5tcf0rW6x8if 3Baw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k62-20020a17090a14c400b001f28dc085bfsi5231811pja.115.2022.07.28.09.48.16; Thu, 28 Jul 2022 09:48:31 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233288AbiG1QPO (ORCPT + 99 others); Thu, 28 Jul 2022 12:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232868AbiG1QOu (ORCPT ); Thu, 28 Jul 2022 12:14:50 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C01176E2F8; Thu, 28 Jul 2022 09:14:47 -0700 (PDT) Received: from [10.10.132.125] (unknown [83.149.199.65]) by mail.ispras.ru (Postfix) with ESMTPSA id A658240737CF; Thu, 28 Jul 2022 16:14:43 +0000 (UTC) Message-ID: <7ea40c0e-e696-3537-c2a4-a8eccf4695d0@ispras.ru> Date: Thu, 28 Jul 2022 19:14:43 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] can: j1939: Remove unnecessary WARN_ON_ONCE in j1939_sk_queue_activate_next_locked() Content-Language: en-US To: Oleksij Rempel Cc: Robin van der Gracht , Oleksij Rempel , Pengutronix Kernel Team , Oliver Hartkopp , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , Elenita Hinds , Kurt Van Dijck , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , ldv-project@linuxtesting.org References: <20220720110645.519601-1-pchelkin@ispras.ru> <20220720191357.GB5600@pengutronix.de> From: Fedor Pchelkin In-Reply-To: <20220720191357.GB5600@pengutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS 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 Hello Oleksij, I'm sorry for late answering. On 20.07.2022 22:13, Oleksij Rempel wrote: >> Are you working on some system where this use case is valid? No, we are fuzzing the kernel and analyzing different warnings and crashes. On 20.07.2022 22:13, Oleksij Rempel wrote: > yes Well, there is a long story about where and for which purposes the kernel warning macros should be correctly used and, overall, WARN_ON_ONCE is not intended for user-space notification. Linus Torvalds wrote: > WARN_ON() should only be used for "This cannot happen, but if it does, > I want to know how we got here". > > So if that j1939 thing is something that can be triggered by a user, > then the backtrace should be reported to the driver maintainer, and > then either > > (a) the WARN_ON_ONCE() should just be removed ("ok, this can happen, > we understand why it can happen, and it's fine") > > (b) the problem the WARN_ON_ONCE() reports about should be made > impossible some way > > (c) it might be downgraded to a pr_warn() if people really want to > tell user space that "guys, you're doing something wrong" and it's > considered a useful warning. So WARN_ON_ONCE should be replaced with a more gentle variant - I think pr_warn_once would suit this case. I've prepared a new patch for that, it will follow this email. Could you also look at the patch - [PATCH] can: j1939: fix memory leak of skbs - which I sent you on 08.07.2022, please?