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] [day] [month] [year] [list]
Date:	Tue, 7 Apr 2015 09:45:35 -0700
From:	Alexei Starovoitov <alexei.starovoitov@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	hannes@...essinduktion.org, netdev@...r.kernel.org,
	netfilter-devel@...r.kernel.org, pablo@...filter.org,
	jiri@...nulli.us
Subject: Re: [PATCH 1/4] netfilter: Add nf_hook_state initializer function.

On Tue, Apr 07, 2015 at 11:58:21AM -0400, David Miller wrote:
> From: Hannes Frederic Sowa <hannes@...essinduktion.org>
> Date: Tue, 07 Apr 2015 15:41:21 +0200
> 
> > Minor suggestion:
> > 
> > I think we can return the structure as a whole:
> > 
> > static inline struct nf_hook_state nf_hook_state_init(unsigned int hook,
> > ...).
> > 
> > Being static inline it should not make any difference.
> 
> If by some insane possibility this does not get inlined, this structure
> gets copied to and from the kernel stack on some cpu ABIs in order to
> return it.
> 
> Never return structures from functions, ever.

+1

I bet Dave alluding to insane sparc psABI requirements in that area.
Some horror stories there.
Never return structures. Ever!

--
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