lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 8 Mar 2016 12:48:50 +0000
From:	Ramesh Shanmugasundaram <ramesh.shanmugasundaram@...renesas.com>
To:	Oliver Hartkopp <socketcan@...tkopp.net>,
	Marc Kleine-Budde <mkl@...gutronix.de>,
	"wg@...ndegger.com" <wg@...ndegger.com>,
	"robh+dt@...nel.org" <robh+dt@...nel.org>,
	"pawel.moll@....com" <pawel.moll@....com>,
	"mark.rutland@....com" <mark.rutland@....com>,
	"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
	"galak@...eaurora.org" <galak@...eaurora.org>,
	"corbet@....net" <corbet@....net>
CC:	"linux-renesas-soc@...r.kernel.org" 
	<linux-renesas-soc@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"geert+renesas@...der.be" <geert+renesas@...der.be>,
	Chris Paterson <Chris.Paterson2@...esas.com>
Subject: RE: [PATCH v2] can: rcar_canfd: Add Renesas R-Car CAN FD driver

Hi Oliver,

Thanks for the comments.

> On 08.03.2016 09:57, Ramesh Shanmugasundaram wrote:
> 
> >
> > As you mentioned further down, when a user does this
> >
> > "ip link set can0 up type can bitrate 1000000"
> >
> > the intention is to put the controller in CAN 2.0 mode. Even if we use a
> status flag or copy the data bitrate equal to the nominal bitrate, what
> would it achieve? It still cannot be a CAN 2.0 node - it is a CAN FD node
> configured with same nominal & data bitrate.
> >
> > This is why I have this check in ndo_open, so that the user is aware it
> is a CAN FD node always and avoid misconfiguration like above with
> EOPNOTSUPP.
> >
> 
> ok - got it now.
> 
> In fact you provided a CAN driver which is "CAN-FD-only".

Yes. That's the status of current submission.

> We did not had that before but there's a solution for this kind of setup.
> 
> There is a similar case with CAN_CTRLMODE_FD_NON_ISO we had on the M_CAN
> driver which only provides non-ISO configuration for the supported IP core
> and _no_ option to _change_ this value:
> 
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id
> =6cfda7fbebe8a4fd33ea5722fa0212f98f643c35
> 
> If you would do it similar in rcar_canfd.c with
> 
> /* CAN_CTRLMODE_FD is fixed with R-Car CAN FD */
> priv->can.ctrlmode = CAN_CTRLMODE_FD;
> 
> and remove CAN_CTRLMODE_FD from the priv->can.ctrlmode_supported
> assignment then it should do the entire configuration process correctly
> for you.
> Including the proper tests for the two bitrates.
> (see open_candev() in linux/drivers/net/can/dev.c)
> 
> Right?

I did try this option earlier but there are two problems with this method.

1) Below configuration is not possible

ip link set can0 up type can bitrate 1000000 dbitrate 1000000 fd on

"fd on" -> This is not allowed because CAN_CTRLMODE_FD bit is not set in ctrlmode_supported.

2) If I ignore "fd on", my interface MTU stays as CAN_MTU only. If I have to change the MTU alone to CANFD_MTU using another netlink message, it again checks ctrlmode_supported where it would fail. I have the option of providing my own change_mtu function & ignore this check but two configuration messages are required for my driver alone :-(.

Both these anomalies are addressed with the current check I have. 

Thanks,
Ramesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ