Linux-Can Archive on lore.kernel.org
 help / color / Atom feed
From: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
To: Marc Kleine-Budde <mkl@pengutronix.de>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	linux-can@vger.kernel.org
Cc: "Vincent Mailhol" <mailhol.vincent@wanadoo.fr>,
	kernel@pengutronix.de,
	"Stéphane Grosjean" <s.grosjean@peak-system.com>
Subject: Re: [net-rfc 04/16] can: dev: can_get_len(): add a helper function to get the correct length of Classical frames
Date: Wed, 21 Oct 2020 09:52:26 +0900
Message-ID: <20201021005226.2727-1-mailhol.vincent@wanadoo.fr> (raw)
In-Reply-To: <a9605011-2674-dc73-111c-8ebf724a13ac@hartkopp.net>

>> Some professional tools such as the CAN testing suite of Defensics by
>> Synopsys also include these kind of tests. Because Socket CAN does not
>> support this, Synopsys actually recommends to use the proprietary
>> drivers from the Peak controller which do allow this (unfortunately,
>> the Defensics documentation is not available publicly so I can not
>> give you a link to support my claim on that last example).
> 
> Stephane from PEAK is working on the Linux driver (Mainline Linux & PEAK 
> chardev), so I put him on CC. Or are you referring to the Windows driver?

Good question. As far as I remember, the PEAK Windows driver and the
PEAK Linux char driver shares the same API and as such Defensics
supports both through a python middleware (the injector). This is only
true for Classical CAN. For CAN-FD, only Windows driver are officially
supported but hacking Defensics's injector code to have it run on
Linux is easily done (but that not the topic so let me end the
digression here).

>> I hope that I could highlight in this answer that I am more than just
>> a hobbyist who got exited after ready the ISO and that I know this
>> subject. What I explain here is well known in the niche community of
>> automotive security researcher but outside of it I just think that
>> people are not aware of it.
> 
> Well I have done a lot in automotive CAN security too - with message 
> authentication and with CAN IDS - but this DLC thing was still new to me ...

I also worked on CAN IDS. I was Japan regional FAE for the CycurIDS
product of Escrypt. Speaking of that, I believe you probably know Jan
Holle.

>  From a first thought I would see a new flag CAN_CTRLMODE_RAW_DLC in the 
> netlink interface of IFLA_CAN_CTRLMODE for the CAN controller driver.
> 
> This could switch the sanitizing AND the CAN controller can properly 
> expose its ability to support this mode.

Absolutely yes. In my first message, I mentioned the idea of managing
that through socket option, glad that we now share the same idea.

An other option I thought about would be to use one of the reserved
field of the struct can_frame but I am not fan of that second idea.

Do you want me to come back with an RFC patch? I already started to
thing about that months ago and did some testing. I identified the
code portion which have to be modified.

The only thing is that it will take me some time to draft a nice
proposal. Currently, I have another patch under review for a CAN
driver (https://lkml.org/lkml/2020/10/16/832), I want to finalize this
one first, and can get back to you after that. So that will mean that
we will be targeting Linux 5.11 end of this year, I do not think we
can squeeze that change in 5.10 merging windows.

> I think I have to pick a beer and look at some code ... :-)

Have a nice one! That might have been a shock for you :-)


Yours sincerely,
Vincent Mailhol

  parent reply index

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 19:05 [RFC]: can 2020-10-19 Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 01/16] can: proc: can_remove_proc(): silence remove_proc_entry warning Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 02/16] can: rx-offload: don't call kfree_skb() from IRQ context Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 03/16] can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard " Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 04/16] can: dev: can_get_len(): add a helper function to get the correct length of Classical frames Marc Kleine-Budde
2020-10-19 20:35   ` Oliver Hartkopp
2020-10-20  6:35     ` Marc Kleine-Budde
2020-10-20 11:30       ` Vincent Mailhol
2020-10-20 11:48         ` Marc Kleine-Budde
2020-10-20 12:38         ` Oliver Hartkopp
2020-10-20 15:02           ` Marc Kleine-Budde
2020-10-20 16:07           ` Vincent Mailhol
2020-10-20 17:04             ` Oliver Hartkopp
2020-10-20 18:50               ` Marc Kleine-Budde
2020-10-21  0:52               ` Vincent Mailhol [this message]
2020-10-21  6:23                 ` Vincent MAILHOL
2020-10-21  7:11                   ` Joakim Zhang
2020-10-21  7:21                     ` Marc Kleine-Budde
2020-10-21  7:48                       ` Joakim Zhang
2020-10-21  9:21                   ` Oliver Hartkopp
2020-10-21  9:48                     ` Oliver Hartkopp
2020-10-21 11:55                     ` Vincent MAILHOL
2020-10-21 17:52                       ` Oliver Hartkopp
2020-10-22  3:30                         ` Vincent MAILHOL
2020-10-22  7:15                           ` Oliver Hartkopp
2020-10-22 12:23                             ` Vincent MAILHOL
2020-10-22 13:28                               ` Oliver Hartkopp
2020-10-22 15:46                                 ` Vincent MAILHOL
2020-10-22 17:06                                   ` Oliver Hartkopp
2020-10-23 10:36                                     ` Vincent MAILHOL
2020-10-23 16:47                                       ` Oliver Hartkopp
2020-10-24  5:25                                         ` Vincent MAILHOL
2020-10-24 11:31                                           ` Oliver Hartkopp
2020-10-19 19:05 ` [net-rfc 05/16] can: dev: __can_get_echo_skb(): fix the returned length of CAN frame Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 06/16] can: can_create_echo_skb(): fix echo skb generation: always use skb_clone() Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 07/16] can: j1939: j1939_sk_bind(): return failure if netdev is down Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 08/16] can: isotp: Explain PDU in CAN_ISOTP help text Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 09/16] can: isotp: enable RX timeout handling in listen-only mode Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 10/16] can: ti_hecc: add missed clk_disable_unprepare() in error path Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 11/16] can: xilinx_can: handle failure cases of pm_runtime_get_sync Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 12/16] can: peak_usb: fix timestamp wrapping Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 13/16] can: peak_canfd: fix echo management when loopback is on Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 14/16] can: mcp251xfd: mcp251xfd_regmap_crc_read(): increase severity of CRC read error messages Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 15/16] can: mcp251xfd: mcp251xfd_regmap_nocrc_read(): fix semicolon.cocci warnings Marc Kleine-Budde
2020-10-19 19:05 ` [net-rfc 16/16] can: mcp251xfd: remove unneeded break Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201021005226.2727-1-mailhol.vincent@wanadoo.fr \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=s.grosjean@peak-system.com \
    --cc=socketcan@hartkopp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Can Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-can/0 linux-can/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-can linux-can/ https://lore.kernel.org/linux-can \
		linux-can@vger.kernel.org
	public-inbox-index linux-can

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-can


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git