Go to file
Luca Boccassi 975c4944e8 ip/netns: use flock when setting up /run/netns
If multiple ip processes are ran at the same time to set up
separate network namespaces, and it is the first time so /run/netns
has to be set up first, and they end up doing it at the same time,
the processes might enter a recursive loop creating thousands of
mount points, which might crash the system depending on resources
available.

Try to take a flock on /run/netns before doing the mount() dance, to
ensure this cannot happen. But do not try too hard, and if it fails
continue after printing a warning, to avoid introducing regressions.

First reported on Debian: https://bugs.debian.org/949235

To reproduce (WARNING: run in a VM to avoid system lockups):

for i in {0..9}
do
        strace -e trace=mount -e inject=mount:delay_exit=1000000 ip \
 netns add "testnetns$i" 2>&1 | tee "$i.log" &
done
wait

The strace is to ensure the problem always reproduces, to add an
artificial synchronization point after the first mount().

Reported-by: Etienne Dechamps <etienne@edechamps.fr>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-12-03 08:31:23 -08:00
bash-completion devlink: Add health reporter test command support 2020-10-07 00:08:53 -06:00
bridge bridge: report correct version 2020-11-15 08:58:52 -08:00
devlink devlink: display elapsed time during flash update 2020-10-17 09:30:06 -06:00
doc/actions doc: remove trailing whitespace 2018-12-19 12:02:38 -08:00
etc/iproute2 add support to keepalived rtm_protocol 2020-07-05 15:03:45 +00:00
examples/bpf examples: remove diffserv 2019-10-23 09:13:55 -07:00
genl genl: ctrl: print op -> policy idx mapping 2020-10-11 20:10:09 -06:00
include uapi: update devlink.h 2020-11-29 21:17:22 -08:00
ip ip/netns: use flock when setting up /run/netns 2020-12-03 08:31:23 -08:00
lib libnetlink: define __aligned conditionally 2020-10-28 10:24:02 -07:00
man tc-mpls: fix manpage example and help message string 2020-11-08 10:49:28 -08:00
misc ss: add support for xdp statistics 2020-09-29 09:21:24 -06:00
netem doc: remove trailing whitespace 2018-12-19 12:02:38 -08:00
rdma rdma: fix spelling error in comment 2020-11-08 10:44:19 -08:00
schema bridge: add json schema for bridge fdb show 2016-07-20 12:02:02 -07:00
tc tc-mpls: fix manpage example and help message string 2020-11-08 10:49:28 -08:00
testsuite m_mpls: add mac_push action 2020-10-20 08:57:08 -06:00
tipc tipc: add option to set rekeying for encryption 2020-10-20 09:04:45 -06:00
.clang-format clang-format: add configuration file 2019-01-17 13:38:23 -08:00
.gitignore Remove leftovers from removed Latex documentation 2018-02-13 16:43:19 -08:00
.mailmap mailmap: map David's mail address 2019-05-15 09:50:42 -07:00
configure configure: support ipset version 7 with kernel version 5 2020-07-08 08:48:02 -07:00
COPYING Update address of FSF in license 2008-03-08 13:31:03 -08:00
Makefile build: avoid make jobserver warnings 2020-09-28 13:49:24 -07:00
README README: update libdb build dependency information 2018-05-01 19:29:03 -07:00
README.devel README: update location of git repositories, remove broken info link 2018-02-13 16:42:51 -08:00

This is a set of utilities for Linux networking.

Information:
    https://wiki.linuxfoundation.org/networking/iproute2

Download:
    http://www.kernel.org/pub/linux/utils/net/iproute2/

Stable version repository:
    git://git.kernel.org/pub/scm/network/iproute2/iproute2.git

Development repository:
    git://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git

How to compile this.
--------------------
1. libdbm

arpd needs to have the berkeleydb development libraries. For Debian
users this is the package with a name like libdbX.X-dev.
DBM_INCLUDE points to the directory with db_185.h which
is the include file used by arpd to get to the old format Berkeley
database routines.  Often this is in the db-devel package.

2. make

The makefile will automatically build a config.mk file which
contains definitions of libraries that may or may not be available
on the system such as: ATM, ELF, MNL, and SELINUX.

3. To make documentation, cd to doc/ directory , then
   look at start of Makefile and set correct values for
   PAGESIZE=a4		, ie: a4 , letter ...	(string)
   PAGESPERPAGE=2	, ie: 1 , 2 ...		(numeric)
   and make there. It assumes, that latex, dvips and psnup
   are in your path.

4. This package includes matching sanitized kernel headers because
   the build environment may not have up to date versions. See Makefile
   if you have special requirements and need to point at different
   kernel include files.

Stephen Hemminger
stephen@networkplumber.org

Alexey Kuznetsov
kuznet@ms2.inr.ac.ru