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:	Thu, 10 Apr 2008 01:49:38 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	shemminger@...tta.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH 2/6] socket: sk_filter deinline

From: Stephen Hemminger <shemminger@...tta.com>
Date: Mon, 31 Mar 2008 17:47:10 -0700

> The sk_filter function is too big to be inlined. This saves 2296 bytes
> of text on allyesconfig.
> 
> Signed-off-by: Stephen Hemminger <shemminger@...tta.com>

Because of the bloat I'll apply this to net-2.6.26

But I think we can do better in many of the callsites.

Most of them are in the packet receive path, have BH's disabled, and a
lot of the variables already laid out in registers.

I would like to see a new inline created that caters to these cases,
which does something like:

	if (rcu_dereference(sk->sk_filter))
		return sk_filter(sk, skb);
	else
		return 0;

The security check muddles things here, but that should be inlined in
such situations too I think.

It's all of that "pkt_len = this; pskb_trim(that);" that makes for
most of the bloat.  And that can stay in the un-inlined sk_filter() we
have now.

Having a socket filter enabled on a TCP socket is so rare, but
now everyone pays for the function call unconditionally.
--
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