Your message dated Tue, 01 Dec 2015 22:19:53 +0000
with message-id <[email protected]>
and subject line Bug#231197: fixed in ifupdown 0.8
has caused the Debian Bug report #231197,
regarding Please prevent ifup A -> hotplug -> ifup A deadlock
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
231197: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231197
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ifupdown
Version: 0.6.4-4
Severity: important

        The use of ifupdown and network hotplug result in complete
computer deadlock (need to press hard reset button).

        Background on network hotplug :
        There are basically two types of network interfaces, static
(i.e. found at boot-time) and dynamic/removable/hotplug (that may
appear/disapear at any time).
        Up to now, the only dynamic network interfaces were 16 bits
Pcmcia network cards, which are managed by 'cardmgr' (included in the
Pcmcia package). Cardmgr and ifupdown do interract properly, no
problem there.
        Nowadays, a lot of 32 bits Bardbus network cards and USB
network devices are being sold and supported by Linux. Those devices
are managed exclusively through the hotplug system. Therefore, proper
interoperation of ifupdown and hotplug is required to be able to
support those devices.

        Problem :
        Let assume a standard laptop configuration with an integrated
Ethernet port and a Pcmcia 32 bit 802.11g wireless cards. User
configure the Ethernet port as a static interface (eth0). User must
setup Hotplug to support the wireless interface (eth1).
        However, in such scenario, when the integrated Ethernet port
is configured, the laptop will deadlock.

        Investigation :
        1) At boot-up, /etc/init.d/networking call 'ifup -a'.
        2) 'ifup -a' triggers 'modprobe eth0' (static Ethernet interface)
        3) eth0 driver module loads
        4) kernel send hotplug event for new interface 'eth0'
        5) hotplug run 'net.agent' script
        6) 'net.agent' calls 'ifup eth0'
        7) 'ifup eth0' deadlock
        8) kernel network layer deadlock (because hotplug doesn't return)

        Other way to reproduce the problem :
        B) Let's assume the user of the same laptop doesn't want the
Ethernet interface to be brought up at boot, so doesn't include the
'auto' keyword in /etc/network/interfaces. At a later time, he decides
to activate the interface manually running the command 'ifup
eth0'. Deadlock.
        C) Let assume the user has a regular desktop with one Ethernet
card and wthout knowing any better install the standard distribution
of hotplug scripts, or an hypothetical 'Cardbus/USB network support'
Debian package. Next time he reboots, deadlock.

        Fix :
        The fix is relatively simple : ifup must run in two phases. In
the first phase, it read the config file and only 'modprobe' the
relevant interfaces (cmd-line or -a), without aquiring any lock. In
the second phase, it locks whatever needs to be locked and configure
each interface if this interface is not already configured.
        It is my habit to send fully tested patches, not bug reports,
but I could not find a usable source code for ifupdown (despite
unpacking the source tar file on the package web page). You may want
to fix that in the future.

        Therefore, I created a simple utility, 'ifloadall', that loads
all modules specified in /etc/network/interfaces, and need to be run
prior to 'ifup -a'. The source code is attached, along with a patch
for the init scripts. I've tested this solution and it works properly
on my PCs.
        Note that I don't consider this to be the "final" solution,
just a proof of concept, because it doesn't address scenario (B), and
it would need proper integration in ifupdown.

        Regards,

        Jean
/*
 * Copyright Jean Tourrilhes <[email protected]> 2004
 * This code is licensed under the GPL.
 */

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>

#define NET_CONFIG_FILE		"/etc/network/interfaces"
#define MODPROBE_CMD		"/sbin/modprobe %s"

/*------------------------------------------------------------------*/
/*
 * The main !
 */
int
main(int	argc,
     char **	argv)
{
  char		buff[1024];
  char *	iface;
  char *	end;
  char		cmd[1100];
  FILE *	fh;

  /* Open config file */
  fh = fopen(NET_CONFIG_FILE, "r");
  if(fh == NULL)
    {
      fprintf(stderr, "%s: can't open file [%s] - abort !\n",
	      argv[0], NET_CONFIG_FILE);
      return -1;
    }

  /* Read each config line */
  while(fgets(buff, sizeof(buff), fh))
    {
      /* Check for auto keyword, ignore when commented out */
      if(!strncasecmp(buff, "auto ", 5))
	{
	  /* Skip keyword */
	  iface = buff + 5;

	  /* Terminate at first comment */
	  end = strchr(iface, '#');
	  if(end != NULL)
	    *end = '\0';

	  /* Loop on all interfaces given */
	  while(strlen(iface) > 0)
	    {
	      /* Look for end of interface name */
	      end = iface;
	      while((*end != '\0') && (!isspace(*end)))
		end++;
	      if(*end == '\0')
		end = NULL;
	      else
		*end = '\0';

	      /* Do it ! */
	      fprintf(stderr, "%s: loading interface [%s]\n",
		      argv[0], iface);
	      sprintf(cmd, MODPROBE_CMD, buff + 5);
	      system(cmd);

	      /* Next interface */
	      if(end != NULL)
		{
		  iface = end + 1;
		  while(isspace(*iface)) iface++;
		}
	      else
		/* Terminate */
		*iface = '\0';
	    }
	}
    }

  /* Done */
  fclose(fh);
  return 0;
}
diff -u -p /etc/init.d/networking-bad /etc/init.d/networking
--- /etc/init.d/networking-bad  Wed Feb  4 17:49:24 2004
+++ /etc/init.d/networking      Wed Feb  4 17:49:54 2004
@@ -121,6 +121,7 @@ case "$1" in
         doopt ip_forward no
 
         echo -n "Configuring network interfaces: "
+       ifloadall
         ifup -a
        echo "done."
        ;;

--- End Message ---
--- Begin Message ---
Source: ifupdown
Source-Version: 0.8

We believe that the bug you reported is fixed in the latest version of
ifupdown, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guus Sliepen <[email protected]> (supplier of updated ifupdown package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 01 Dec 2015 23:09:54 +0100
Source: ifupdown
Binary: ifupdown
Architecture: source amd64
Version: 0.8
Distribution: unstable
Urgency: medium
Maintainer: Guus Sliepen <[email protected]>
Changed-By: Guus Sliepen <[email protected]>
Description:
 ifupdown   - high level tools to configure network interfaces
Closes: 231197 246771 762388 773539 791444 792896 799257 804978 806673
Changes:
 ifupdown (0.8) unstable; urgency=medium
 .
   [ Guus Sliepen ]
   * Add per-interface state files with locking.
     - Also detects and aborts on recursion. Closes: #231197
   * Break up main() in smaller functions.
   * Return a non-zero exit code when (de)configuring an interface fails.
     Closes: 773539
   * Add blank lines around examples in interfaces(5). Closes: #791444
   * Enable RFC 4361 DDNS support when using dhclient, as suggested by
     Nicolas Cuissard. Closes: #799257
   * Lock parent interface when configuration VLAN interfaces.
   * Apply fixes for issues found by AddressSanitizer and Clang Static
     Analyzer.
   * Drop the versioned dependency on initscripts. Closes: #804978
   * Check for errors when running mapping scripts. Closes: #246771
   * Wait for an IPv6 link-local address before starting a DHCPv6 client.
     Closes: 806673
   * Add a systemd service file.
 .
   [ Andrew Shadura ]
   * Implement interface inheritance using the "inherits" keyword.
 .
   [ Jérémy Bobbio ]
   * Output methods in stable order when generating C code to make
     builds reproducible. Closes: #762388
 .
   [ Javier Barroso ]
   * Fix detection of curlftpfs mounts. Closes: #792896
Checksums-Sha1:
 5c2007559a0154927ebf3e07bd508e33374c880a 1516 ifupdown_0.8.dsc
 d97fbccfc71ac4f6e9c0bb608cfd966c3bc7450e 68032 ifupdown_0.8.tar.xz
 ed85f73df09e81561e2141f899ab9bb3dac37033 68950 ifupdown_0.8_amd64.deb
Checksums-Sha256:
 809c992402fa5011bab06484e4ad04db48c5bab6b28407b358d9b7be89bc9ccd 1516 
ifupdown_0.8.dsc
 e11d8adfc5eadb564722b997b73dd4dcebc1ca13d30955a351ecbe8d3477497a 68032 
ifupdown_0.8.tar.xz
 8d6766f00c5638b48352940c212d80c23537de412991696e62ee6e076fb50d4d 68950 
ifupdown_0.8_amd64.deb
Files:
 075d0f793175dfdd838fda4e528a3a1d 1516 admin important ifupdown_0.8.dsc
 bb17d8c37ef857e3423d25adea7a320f 68032 admin important ifupdown_0.8.tar.xz
 8370af3b3831e2a01af5e976ecfb8a27 68950 admin important ifupdown_0.8_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJWXhsMAAoJED9JDeuHHvn6ZBoP/iE7RxNhg0l6ix6J6Sz2NUPJ
xorXt2hnlr/UPrXTyw3MSDX31mfz8PC0XcCKd0JVPH22e6OvoCS2qO3+PvawWOua
vQGnNEu1HtWLtZ7XKQ3J8Rc7sgOqJEbioXk4wG0EFCf8kISxazN8W2sgLB/MFYEp
l+QVcrjiRloFWLCKVW9YVNLARXAcPFRDf1Kqvlh21PdJ52n8FA5aA0CXwAJVRtAu
zFEQl3EVpxZq0GrIR6t96qc2QGmKiQy1wu244jsEhbdqsINrY6o+x9568WQgJd4V
fWMeogYxY+HJpdTZZ1RKq5YUwVuZfPmDQVSwzEK1W8M5j7r/iH6PEjtjirsstRB3
mJhI7BN8E8qnmjK1a+XVDwDzru8/Q62hhcULZLMjX+c2XLJ9eI1zvY2dix77e2yj
4hMAqw2gkG9HihryDQjTM/QP6RUW04zqb4QCEHDR8pBbFapZBnYeUoGkEj8rLZN9
nLrVRgdpRuJTCzpc9nxlPy4wjg9GCW5efGLrDWJyJkvgetg8fLKDqz+cYdFDwia+
ZH3lbGZYoXjX7Ri3CcmVZRenYs7NuV0BrOAOIZpAa9ur4Kg4hhEZTNACJ7YLAQQo
djxOCEja+nZYDfzotSHlwKlS2i8I8rmWt/WQS+7gSpwms0IgAcHKYEPGER7RqwGG
lcwjSk+FUuiYUutyffOz
=Lgx1
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to