Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp945719pxp; Wed, 16 Mar 2022 22:12:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCQS5vUYJHClnlww3GssiqF2+keFlorFeqRlJhNQBFrRPO9a15ugqek6vxGg2TJMw+wsvd X-Received: by 2002:a63:d64d:0:b0:374:6edc:989c with SMTP id d13-20020a63d64d000000b003746edc989cmr2296987pgj.434.1647493977677; Wed, 16 Mar 2022 22:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647493977; cv=none; d=google.com; s=arc-20160816; b=Fepa8pgeaAzWIlgzIVenQt+ZmyCBLoK03Ya1vQRYM7vjOk3xJwiPiY+0qaPkEU4iqK 5nznpBckch0bdMzVZr3nSBOnB9FfOKdbeg+ZwAxnWhlB55noxhueNUKP0Cq2+qzVNc+W wy5l4rS78wKI3iC2MinIFVfrQ3KnqcNz2/Uciu38xSMAiDc9meNPrlxOI+UVdORVUA9e HMEw07EEvsrqdbcw93A00f7KMcY4y0l8/Y7+qwVZd+79HtCNg9rJDieUT/IXIJIfbI18 tmZvfaRddXsY6XUpBSFPxQchC5u3w3g4C1DfjJvJ9x3KvEZATS3y2ZPMH2+uOMhK95gx xHFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=V8OovhUTk+uLoFoj0yWXfpzsmTBldvtbdNMFWWe8zKE=; b=qTz6lP3YlK9fI+wXrUmTfb6Owl4HZm2pketfCwPNivNlIJtVY5J13bl77cpZI758ZE DXKn2QoVxzLGFm+lSmksvRrqzMKB1w1XK1Zul3jXrf8coQhpAolQjIWYqWO8DmjfblJ5 hnoBl5ANpLtGfQMDwx84J+TDo07CCSV4mG/S8Nx5npqBUodXiq0SE88WFEW4m/kqRh18 IM/pLELZ4tUzEhMWkj5LNSBSL2b/tsfdp926GshcncAto1Islf2C5XzmOVsYE4OOUOO6 75GwE6NPtPK0q8/KDCp33N7966ReWeCfQXuA6mxDJZLX/LzrbnyIU9DxTBDYJ+mczlXp 7k/w== 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: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 u17-20020a627911000000b004f6cf0f409asi3616292pfc.156.2022.03.16.22.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:12:57 -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; 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 3F49D1DCCED; Wed, 16 Mar 2022 21:22:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245436AbiCNWB7 (ORCPT + 99 others); Mon, 14 Mar 2022 18:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245425AbiCNWB5 (ORCPT ); Mon, 14 Mar 2022 18:01:57 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE3B63BF95 for ; Mon, 14 Mar 2022 15:00:47 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTsk7-0002oU-No; Mon, 14 Mar 2022 23:00:43 +0100 Received: from pengutronix.de (2a03-f580-87bc-d400-6399-440a-c2a2-bdf7.ip6.dokom21.de [IPv6:2a03:f580:87bc:d400:6399:440a:c2a2:bdf7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 7614A4B406; Mon, 14 Mar 2022 22:00:42 +0000 (UTC) Date: Mon, 14 Mar 2022 23:00:42 +0100 From: Marc Kleine-Budde To: Vincent Mailhol Cc: Max Staudt , Wolfgang Grandegger , linux-can@vger.kernel.org, Oliver Neukum , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby Subject: Re: [PATCH v3] can, tty: elmcan CAN/ldisc driver for ELM327 based OBD-II adapters Message-ID: <20220314220042.vpicmcrwvexxwk3c@pengutronix.de> References: <20220307214303.1822590-1-max@enpas.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3ycyvbpbhbranjzf" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 --3ycyvbpbhbranjzf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 08.03.2022 16:01:12, Vincent Mailhol wrote: > > +/* Send a can_frame to a TTY. */ > > +static netdev_tx_t elmcan_netdev_start_xmit(struct sk_buff *skb, > > + struct net_device *dev) > > +{ > > + struct elmcan *elm =3D netdev_priv(dev); > > + struct can_frame *frame =3D (struct can_frame *)skb->data; > > + > > + if (skb->len !=3D sizeof(struct can_frame)) > > + goto out; >=20 > Isn=E2=80=99t this aleardy guaranteed by the upper layers? You can always inject packets via the packet socket into the kernel, bypassing e.g. the CAN RAW layer. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --3ycyvbpbhbranjzf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmIvuwcACgkQrX5LkNig 011hxQf/RQ/sycT5AgFovH7C118vWmXWvYLZt9R+LGEiU/9AfY3b3IChu/WIVZBJ ZbdnY7Wb9l/KVBGE7KTnpeUNdX3qwgQ4Xfbt+9eFUCFqEyAzUzWgN92NyVDlR3R2 JOowtZ30+EdcjRSGJ5CHOp/VWS4Flc7gHYfLWvC+ef5+IIN3xL47jcD8PjKgvC30 dNLfkxkt2YZo1niaUSNnD49vUqMHin7YDbpgNGv85iYQG0Iz2YU6ORUqCsgoaxd4 nGYj3ImRUFOxxu+c7cMBq7injzXVJlAnci6FIUAoOdmsy8cleNmoz1J6X5d2m+qu f1UX3f1r6274L20mKBLVKACSdPCp2g== =H7ZN -----END PGP SIGNATURE----- --3ycyvbpbhbranjzf--