Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1018682iob; Fri, 13 May 2022 19:50:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7LW2aXLGbgXTYHfCWrcg7CgDAXSViUaDBorOQPteyxNlIxTGhyXUosufRzYbOSCRBlZnd X-Received: by 2002:a05:600c:ad1:b0:38c:8bf6:7d6b with SMTP id c17-20020a05600c0ad100b0038c8bf67d6bmr7199441wmr.84.1652496636118; Fri, 13 May 2022 19:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652496636; cv=none; d=google.com; s=arc-20160816; b=hQVOugW9UoKOfDe9qhToazSt+vJHyBN1GOnKcZ2L/htbT4ZvPXaw5dxUL3T1PBW+u+ ehhxXH/84Bxj6vLEpZCaDh5Si9FX6W4hK6vA93xrtU0K4d6Ow+DloxAn5B9CSRXtHLIt 82aAEDABaGu0OD6xbNIkvLOKbEnNvKrGQD6pm1Qj8ePhoX2wsRQsrMusvPNkhGx2Wv1s TnP/cYCa72tgfe2zxYX8Gg4Vdx8wOlvun+X9XFY3NV0Nj6Qg2PatjhwZWwhz5RFVF1DS hLGV+ICvfI9tkYjLBPGi/TG0oTWPzZk4GQgaPTzb+CEyksruYav3qOH4fa47qKk4JQgi kiHA== 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 :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=DSFVvtb25vaSMEJHnBVUCbV3FpLzvNN+SMPfTZx1ihA=; b=XNCO9nmvU+ahD2+l2P3dC5MGiELv1cHLIhJqIr5YZ7eT+IaCwEKHw6j6r7atuJc96L +cabQF37QfsKl0ePEDEEFDF0cmJI3eujvUeP41trR6z6pLwlUXHHwvLwfw/QVLbW5LT6 ka/ATtwqAmYWUzJ4vHHZ/ddt0RkViDRZecpPnhILQ/8v+4H36T8rTjrsn/RfplPmrbtM MdIzMXufPcbW5VR3esasMNuUzldoqbvz+in28cMsPMv0wcb7pIuCWllYXhK5eJC6lDij M9+djD9Ca/RMQa4OAgmv0NZl8BEWTB2ltJNeBFTPQfVF/sC/xokJfwMTdza4RT0pV9Jy 0s9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qp2pxaTy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b4-20020adfee84000000b0020ca2ec5bc8si3509047wro.496.2022.05.13.19.50.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:50:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qp2pxaTy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 250B73746C4; Fri, 13 May 2022 16:37:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355443AbiEMOYW (ORCPT + 99 others); Fri, 13 May 2022 10:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355218AbiEMOYU (ORCPT ); Fri, 13 May 2022 10:24:20 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62EE55047F; Fri, 13 May 2022 07:24:19 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id x8so4222242pgr.4; Fri, 13 May 2022 07:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DSFVvtb25vaSMEJHnBVUCbV3FpLzvNN+SMPfTZx1ihA=; b=qp2pxaTyYctTFWdpw9JQdQ3QXnRJeCkCFg4wEMX0q9mrELp8Q3U2hFOfksh/v2G6wv L66zZ/6JenJwKeyBZn/ABvCbA4ej2zaBfz0H3eBuxdjpd7+F3B60Rf9j9MkH8Xjbxqty iwteSrHoYBgFuOR2x+p0JVGRrLt2aOnzaLRt8lNMgzOaRDRnvWlKBi29ys9x8r3Mgekh QBUfqpaZ6poYs3K6Shk41nqil7NRlYV2t0b5CpjIKAOf6hwTWTb0BTZVWAYTQukEFB7u o69keVEw3T6yXdtOZspZh4R05hxFVO8kL58fvMviqKGsFD/qFjJhDIf8+ikjO22KR61u e1QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=DSFVvtb25vaSMEJHnBVUCbV3FpLzvNN+SMPfTZx1ihA=; b=vkJx9XJtokCFz3MTSsBACOGDOJOkL964N3XqqwqerhotNqAapkm6Azjv2pU3UfBTU8 utL65RfEaWBxDNK2hrg5ZWeK9P9lIVGEJ/j4gFDct0PPFHtwsSQRQr3xiYhhmVb6ZHG8 dcAGMr6CUn/OzrE99gYaLtyUjYdwnARV9OedyH1lbVUXt8uDcFPh29/BJHNSfoJ3FMK9 bjoT1FCeAkGKOLcAPRT9yfJxRIBhDWnOUXsoUq8p9C4Ewa2sxzji1Y0nXsQR/3MWXbDQ XCj+WTr6O0DJWwjDDTTzY4STx4HaE5yfpem7BGUQW45Jubd+aY+NAhjTfSBpkLstEqaa gFnA== X-Gm-Message-State: AOAM533dBdpMeCMUg++M0D9wWFBtPhEO//7XtdvDb8kOqrXYNv/IbQJv Z6bwoXibBkx7/Rj1mCEtVpQ= X-Received: by 2002:a63:6c8a:0:b0:3ab:8c07:4d93 with SMTP id h132-20020a636c8a000000b003ab8c074d93mr4259567pgc.431.1652451858778; Fri, 13 May 2022 07:24:18 -0700 (PDT) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id jj10-20020a170903048a00b0015e8d4eb2ccsm1684488plb.278.2022.05.13.07.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 07:24:18 -0700 (PDT) Sender: Vincent Mailhol From: Vincent Mailhol To: Marc Kleine-Budde Cc: linux-can@vger.kernel.org, linux-kernel@vger.kernel.org, Max Staudt , Vincent Mailhol Subject: [PATCH 0/2] can: drop tx skb if the device is in listen only mode Date: Fri, 13 May 2022 23:23:53 +0900 Message-Id: <20220513142355.250389-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 In listen only mode, tx CAN frames can still reach the driver if injected via the packet socket. This series add a check toward CAN_CTRLMODE_LISTENONLY in can_dropped_invalid_skb() to discard such skb. The first patch does some preparation work and migrates can_dropped_invalid_skb() from skb.h to dev.h. The second and last patch is the actual change. Vincent Mailhol (2): can: move can_dropped_invalid_skb from skb.h to dev.h can: dev: drop tx skb if in listen only mode include/linux/can/dev.h | 35 +++++++++++++++++++++++++++++++++++ include/linux/can/skb.h | 28 ---------------------------- 2 files changed, 35 insertions(+), 28 deletions(-) -- 2.35.1