Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/net
Tetsuo Handa 8df73ff90f UNIX: Do not loop forever at unix_autobind().
We assumed that unix_autobind() never fails if kzalloc() succeeded.
But unix_autobind() allows only 1048576 names. If /proc/sys/fs/file-max is
larger than 1048576 (e.g. systems with more than 10GB of RAM), a local user can
consume all names using fork()/socket()/bind().

If all names are in use, those who call bind() with addr_len == sizeof(short)
or connect()/sendmsg() with setsockopt(SO_PASSCRED) will continue

  while (1)
        yield();

loop at unix_autobind() till a name becomes available.
This patch adds a loop counter in order to give up after 1048576 attempts.

Calling yield() for once per 256 attempts may not be sufficient when many names
are already in use, for __unix_find_socket_byname() can take long time under
such circumstance. Therefore, this patch also adds cond_resched() call.

Note that currently a local user can consume 2GB of kernel memory if the user
is allowed to create and autobind 1048576 UNIX domain sockets. We should
consider adding some restriction for autobind operation.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-07 13:57:23 -07:00
..
9p fs/9p: destroy fid on failed remove 2010-08-02 14:28:36 -05:00
802
8021q vlan: Match underlying dev carrier on vlan add 2010-08-19 00:26:46 -07:00
appletalk
atm ppp: make channel_ops const 2010-08-04 21:53:17 -07:00
ax25 ax25: missplaced sock_put(sk) 2010-08-26 15:18:27 -07:00
bluetooth Bluetooth: Fix incorrect setting of remote_tx_win for L2CAP ERTM 2010-08-10 07:59:11 -04:00
bridge bridge: Clear INET control block of SKBs passed into ip_fragment(). 2010-09-01 19:17:34 -07:00
caif net/caif/cfrfml.c: use asm/unaligned.h 2010-08-26 16:11:08 -07:00
can can: add limit for nframes and clean up signed/unsigned variables 2010-08-11 16:12:35 -07:00
core net: fix tx queue selection for bridged devices implementing select_queue 2010-09-07 13:57:20 -07:00
dcb
dccp net: dccp: fix sign bug 2010-07-18 15:07:14 -07:00
decnet
dsa phylib: available for any speed ethernet 2010-08-11 23:03:50 -07:00
econet
ethernet Net: ethernet: pe2.c: fix EXPORT_SYMBOL macro code style issue 2010-07-14 18:27:09 -07:00
ieee802154
ipv4 ipv4: minor fix about RPF in help of Kconfig 2010-09-01 14:29:36 -07:00
ipv6 netfilter: discard overlapping IPv6 fragment 2010-09-07 13:57:21 -07:00
ipx
irda irda: off by one 2010-09-07 13:57:22 -07:00
iucv
key
l2tp l2tp: test for ethernet header in l2tp_eth_dev_recv() 2010-08-26 13:29:38 -07:00
lapb
llc
mac80211 mac80211: delete work timer 2010-08-30 16:02:34 -04:00
netfilter ipvs: avoid oops for passive FTP 2010-09-02 10:05:00 -07:00
netlabel
netlink netlink: Make NETLINK_USERSOCK work again. 2010-08-31 09:51:37 -07:00
netrom
packet
phonet Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-07-20 18:25:24 -07:00
rds rds: fix a leak of kernel memory 2010-08-18 23:40:03 -07:00
rfkill
rose net/rose: Use GFP_ATOMIC 2010-08-01 00:32:12 -07:00
rxrpc RxRPC: Fix a potential deadlock between the call resend_timer and state_lock 2010-08-04 21:53:16 -07:00
sched net/sched/sch_hfsc.c: initialize parent's cl_cfmin properly in init_vf() 2010-09-01 14:29:35 -07:00
sctp Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-08-04 15:31:02 -07:00
sunrpc mm: add context argument to shrinker callback to remaining shrinkers 2010-07-21 15:33:01 +10:00
tipc
unix UNIX: Do not loop forever at unix_autobind(). 2010-09-07 13:57:23 -07:00
wanrouter net: autoconvert trivial BKL users to private mutex 2010-07-12 20:21:47 -07:00
wimax
wireless wireless: register wiphy rfkill w/o holding cfg80211_mutex 2010-08-31 14:48:47 -04:00
x25
xfrm xfrm_user: avoid a warning with some compiler 2010-09-01 14:29:35 -07:00
compat.c
Kconfig wireless: Make COMPAT_NETLINK_MESSAGES depend upon WEXT_CORE 2010-07-26 13:13:49 -07:00
Makefile
nonet.c
socket.c net: support time stamping in phy devices. 2010-07-18 19:15:26 -07:00
sysctl_net.c
TUNABLE