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]
Message-ID: <CAD6jFUTmNiRHdAkckkwcV2rEOf_kxjHmntTO+rG6ewLs-RhFfg@mail.gmail.com>
Date:	Fri, 5 Oct 2012 16:17:12 +0200
From:	Daniel Borkmann <danborkmann@...earbox.net>
To:	Paul Chavent <Paul.Chavent@...ra.fr>
Cc:	davem@...emloft.net, edumazet@...gle.com, xemul@...allels.com,
	herbert@...dor.hengli.com.au, netdev@...r.kernel.org,
	johann.baudy@...-log.net, uaca@...mni.uv.es
Subject: Re: [PATCH] Packet mmap : allow the user to choose the offset of the
 tx payload.

On Fri, Oct 5, 2012 at 3:10 PM, Paul Chavent <Paul.Chavent@...ra.fr> wrote:
> The tx offset of packet mmap tx ring used to be :
> (TPACKET2_HDRLEN - sizeof(struct sockaddr_ll))
>
> The problem is that depending on the usage of SOCK_DGRAM or
> SOCK_RAW, the payload could be aligned or not.
>
> This patch allow to let the user give an offset for it's tx
> payload if he desires.
>
> Signed-off-by: Paul Chavent <paul.chavent@...ra.fr>

Can you provide an example when it doesn't hit TPACKET_ALIGNMENT?

On the first look, could it be that your patch currently enforces the
use of your tp_net's offset for *all* TX_RING users, even if they
don't care about it? So in case off==0, you probably get a negative
offset in case of SOCK_RAW, thus it won't hit the second if-statement.
Sure, but this does not look intuitive in my opinion. Maybe, it's
better to only enter this path if the offset *is* used by someone.

Also, to my knowledge tp_net is currently only applied in receive
path. So, if for whatever reason people did not explicitly set tp_net
to 0, it might break their code, if there's a random offset in it,
right?

Best,
Daniel
--
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