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, 1 Dec 2020 17:02:08 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Julian Wiedmann <jwi@...ux.ibm.com>
Cc:     David Miller <davem@...emloft.net>,
        linux-netdev <netdev@...r.kernel.org>,
        linux-s390 <linux-s390@...r.kernel.org>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Karsten Graul <kgraul@...ux.ibm.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: [PATCH net-next 1/6] s390/ctcm: Avoid temporary allocation of
 struct th_header and th_sweep.

On Mon, 30 Nov 2020 11:09:45 +0100 Julian Wiedmann wrote:
> From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> 
> The size of struct th_header is 8 byte and the size of struct th_sweep
> is 16 byte. The memory for is allocated, initialized, used and
> deallocated a few lines later.
> 
> It is more efficient to avoid the allocation/free dance and assign the
> values directly to skb's data part instead of using memcpy() for it.
> 
> Avoid an allocation of struct th_sweep/th_header and use the resulting
> skb pointer instead.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> [jwi: use skb_put_zero(), instead of skb_put() + memset to 0]
> Signed-off-by: Julian Wiedmann <jwi@...ux.ibm.com>

Stuff like that is usually done when skb data cannot be assumed to be
aligned. I don't see where the skbs are allocated here, so fingers
crossed :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ