# Re: usb-can device

- From: Marc Kleine-Budde \<mkl@pengutronix.de\>
- Date: 2012-08-27 09:05:45 
- List: linux-can
- Page: https://ratatoskr.run/linux-can/2012/08/9345499
- Thread: https://ratatoskr.run/linux-can/2012/08/9345499/t.md

```text
On 08/27/2012 10:10 AM, Kurt Van Dijck wrote:
>> *2:
>> To provide a state-of-the-art echo functionality the sk pointer (skb->sk) is
>> sent along with the CAN frame. This allows to skb_free() the original tx skb
>> and create a new one at rx time with the correct sk pointer, when the frame is
>> echoed after successful transmission. As we are endian safe the sk pointer can
>> be taken from the USB URB as-is. (For security reasons we should probably not
>> take the pointer directly but double check with stored echo-skbs)

> 'sending an skb pointer' is indeed a key to cleaner design,
> but couples both systems more tight: is that pointer 32bit? 64?
> 
> I even don't know if that is a problem ...

On 64 Bit archs you need 64 bit for a pointer. However I'd like to call
this cookie or handle not pointer to some kernel internal data. And as
Oliver pointed out, don't trust the data that comes from the USB device.

regards, Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-can/2012/08/9345499/attachment/0) (application/pgp-signature, 259 bytes)
