29 Mar, 2011

7 commits


28 Mar, 2011

20 commits

  • After commit d5dbda23804156ae6f35025ade5307a49d1db6d7 "ethtool: Add
    support for vlan accleration.", drivers that have NETIF_F_HW_VLAN_TX,
    and/or NETIF_F_HW_VLAN_RX feature, but do not allow enable/disable vlan
    acceleration via ethtool set_flags, always return -EINVAL from that
    function. Fix by returning -EINVAL only if requested features do not
    match current settings and can not be changed by driver.

    Change any driver that define ethtool->set_flags to use
    ethtool_invalid_flags() to avoid similar problems in the future
    (also on drivers that do not have the problem).

    Tested with modified (to reproduce this bug) myri10ge driver.

    Cc: stable@kernel.org # 2.6.37+
    Signed-off-by: Stanislaw Gruszka
    Signed-off-by: David S. Miller

    Stanislaw Gruszka
     
  • The mlx4_en driver uses the combination stop_port/start_port
    in a number of places. Unfortunately that causes any promiscuous
    mode settings on the hardware to be lost.

    This patch fixes that problem.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The correct usage is "static inline void" not "static void inline".

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: David S. Miller

    Javier Martinez Canillas
     
  • It is proper style to include linux/foo.h instead asm/foo.h if both exist

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: David S. Miller

    Javier Martinez Canillas
     
  • Two places in the kernel were doing skb->ip_summed = 0.

    Change both to skb->ip_summed = CHECKSUM_NONE, which is more readable.

    Signed-off-by: Cesar Eduardo Barros
    Signed-off-by: David S. Miller

    Cesar Eduardo Barros
     
  • The jme driver uses the legacy PCI power management, so it has to do
    some PCI-specific things in its ->suspend() and ->resume() callbacks,
    which isn't necessary and should better be done by the PCI
    sybsystem-level power management code. It also doesn't use device
    wakeup flags correctly.

    Convert jme to the new PCI power management framework and make it
    let the PCI subsystem take care of all the PCI-specific aspects of
    device handling during system power transitions.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: David S. Miller

    Rafael J. Wysocki
     
  • Avoid theoretical race condition regarding accessing dev->features
    NETIF_F_LRO flag, which is illustrated below.

    CPU1 CPU2

    myri10ge_clean_rx_done(): myri10ge_set_flags():
    or
    myri10ge_set_rx_csum():

    if (dev->features & NETIF_F_LRO)
    setup lro
    dev->features |= NETIF_F_LRO
    or
    dev->features &= ~NETIF_F_LRO;
    if (dev->features & NETIF_F_LRO)
    flush lro

    On the way reduce myri10ge_rx_done() number of arguments and calls by
    moving mgp->small_bytes check into that function. That reduce code size

    from:
    text data bss dec hex filename
    36644 248 100 36992 9080 drivers/net/myri10ge/myri10ge.o

    to:
    text data bss dec hex filename
    36037 247 100 36384 8e20 drivers/net/myri10ge/myri10ge.o

    on my i686 system, what should also make myri10ge_clean_rx_done()
    being faster.

    Signed-off-by: Stanislaw Gruszka
    Signed-off-by: David S. Miller

    Stanislaw Gruszka
     
  • The mac address of the bridge device may be changed when a new interface
    is added to the bridge. If this happens, then the bridge needs to call
    the network notifiers to tickle any other systems that care. Since bridge
    can be a module, this also means exporting the notifier function.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • The current handling of echoed IP timestamp options with prespecified
    addresses is rather broken since the 2.2.x kernels. As far as i understand
    it, it should behave like when originating packets.

    Currently it will only timestamp the next free slot if:
    - there is space for *two* timestamps
    - some random data from the echoed packet taken as an IP is *not* a local IP

    This first is caused by an off-by-one error. 'soffset' points to the next
    free slot and so we only need to have 'soffset + 7
    Signed-off-by: David S. Miller

    Jan Luebbe
     
  • The current SocketCAN implementation for the Bosch c_can cell doesn't
    account the TX bytes correctly, because it calls
    c_can_inval_msg_object() (which clears the msg ctrl register) before
    reading the DLC value:

    for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) {
    msg_obj_no = get_tx_echo_msg_obj(priv);
    c_can_inval_msg_object(dev, 0, msg_obj_no);
    val = c_can_read_reg32(priv, &priv->regs->txrqst1);
    if (!(val & (1 << msg_obj_no))) {
    can_get_echo_skb(dev,
    msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST);
    stats->tx_bytes += priv->read_reg(priv,
    &priv->regs->ifregs[0].msg_cntrl)
    & IF_MCONT_DLC_MASK;
    stats->tx_packets++;
    }
    }

    So, we will always read 0 for the DLC value and "ifconfig" will report
    *0* TX Bytes.

    The fix is quite easy: Just move c_can_inval_msg_object() to the end of
    the if() statement. So:
    * We only call c_can_inval_msg_object() if the message was
    actually transmitted
    * We read out the DLC value _before_ clearing the msg ctrl
    register

    Signed-off-by: Jan Altenberg
    Acked-by: Kurt Van Dijck
    Acked-by: Wolfgang Grandegger
    Signed-off-by: David S. Miller

    Jan Altenberg
     
  • This patch fixes the check in the probe function whether a IRQ was supplied
    to the driver. The original driver check the irq "struct resource *" against

    Cc: Bhupesh Sharma
    Signed-off-by: David S. Miller

    Marc Kleine-Budde
     
  • This patch disables the one shot mode, until the driver has been fixed and
    tested to support it.

    > I'm quite sure I've seen a situation where msg_obj 17 "seemed" to be
    > pending, while msg_obj 18 and 19 already have been transmitted. But
    > in that case, I enabled ONESHOT for the can interface, which enables
    > the DA mode (automatic retransmission is disabled).

    Reported-by: Jan Altenberg
    Signed-off-by: Marc Kleine-Budde
    Signed-off-by: Kurt Van Dijck
    Cc: Bhupesh Sharma
    Acked-by: Wolfgang Grandegger
    Signed-off-by: David S. Miller

    Marc Kleine-Budde
     
  • can_ioctl is the only reason for struct proto to be non-const.
    script/check-patch.pl suggests struct proto be const.

    Setting the reference to the common can_ioctl() in all CAN protocols directly
    removes the need to make the struct proto writable in af_can.c

    Signed-off-by: Kurt Van Dijck
    Signed-off-by: Oliver Hartkopp
    Signed-off-by: David S. Miller

    Oliver Hartkopp
     
  • The code itself can explain what it is doing, no need these comments.

    Signed-off-by: WANG Cong
    Signed-off-by: David S. Miller

    Amerigo Wang
     
  • Define some constant offsets for CALL_REQUEST based on the description
    at and the
    definition of ROSE as using 10-digit (5-byte) addresses. Use them
    consistently. Validate all implicit and explicit facilities lengths.
    Validate the address length byte rather than either trusting or
    assuming its value.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • When parsing the FAC_NATIONAL_DIGIS facilities field, it's possible for
    a remote host to provide more digipeaters than expected, resulting in
    heap corruption. Check against ROSE_MAX_DIGIS to prevent overflows, and
    abort facilities parsing on failure.

    Additionally, when parsing the FAC_CCITT_DEST_NSAP and
    FAC_CCITT_SRC_NSAP facilities fields, a remote host can provide a length
    of less than 10, resulting in an underflow in a memcpy size, causing a
    kernel panic due to massive heap corruption. A length of greater than
    20 results in a stack overflow of the callsign array. Abort facilities
    parsing on these invalid length values.

    Signed-off-by: Dan Rosenberg
    Cc: stable@kernel.org
    Signed-off-by: David S. Miller

    Dan Rosenberg
     
  • Length fields provided by a peer for names and attributes may be longer
    than the destination array sizes. Validate lengths to prevent stack
    buffer overflows.

    Signed-off-by: Dan Rosenberg
    Cc: stable@kernel.org
    Signed-off-by: David S. Miller

    Dan Rosenberg
     
  • Invalid nicknames containing only spaces will result in an underflow in
    a memcpy size calculation, subsequently destroying the heap and
    panicking.

    v2 also catches the case where the provided nickname is longer than the
    buffer size, which can result in controllable heap corruption.

    Signed-off-by: Dan Rosenberg
    Cc: stable@kernel.org
    Signed-off-by: David S. Miller

    Dan Rosenberg
     
  • We clone the child entry in skb_dst_pop before we call
    skb_dst_drop(). Otherwise we might kill the child right
    before we return it to the caller.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • Crypto requests might return asynchronous. In this case we leave
    the rcu protected region, so force a refcount on the skb's
    destination entry before we enter the xfrm type input/output
    handlers.

    This fixes a crash when a route is deleted whilst sending IPsec
    data that is transformed by an asynchronous algorithm.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     

26 Mar, 2011

1 commit


25 Mar, 2011

7 commits

  • When we set up the flow informations in ip_route_newports(), we take
    the address informations from the the rt_key_src and rt_key_dst fields
    of the rtable. They appear to be empty. So take the address
    informations from rt_src and rt_dst instead. This issue was introduced
    by commit 5e2b61f78411be25f0b84f97d5b5d312f184dfd1 ("ipv4: Remove
    flowi from struct rtable.")

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • Move the scope value out of the fib alias entries and into fib_info,
    so that we always use the correct scope when recomputing the nexthop
    cached source address.

    Reported-by: Julian Anastasov
    Signed-off-by: David S. Miller

    David S. Miller
     
  • Any operation that:

    1) Brings up an interface
    2) Adds an IP address to an interface
    3) Deletes an IP address from an interface

    can potentially invalidate the nh_saddr value, requiring
    it to be recomputed.

    Perform the recomputation lazily using a generation ID.

    Reported-by: Julian Anastasov
    Signed-off-by: David S. Miller

    David S. Miller
     
  • Fix section mismatch warning by renaming the pci_driver variable to a
    recognized (whitelisted) name.

    WARNING: drivers/net/pch_gbe/pch_gbe.o(.data+0x1f8): Section mismatch in reference from the variable pch_gbe_pcidev to the variable .devinit.rodata:pch_gbe_pcidev_id
    The variable pch_gbe_pcidev references
    the variable __devinitconst pch_gbe_pcidev_id
    If the reference is valid then annotate the
    variable with __init* or __refdata (see linux/init.h) or name the variable:
    *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

    Signed-off-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Randy Dunlap
     
  • Alessandro Suardi reported that we could not change route metrics :

    ip ro change default .... advmss 1400

    This regression came with commit 9c150e82ac50 (Allocate fib metrics
    dynamically). fib_metrics is no longer an array, but a pointer to an
    array.

    Reported-by: Alessandro Suardi
    Signed-off-by: Eric Dumazet
    Tested-by: Alessandro Suardi
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Avoiding abuse of ethtool_drvinfo.driver field.
    HW specific info can be retrieved using lspci.

    Signed-off-by: Yevgeny Petrilin
    Signed-off-by: David S. Miller

    Yevgeny Petrilin
     
  • David S. Miller
     

24 Mar, 2011

5 commits

  • commit fd245a4adb52 (net_sched: move TCQ_F_THROTTLED flag)
    added a race.

    qdisc_watchdog() is run from softirq, so special care should be taken or
    we can lose one state transition (THROTTLED/RUNNING)

    Prior to fd245a4adb52, we were manipulating q->flags (qdisc->flags &=
    ~TCQ_F_THROTTLED;) and this manipulation could only race with
    qdisc_warn_nonwc().

    Since we want to avoid atomic ops in qdisc fast path - it was the
    meaning of commit 371121057607e (QDISC_STATE_RUNNING dont need atomic
    bit ops) - fix is to move THROTTLE bit into 'state' field, this one
    being manipulated with SMP and IRQ safe operations.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • David S. Miller
     
  • Request_mem_region should be used with release_mem_region, not
    release_resource.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,E;
    @@
    *x = request_mem_region(...)
    ... when != release_mem_region(x)
    when != x = E
    * release_resource(x);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Request_mem_region should be used with release_mem_region, not
    release_resource.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,E;
    @@
    *x = request_mem_region(...)
    ... when != release_mem_region(x)
    when != x = E
    * release_resource(x);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • This prevents possible race between bond_enslave and bond_handle_frame
    as reported by Nicolas by moving rx_handler register/unregister.
    slave->bond is added to hold pointer to master bonding sructure. That
    way dev->master is no longer used in bond_handler_frame.
    Also, this removes "BUG: scheduling while atomic" message

    Reported-by: Nicolas de Pesloüan
    Signed-off-by: Jiri Pirko
    Signed-off-by: Andy Gospodarek
    Tested-by: Nicolas de Pesloüan
    Signed-off-by: David S. Miller

    Jiri Pirko