On Tue 13 Jan 2021 at 00:29, kernel test robot wrote:
>
> Hi Vincent,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on linus/master]
> [also build test ERROR on v5.11-rc3 next-20210111]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
>
Hi Marc,
Thanks for the comments!
On Wed. 13 Jan 2021 à 18:33, Marc Kleine-Budde wrote:
>
> On 1/12/21 2:05 PM, Vincent Mailhol wrote:
> > This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from
> > ETAS GmbH (https://www.etas.com/en/products/es58x.php).
>
On Wed. 13 Jan 2021 at 21:15, Vincent MAILHOL
wrote:
>
> Hi Marc,
>
> Thanks for the comments!
>
> On Wed. 13 Jan 2021 à 18:33, Marc Kleine-Budde wrote:
> >
> > On 1/12/21 2:05 PM, Vincent Mailhol wrote:
> > > This driver supports the ES581.4, ES582.1 and
> length check, and returns CANFD_MAX_DLC (which is 0xf).
>
> Reviewed-by: Vincent Mailhol
> Link: https://lore.kernel.org/r/2021041930.693847-9-...@pengutronix.de
> Signed-off-by: Marc Kleine-Budde
> ---
> drivers/net/can/dev/length.c | 6 ++
> 1 file changed, 2
On Tue. 14 Jan 2021 at 17:23, Oliver Hartkopp wrote:
> On 14.01.21 02:59, Vincent MAILHOL wrote:
> > On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde wrote:
> >>
> >> If the length paramter in len2dlc() exceeds the size of the len2dlc array,
> >> we
> >
On Tue. 14 janv. 2021 at 01:04, Marc Kleine-Budde wrote:
>
> On 1/13/21 1:15 PM, Vincent MAILHOL wrote:
> >>> +/**
> >>> + * es58x_calculate_crc() - Compute the crc16 of a given URB.
> >>> + * @urb_cmd: The URB command for which we want to calculate the C
On Fri. 15 Jan 2021 at 02:23, Oliver Hartkopp wrote:
>
> Hi Vincent,
>
> On 12.01.21 14:05, Vincent Mailhol wrote:
> > This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from
> > ETAS GmbH (https://www.etas.com/en/products/es58x.php).
>
> (..)
>
>
On Fri. 15 Jan 2021 at 02:03, Oliver Hartkopp wrote:
> On 14.01.21 10:16, Vincent MAILHOL wrote:
> > On Tue. 14 Jan 2021 at 17:23, Oliver Hartkopp
> > wrote:
> >> On 14.01.21 02:59, Vincent MAILHOL wrote:
> >>> On Tue. 14 Jan 2021 at 06:14, Marc Kleine-Budde
ved to drivers/net/can/dev/dev.c in
below commit, please carry the patch forward.
Reference: 3e77f70e7345 ("can: dev: move driver related infrastructure
into separate subdir")
Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface")
Signed-off-by: Vincent Mailhol
After calling netif_rx_ni(skb), dereferencing skb is unsafe.
Especially, the canfd_frame cfd which aliases skb memory is accessed
after the netif_rx_ni().
Fixes: a8f820a380a2 ("can: add Virtual CAN Tunnel driver (vxcan)")
Signed-off-by: Vincent Mailhol
---
drivers/net/can/vxcan.c | 6
pters")
Signed-off-by: Vincent Mailhol
---
drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
index 61631f4fd92a..f347ecc79aef 100644
--- a/d
patch 2/3 (variable len was declared twice...)
Vincent Mailhol (3):
can: dev: can_restart: fix use after free bug
can: vxcan: vxcan_xmit: fix use after free bug
can: peak_usb: fix use after free bugs
drivers/net/can/dev.c | 4 ++--
drivers/net/can/usb/peak_usb/pcan_us
0120085356.m7nabbw5zhy7p...@hardanger.blackshift.org/
Changes since v1:
- fix a silly typo in patch 2/3 (variable len was declared twice...)
Vincent Mailhol (3):
can: dev: can_restart: fix use after free bug
can: vxcan: vxcan_xmit: fix use after free bug
can: peak_usb: fix use after free bugs
drive
After calling netif_rx_ni(skb), dereferencing skb is unsafe.
Especially, the canfd_frame cfd which aliases skb memory is accessed
after the netif_rx_ni().
Fixes: a8f820a380a2 ("can: add Virtual CAN Tunnel driver (vxcan)")
Signed-off-by: Vincent Mailhol
---
drivers/net/can/vxcan.c | 6
and Netlink interface")
Signed-off-by: Vincent Mailhol
---
*Remark for upstream*
drivers/net/can/dev.c has been moved to drivers/net/can/dev/dev.c in
below commit, please carry the patch forward.
Reference: 3e77f70e7345 ("can: dev: move driver related infrastructure
into separate subdir&q
pters")
Signed-off-by: Vincent Mailhol
---
drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
index 61631f4fd92a..f347ecc79aef 100644
--- a/d
On Wed. 20 janv. 2021 at 21:53, Marc Kleine-Budde wrote:
> On 1/20/21 12:41 PM, Vincent Mailhol wrote:
> > After calling netif_rx_ni(skb), dereferencing skb is unsafe.
> > Especially, the can_frame cf which aliases skb memory is accessed
> > after the netif_rx_ni() in:
>
Hi,
In addition to Marc’s comment, I also have security concerns.
On Fri. 22 Jan 2021 at 15:22, Su Yanjun wrote:
> When i debug mcp2518fd, some method to track registers is
> needed. This easy debug interface will be ok.
>
> For example,
> read a register at 0xe00:
> echo 0xe00 > can_get_reg
> c
ne is for FD frames.
>
> /* map the sanitized data length to an appropriate data length code */
> u8 can_len2dlc(u8 len);
can_len2dlc() might be renamed (e.g. can_get_fd_dlc()) if Example 1
solution is chosen.
> struct net_device *alloc_candev_mqs(int sizeof_priv, unsigned int
> echo_skb_max,
Yours sincerely,
Vincent Mailhol
On Mon. 9 Nov 2020 at 19:26, Oliver Hartkopp wrote:
>
> The extension of struct can_frame with the len8_dlc element and the
> can_dlc naming issue required an update of the documentation.
>
> Additionally introduce the term 'Classical CAN' which has been established
> by CAN in Automation to separa
patch-id tags seem to have been ignored.
FYI, I used the below command to generate the patch.
git format-patch --base=bff6f1db91e330d7fba56f815cdbc412c75fe163 -v6
-o patch/v6 HEAD~1
Yours sincerely,
Vincent Mailhol
> url:
> https://github.com/0day-ci/linux/commits/Vincent-Mailhol/ca
On Mon. 16 Nov 2020 at 03:55, Marc Kleine-Budde wrote:
> On 11/14/20 4:22 PM, Vincent Mailhol wrote:
> > This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from
> > ETAS GmbH (https://www.etas.com/en/products/es58x.php).
> >
> > Co-developed-by: Arunachala
between the kernel tx
software timestamp and the userland tx software timestamp).
Vincent Mailhol (1):
can: dev: add software tx timestamps
drivers/net/can/dev.c | 2 ++
1 file changed, 2 insertions(+)
--
2.26.2
the error queue in CAN RAW sockets (which is needed for tx
timestamps) was introduced in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eb88531bdbfaafb827192d1fc6c5a3fcc4fadd96
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 2 ++
1 file changed, 2
Hello Jeroen,
On Sun. 10 Jan 2021 at 20:29, Jeroen Hofstee wrote:
>
> Hello Vincent,
>
> On 1/10/21 11:35 AM, Vincent Mailhol wrote:
> > Call skb_tx_timestamp() within can_put_echo_skb() so that a software
> > tx timestamp gets attached on the skb.
> >
> [..]
>
between the kernel tx
software timestamp and the userland tx software timestamp).
v2 reflects the comments that Jeroen made in
https://lkml.org/lkml/2021/1/10/54
Vincent Mailhol (1):
can: dev: add software tx timestamps
drivers/net/can/dev.c | 2 ++
1 file changed, 2 insertions(+)
--
2.26.2
/lkml/2021/1/10/54
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 3486704c8a95..3904e0874543 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -484,6 +484,8 @@ int
between the kernel tx
software timestamp and the userland tx software timestamp).
v2 was a mistake, please ignore it (fogot to do git add, changes were
not reflected...)
v3 reflects the comments that Jeroen made in
https://lkml.org/lkml/2021/1/10/54
Vincent Mailhol (1):
can: dev: add software
/lkml/2021/1/10/54
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 3486704c8a95..850759c7677f 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -481,6 +481,7 @@ int
On Tue. 12 Jan 2021 at 02:11, Richard Cochran wrote:
>
> On Sun, Jan 10, 2021 at 09:49:03PM +0900, Vincent Mailhol wrote:
> > * The hardware rx timestamp of a local loopback message is the
> > hardware tx timestamp. This means that there are no needs to
On Tue. 12 Jan 2021 at 11:14, Richard Cochran wrote:
>
> On Tue, Jan 12, 2021 at 09:00:33AM +0900, Vincent MAILHOL wrote:
> > Out of curiosity, which programs do you use? I guess wireshark
> > but please let me know if you use any other programs (I just use
> > to write
and suppress the
comment related to SOF_TIMESTAMPING_TX_HARDWARE.
Reference:
https://lore.kernel.org/linux-can/2021071152.gb11...@hoboy.vegasvil.org/
Vincent Mailhol (1):
can: dev: add software tx timestamps
drivers/net/can/dev/skb.c | 2 ++
1 file changed, 2 insertions(+)
--
2.26.2
=eb88531bdbfaafb827192d1fc6c5a3fcc4fadd96
* Put the call to skb_tx_timestamp() just before adding it to the
array: https://lkml.org/lkml/2021/1/10/54
* About Tx hardware timestamps
https://lore.kernel.org/linux-can/2021071152.gb11...@hoboy.vegasvil.org/
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev
On Tue. 12 Jan 2021 at 16:58, Marc Kleine-Budde wrote:
>
> On 1/12/21 1:00 AM, Vincent MAILHOL wrote:
> [...]
>
> > Mark: do you want me to send a v4 of that patch with above
> > comment removed or can you directly do the change in your testing
> > branch?
>
>
warnings (v1 was tested with GCC -WExtra but not with
-W1).
v1 (2020-09-27):
- First release
Vincent Mailhol (1):
can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces
drivers/net/can/usb/Kconfig | 10 +
drivers/net/can/usb/Makefile|1 +
On Tue. 12 Jan 2021 at 22:05, Vincent Mailhol
wrote:
>
> This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from
> ETAS GmbH (https://www.etas.com/en/products/es58x.php).
>
> Co-developed-by: Arunachalam Santhanam
> Signed-off-by: Arunachalam Santhanam
> S
On Wed. 4 Nov 2020 10:21, Jakub Kicinski wrote:
> On Tue, 3 Nov 2020 23:06:14 +0100 Marc Kleine-Budde wrote:
>> From: Vincent Mailhol
>>
>> If a driver calls can_get_echo_skb() during a hardware IRQ (which is often,
>> but
>> not always, the case), the 'WA
be nice to extend the NAPI with skb loopback for drivers which
already supports it but I am not sure how to include the other drivers.
> @Marc: Can we also use NAPI for echo'ing the skbs?
Yours sincerely,
Vincent Mailhol
with -W1).
v1 (2020-09-27):
- First release
Vincent Mailhol (3):
can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces
can: etas_es58x: add support for ETAS ES581.4 CAN USB interface
can: etas_es58x: add support for the ETAS ES58X_FD CAN USB interfaces
driv
: Vincent Mailhol
---
drivers/net/can/usb/Kconfig | 10 +
drivers/net/can/usb/Makefile|1 +
drivers/net/can/usb/etas_es58x/Makefile |3 +
drivers/net/can/usb/etas_es58x/es58x_core.c | 2281 +++
drivers/net/can/usb/etas_es58x/es58x_core.h
This patch adds support for the ES581.4 interface from ETAS
GmbH (https://www.etas.com/en/products/es58x.php).
Co-developed-by: Arunachalam Santhanam
Signed-off-by: Arunachalam Santhanam
Signed-off-by: Vincent Mailhol
---
drivers/net/can/usb/etas_es58x/Makefile | 2 +-
drivers/net/can
This patch add support for the ES582.1 and ES584.1 interfaces from
ETAS GmbH (https://www.etas.com/en/products/es58x.php).
Co-developed-by: Arunachalam Santhanam
Signed-off-by: Arunachalam Santhanam
Signed-off-by: Vincent Mailhol
---
drivers/net/can/usb/etas_es58x/Makefile | 2
Hi Marc,
On Mon. 12 Apr 2021 at 18:20, Marc Kleine-Budde wrote:
> On 10.04.2021 18:59:45, Vincent Mailhol wrote:
> > Here comes the 15th iteration of the patch. This new version addresses
> > the comments received from Marc (thanks again for the review!) and
> > simplify
ch is the
length of any CAN error frames) solves this NULL pointer dereference.
Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB
interfaces")
Reported-by: Arunachalam Santhanam
Signed-off-by: Vincent Mailhol
---
Hi Marc,
I am really sorry, but I was just notifi
TAS ES58X CAN
> > USB interfaces")
> > Signed-off-by: Colin Ian King
Acked-by: Vincent Mailhol
Thanks Colin!
sted with GCC -WExtra but not with -W1).
v1 (2020-09-27):
- First release
Yours sincerely,
Vincent
*** BLURB HERE ***
Vincent Mailhol (1):
can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces
drivers/net/can/usb/Kconfig | 10 +
drivers/net/can
E_PRESUME_ACK);
> + } else if (matches(*argv, "cc-len8-dlc") == 0) {
> + NEXT_ARG();
> + set_ctrlmode("cc-len8-dlc", *argv, &cm,
> +CAN_CTRLMODE_CC_LEN8_DLC);
> } else if (matches(*argv, "restart") == 0) {
> __u32 val = 1;
>
> addattr32(n, 1024, IFLA_CAN_RESTART, val);
> } else if (matches(*argv, "restart-ms") == 0) {
> --
> 2.29.2
Reviewed-by: Vincent Mailhol
Reviewed and tested the patch, everything is OK for me.
Thanks Oliver!
iling list:
https://lore.kernel.org/linux-can/20210309125708.ei75tr5vp2san...@pengutronix.de/
Thank you for your comments.
Yours sincerely,
Vincent
Vincent Mailhol (1):
dql: add dql_set_min_limit()
include/linux/dynamic_queue_limits.h | 3 +++
lib/dynamic_queue_limits.c | 8
2
Add a function to set the dynamic queue limit minimum value.
This function is to be used by network drivers which are able to
prove, at least through empirical tests, that they reach better
performances with a specific predefined dql.min_limit value.
Signed-off-by: Vincent Mailhol
---
include
On Wed. 10 Mar 2021 at 00:23, Vincent Mailhol
wrote:
>
> Add a function to set the dynamic queue limit minimum value.
>
> This function is to be used by network drivers which are able to
> prove, at least through empirical tests, that they reach better
> performances with a s
Hi Dave,
Thanks for the comprehensive comments!
On Wed. 10 Mar 2021 at 04:44, Dave Taht wrote:
>
> I note that "proof" is very much in the developer's opinion and
> limited testing base.
>
> Actual operational experience, as in a real deployment, with other
> applications,
> heavy context switc
ink to RFC v1:
https://lore.kernel.org/linux-can/20210309152354.95309-1-mailhol.vinc...@wanadoo.fr/T/#t
Vincent Mailhol (1):
dql: add dql_set_min_limit()
include/linux/netdevice.h | 17 +
1 file changed, 17 insertions(+)
--
2.26.2
performances with a specific predefined
dql.min_limit value with no noticeable latency impact.
Signed-off-by: Vincent Mailhol
---
include/linux/netdevice.h | 17 +
1 file changed, 17 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ddf4cfc12615
https://lore.kernel.org/linux-can/20210309153547.q7zspf46k6ter...@pengutronix.de/
Link to RFC v1:
https://lore.kernel.org/linux-can/20210309152354.95309-1-mailhol.vinc...@wanadoo.fr/T/#t
Vincent Mailhol (1):
netdev: add netdev_queue_set_dql_min_limit()
include/linux/netdevice.h | 18 +++
switching, virtualization...),
that they constantly reach better performances with a specific
predefined dql.min_limit value with no noticeable latency impact.
Signed-off-by: Vincent Mailhol
---
include/linux/netdevice.h | 18 ++
1 file changed, 18 insertions(+)
diff --git a
gt;
> You can provide an outer macro that does the sizeof() and then calls the a
> normal (static inline) function to do the actual work. Applied to the next 3
> macros.
OK. Will be fixed in v4.
> > +#define ES58X_SIZEOF_URB_CMD(es58x_urb_cmd_type, msg_field)
> > \
> > + (offsetof(es58x_urb_cmd_type, raw_msg) \
> > + + sizeof_field(es58x_urb_cmd_type, msg_field) \
> > + + sizeof_field(es58x_urb_cmd_type, \
> > + reserved_for_crc16_do_not_use))
>
> static inline?
Sorry but this one can not be converted into a static inline: the
first argument is a type (that will become the first argument of
offsetof() and sizeof_field()).
One more time, thank you for your time and your review!
Yours sincerely,
Vincent Mailhol
lsusb -v information in PATCH 7/7 and rephrased the comment.
- Take care to put everyone in CC of each of the patch of the series
(sorry for the mess in v1...)
Vincent Mailhol (4):
can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ
context
can: dev: add a helper func
behind is that only CAN devices are affected by this issue).
[1] https://patchwork.ozlabs.org/patch/835236/
Signed-off-by: Vincent Mailhol
---
Changes in v3 and v4: None
Changes in v2:
- Minor changes of link format in the changelog.
---
drivers/net/can/dev.c | 6 +-
1 file changed, 5 inser
classical CAN
frames: this is incorrect!
This patch introduces function get_can_len() which can be used in
remediation. The function takes the SKB as an input in order to be
able to determine if the frame is classical or FD.
Signed-off-by: Vincent Mailhol
---
Changes in v4: None
Changes in v3:
The length of Remote Transmission Request (RTR) frames is always 0
bytes. The DLC represents the requested length, not the actual length
of the RTR. But __can_get_echo_skb() returns the DLC value regardless.
Apply get_can_len() function to retrieve the correct length.
Signed-off-by: Vincent
relies on the error queue such as
skb_tx_timestamp().
SCM_CAN_RAW_ERRQUEUE is defined as the type for the CAN raw error
queue. SCM stands for "Socket control messages". The name is inspired
from SCM_J1939_ERRQUEUE of include/uapi/linux/can/j1939.h.
Signed-off-by: Vincent Mailhol
---
in
tack (the assumption behind is that only CAN devices
are affected by this issue).
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 68834a2853c9..e291fda395a0 100644
-
the CAN ISO standard. Device drivers for
CAN might need those.
Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for
additional information.
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 13 ++---
include/linux/can/dev.h | 15 +++
2 fil
The length of Remote Transmission Request (RTR) frames is always 0
bytes. The DLC represents the requested length, not the actual length
of the RTR. But __can_get_echo_skb() returns the DLC value regardless.
Apply get_can_len() function to retrieve the correct length.
Signed-off-by: Vincent
tack (the assumption behind is that only CAN devices
are affected by this issue).
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 68834a2853c9..e291fda395a0 100644
-
tack (the assumption behind is that only CAN devices
are affected by this issue).
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 68834a2853c9..e291fda395a0 100644
-
classical CAN
frames: this is incorrect!
This patch introduces function get_can_len() which can be used in
remediation. The function takes the SKB as an input in order to be
able to determine if the frame is classical or FD.
Signed-off-by: Vincent Mailhol
---
include/linux/can/dev.h | 23 +++
.
Thank you for your comments.
Vincent Mailhol (6):
can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ
context
can: dev: add a helper function to get the correct length of Classical
frames
can: dev: __can_get_echo_skb(): fix the return length
can: dev: add a he
The length of Remote Transmission Request (RTR) frames is always 0
bytes. The DLC represents the requested length, not the actual length
of the RTR. But __can_get_echo_skb() returns the DLC value regardless.
Apply get_can_len() function to retrieve the correct length.
Signed-off-by: Vincent
the CAN ISO standard. Device drivers for
CAN might need those.
Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for
additional information.
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 13 ++---
include/linux/can/dev.h | 15 +++
2 fil
The ES58X devices are incorrectly recognized as USB Modem (CDC ACM),
preventing the etas-es58x module to load.
Thus, these have been added
to the ignore list in drivers/usb/class/cdc-acm.c
Signed-off-by: Vincent Mailhol
---
drivers/usb/class/cdc-acm.c | 11 +++
1 file changed, 11
> > Did you mean to send this twice?
Sorry for that, I screwed things up a first time when sending the
patches: only included the CAN mailing list
(linux-...@vger.kernel.org) but ommitted linux-ker...@vger.kernel.org
in the cover letter. As a result, it broke the chain reply on lkml.org
so I prefe
sed the comment.
- Take care to put everyone in CC of each of the patch of the series
(sorry for the mess in v1...)
Vincent Mailhol (6):
can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ
context
can: dev: add a helper function to get the correct length of C
behind is that only CAN devices are affected by this issue).
[1] https://patchwork.ozlabs.org/patch/835236/
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 68834a
classical CAN
frames: this is incorrect!
This patch introduces function get_can_len() which can be used in
remediation. The function takes the SKB as an input in order to be
able to determine if the frame is classical or FD.
Signed-off-by: Vincent Mailhol
---
include/linux/can/dev.h | 23 +++
The length of Remote Transmission Request (RTR) frames is always 0
bytes. The DLC represents the requested length, not the actual length
of the RTR. But __can_get_echo_skb() returns the DLC value regardless.
Apply get_can_len() function to retrieve the correct length.
Signed-off-by: Vincent
the CAN ISO standard. Device drivers for
CAN might need those.
Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for
additional information.
Signed-off-by: Vincent Mailhol
---
drivers/net/can/dev.c | 13 ++---
include/linux/can/dev.h | 15 +++
2 fil
-by: Vincent Mailhol
---
drivers/usb/class/cdc-acm.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 7f6f3ab5b8a6..ed9355094e8c 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1906,6
> > +static inline int get_can_len(struct sk_buff *skb)
>
> make this return an u8
> make the skb const
>
> > +{
> > + struct canfd_frame *cf =3D (struct canfd_frame *)skb->data;
>
> const
>
> > +
> > + if (can_is_canfd_skb(skb))
> > + return min_t(__u8, cf->len, CANFD_MAX_DLEN);
> > + num_element =
> > + es58x_msg_num_element(es58x_dev->dev,
> > + bulk_rx_loopback_msg->rx_loopback_msg,
> > + msg_len);
> > + if (unlikely(num_element <= 0))
> > + return num_element;
>
> Meta-comment on your use of '
put everyone in CC of each of the patch of the series
(sorry for the mess in v1...)
Vincent Mailhol (7):
can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ
context
can: dev: fix type of get_can_dlc() and get_canfd_dlc() macros
can: dev: add a helper function to get t
behind is that only CAN devices are affected by this issue).
[1] https://patchwork.ozlabs.org/patch/835236/
Signed-off-by: Vincent Mailhol
---
Changes in v3: None
Changes in v2:
- Minor changes of link format in the changelog.
---
drivers/net/can/dev.c | 6 +-
1 file changed, 5 inser
The macros get_can_dlc() and get_canfd_dlc() are not visible in
userland. As such, type u8 should be preferred over type __u8.
Reference: https://lkml.org/lkml/2020/10/1/708
Signed-off-by: Vincent Mailhol
---
include/linux/can/dev.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions
classical CAN
frames: this is incorrect!
This patch introduces function get_can_len() which can be used in
remediation. The function takes the SKB as an input in order to be
able to determine if the frame is classical or FD.
Signed-off-by: Vincent Mailhol
---
Changes in v3:
- Make get_can_len()
The length of Remote Transmission Request (RTR) frames is always 0
bytes. The DLC represents the requested length, not the actual length
of the RTR. But __can_get_echo_skb() returns the DLC value regardless.
Apply get_can_len() function to retrieve the correct length.
Signed-off-by: Vincent
the CAN ISO standard. Device drivers for
CAN might need those.
Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for
additional information.
Signed-off-by: Vincent Mailhol
---
Changes in v3: None
Changes in v2: None
---
drivers/net/can/dev.c | 13 ++---
include
-by: Vincent Mailhol
---
Changes in v3: None
Changes in v2:
- Added dmesg and lsusb -v information and rephrased the comment.
---
drivers/usb/class/cdc-acm.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index
87 matches
Mail list logo