Re: Poss. bug in tulip driver since 2.4.7

From: Andrew Morton (akpm_at_osdl.org)
Date: 11/12/03

  • Next message: Josh McKinney: "Re: A7N8X (Deluxe) Madness"
    Date:	Tue, 11 Nov 2003 18:54:19 -0800
    To: Prasanna Meda <pmeda@akamai.com>
    
    

    Prasanna Meda <pmeda@akamai.com> wrote:
    >
    > The inner for loop shown below was not
    > supposed to be inside the outside loop.
    > They also use the same index i.
    > Due to this, when mc_count is more than
    > 14, with non ASIX chips, panics, corruptions
    > and denial of services to multicast addresses
    > can result!
    >
    > http://lxr.linux.no/source/drivers/net/tulip/tulip_core.c#L1055

    So can you confirm that the driver works correctly with this change?

    --- 25/drivers/net/tulip/tulip_core.c~tulip-hash-fix 2003-11-11 18:51:52.000000000 -0800
    +++ 25-akpm/drivers/net/tulip/tulip_core.c 2003-11-11 18:52:31.000000000 -0800
    @@ -979,12 +979,13 @@ static void build_setup_frame_hash(u16 *
             for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
                  i++, mclist = mclist->next) {
                     int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff;
    + int j;
     
                     set_bit_le(index, hash_table);
     
    - for (i = 0; i < 32; i++) {
    - *setup_frm++ = hash_table[i];
    - *setup_frm++ = hash_table[i];
    + for (j = 0; j < 32; j++) {
    + *setup_frm++ = hash_table[j];
    + *setup_frm++ = hash_table[j];
                     }
                     setup_frm = &tp->setup_frame[13*6];
             }

    _

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


  • Next message: Josh McKinney: "Re: A7N8X (Deluxe) Madness"

    Relevant Pages

    • Re: Poss. bug in tulip driver since 2.4.7
      ... Andrew Morton wrote: ... >>The inner for loop shown below was not ... >> supposed to be inside the outside loop. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Poss. bug in tulip driver since 2.4.7
      ... Prasanna Meda wrote: ... you need to bring the for loop outside the loop. ... it to Linus. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Poss. bug in tulip driver since 2.4.7
      ... The inner for loop shown below was not ... supposed to be inside the outside loop. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: Poss. bug in tulip driver since 2.4.7
      ... >> The inner for loop shown below was not ... >> supposed to be inside the outside loop. ... to 2.2 tulip driver, and it worked. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • wait_event and preemption in 2.6
      ... I'm writing a device driver for PPC Linux and I'm using wait_event. ... preemption is turned on. ... check the condition and break out of the loop. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)