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, 11 Nov 2008 12:43:44 +0100
From:	"Johann Baudy" <johaahn@...il.com>
To:	"Lovich, Vitali" <vlovich@...lcomm.com>
Cc:	"Evgeniy Polyakov" <zbr@...emap.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH] Packet socket: mmapped IO: PACKET_TX_RING

Hi Vitali,

>
>> I think we must not care about skb frags/device management to get
>> tpacket_hdr pointer back from skb. If it is changing tomorrow, we will
>> be in trouble.
> I'm a bit confused about the point you are trying to make here.  Could you please clarify?

I believe that a solution with an additional field in sk_buff struct
is preferable to a one which depends on sub-layer mechanism (frags
management).

> This would require a massive change in the kernel to add a feature that up till now no one has needed.  Certainly, I don't think it's wise to introduce such a wide-spread change when we could just as well accomplish it through other means.  Here are my problems with this approach:
>
> 1.  There's no need to actually pass the argument through the destructor - it could just be part of the skb (after all, since the callback only happens in one place, it's not like we could customize that argument - it would always be skb->destructor_arg).  That way whoever needs to use would use it,  but there's no need to change all existing destructor code.

Yes! give it as callback argument is not mandatory.

> 2.  Backing up this field isn't really possible since where would you place that backup?

Ex: Destructor arg points to a struct that contains previous
destructor function and destructor argument.
Those are restored and executed during new destructor.
Layer that replaces it, is in charge of the backup

>
> 3.  You're increasing the size of the structure for everyone, even if they have disabled PACKET_MMAP (and since no-one else uses this, it doesn't really make sense).  So if it is decided that the correct approach is to store the pointer in the skb, then we should continue doing what other protocols do in the situation where they need custom data in the skb and just add our own custom pointer surrounded by an #ifdef/#endif for PACKET_MMAP.

That's could be included into another "feature flag" which will be
enabled only when a feature as PACKET_MMAP needs it.

I'm suggesting a variable that sub-layers will guarantee as
skb->destructor. A variable that will be at least restored before
destructor callback call.

This can be used also for sock_w_free() destructor. Current code is
assuming that the socket destructor is always sock_w_free(), if
tomorrow, this callback is changed or removed, we will have to change
packet_mmap code (called in packet_skb_destruct()). Such mechanism
should make replacement of destructor/destructor arg more independent
toward layers.

Best regards,
Johann
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ