All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
	"Max S." <max@schneidersoft.net>,
	linux-can@vger.kernel.org
Subject: Re: usb-can device
Date: Mon, 27 Aug 2012 11:05:41 +0200	[thread overview]
Message-ID: <503B3865.4090202@pengutronix.de> (raw)
In-Reply-To: <20120827081028.GA417@vandijck-laurijssen.be>

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

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   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  parent reply	other threads:[~2012-08-27  9:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-26 15:52 usb-can device Max S.
2012-08-26 16:28 ` Marc Kleine-Budde
2012-08-27  6:20   ` Oliver Hartkopp
     [not found]     ` <20120827081028.GA417@vandijck-laurijssen.be>
2012-08-27  9:05       ` Marc Kleine-Budde [this message]
     [not found]     ` <1346071259.3928.33.camel@slaptop>
2012-08-28 11:58       ` Oliver Hartkopp
2012-08-28 12:13         ` Marc Kleine-Budde
2012-08-28 12:18           ` Oliver Hartkopp
2012-08-28 12:20             ` Marc Kleine-Budde
2012-08-28 14:30     ` Max S.
2012-08-29 10:55       ` Oliver Hartkopp
2012-08-28 23:34     ` Fabio Baltieri
2012-08-29 11:02       ` Oliver Hartkopp
2012-09-09 13:41         ` Pavel Pisa

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=503B3865.4090202@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=max@schneidersoft.net \
    --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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.