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>] [day] [month] [year] [list]
Date:	Fri, 8 Aug 2008 15:48:56 -0700 (PDT)
From:	David Witbrodt <dawitbro@...global.net>
To:	linux-kernel@...r.kernel.org
Cc:	Yinghai Lu <yhlu.kernel@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: HPET regression in 2.6.26 versus 2.6.25

OK, suffering from insomnia this morning, I added printk()'s to
net/ipv4/af_inet.c in order to find the code where the freeze
happens.  One of 2 loops was the culprit:

===== BEGIN CODE =======================
#ifdef CONFIG_IP_MULTICAST
    if (inet_add_protocol(&igmp_protocol, IPPROTO_IGMP) < 0)
        printk(KERN_CRIT "inet_init: Cannot add IGMP protocol\n");
#endif
  
    /* Register the socket-side information for inet_create. */
    for (r = &inetsw[0]; r < &inetsw[SOCK_MAX]; ++r)
        INIT_LIST_HEAD(r);

    for (q = inetsw_array; q < &inetsw_array[INETSW_ARRAY_LEN]; ++q)
        inet_register_protosw(q);
  
    /*
     *    Set the ARP module up
     */
===== END CODE =======================

Feeling better, I tried to get a few hours of sleep before I had to
go to work.

Knowing where to focus more attention, I restored the original version
of af_inet.c from the git tree with

    git show HEAD:net/ivp4/af_inet.c

and then made the following changes to discover which loop was
the problem:

===== BEGIN DIFF ========================
  #ifdef CONFIG_IP_MULTICAST
      if (inet_add_protocol(&igmp_protocol, IPPROTO_IGMP) < 0)
          printk(KERN_CRIT "inet_init: Cannot add IGMP protocol\n");
  #endif
  
+     printk("           First loop:\n");
+     printk("             SOCK_MAX = %d\n", SOCK_MAX);
+     int dwindex=0;
      /* Register the socket-side information for inet_create. */
      for (r = &inetsw[0]; r < &inetsw[SOCK_MAX]; ++r)
+       {
+         printk("             initializing:  &inetsw[%d] = %p\n", dwindex, r);
          INIT_LIST_HEAD(r);
+         ++dwindex;
+       }
  
+     printk("           Second loop:\n");
+     printk("             INETSW_ARRAY_LEN = %d\n", INETSW_ARRAY_LEN);
+     printk("             Initial q = %p\n", inetsw_array);
+     printk("             Final   q = %p\n", &inetsw_array[INETSW_ARRAY_LEN]);
+     dwindex=0;
      for (q = inetsw_array; q < &inetsw_array[INETSW_ARRAY_LEN]; ++q)
+       {
+         printk("             initializing:  &q[%d]\n", dwindex);
          inet_register_protosw(q);
+         ++dwindex;
+       }
  
      /*
       *    Set the ARP module up
       */
===== END DIFF ========================

I then built the kernel, installed it, and rebooted.  The following
output was observed:

===== BEGIN OUTPUT ========================
...
NET: Registered protocol family 2
           First loop:
             SOCK_MAX = 11
             initializing:  &initsw[0] = ffffffff809c8460
             initializing:  &initsw[1] = ffffffff809c8470
             initializing:  &initsw[2] = ffffffff809c8480
             initializing:  &initsw[3] = ffffffff809c8490
             initializing:  &initsw[4] = ffffffff809c84a0
             initializing:  &initsw[5] = ffffffff809c84b0
             initializing:  &initsw[6] = ffffffff809c84c0
             initializing:  &initsw[7] = ffffffff809c84d0
             initializing:  &initsw[8] = ffffffff809c84e0
             initializing:  &initsw[9] = ffffffff809c84f0
             initializing:  &initsw[10] = ffffffff809c8500
           Second loop:
             INETSW_ARRAY_LEN = 3
             Initial q = ffffffff806f8a20
             Final   q = ffffffff806f8a60
             initializing:  &q[0]

===== END OUTPUT ========================


This is where my kernels (2.6.26* and 2.6.27*) are freezing, in
the call of inet_register_protosw().

As I find time, I will keep trying to dig deeper.  Hopefully one
of you on the LKML has an idea of what's wrong, because even
though I am familiar with C and C++ I have no background at all
with Linux kernel code itself.


Dave W.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ