11 Mar, 2011

1 commit

  • When configs BRIDGE=y and IPV6=m, this build error occurs:

    br_multicast.c:(.text+0xa3341): undefined reference to `ipv6_dev_get_saddr'

    BRIDGE_IGMP_SNOOPING is boolean; if it were tristate, then adding
    depends on IPV6 || IPV6=n
    to BRIDGE_IGMP_SNOOPING would be a good fix. As it is currently,
    making BRIDGE depend on the IPV6 config works.

    Reported-by: Patrick Schaaf
    Signed-off-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Randy Dunlap
     

10 Mar, 2011

3 commits

  • Addresses https://bugzilla.kernel.org/show_bug.cgi?id=29252
    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=30462

    In commit d80bc0fd262ef840ed4e82593ad6416fa1ba3fc4 ("ipv6: Always
    clone offlink routes.") we forced the kernel to always clone offlink
    routes.

    The reason we do that is to make sure we never bind an inetpeer to a
    prefixed route.

    The logic turned on here has existed in the tree for many years,
    but was always off due to a protecting CPP define. So perhaps
    it's no surprise that there is a logic bug here.

    The problem is that we canot clone a route that is already a
    host route (ie. has DST_HOST set). Because if we do, an identical
    entry already exists in the routing tree and therefore the
    ip6_rt_ins() call is going to fail.

    This sets off a series of failures and high cpu usage, because when
    ip6_rt_ins() fails we loop retrying this operation a few times in
    order to handle a race between two threads trying to clone and insert
    the same host route at the same time.

    Fix this by simply using the route as-is when DST_HOST is set.

    Reported-by: slash@ac.auone-net.jp
    Reported-by: Ernst Sjöstrand
    Signed-off-by: David S. Miller

    David S. Miller
     
  • The units in show_results in pktgen were not correct.
    The results are in usec but it was displayed nsec.

    Reported-by: Jong-won Lee
    Signed-off-by: Daniel Turull
    Signed-off-by: David S. Miller

    Daniel Turull
     
  • In usual cases ifa_address == ifa_local, but in the case where
    SIOCSIFDSTADDR sets the destination address on a point-to-point
    link, ifa_address gets set to that destination address.

    Therefore we should use ifa_local when we want the local interface
    address.

    There were two cases where the selection was done incorrectly:

    1) When devinet_ioctl() does matching, it checks ifa_address even
    though gifconf correct reported ifa_local to the user

    2) IN_DEV_ARP_NOTIFY handling sends a gratuitous ARP using
    ifa_address instead of ifa_local.

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

    David S. Miller
     

09 Mar, 2011

4 commits

  • Exar has exited the 10G Ethernet NIC market, orphaning both the s2io and
    vxge drivers. With the promise of free hardware, I'll take over
    maintainership.

    Signed-off-by: Jon Mason
    Signed-off-by: David S. Miller

    Jon Mason
     
  • Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Florian Fainelli
     
  • The original code does not work well when the number of mulitcast
    address to handle is greater than MCAST_MAX. It only enable promiscous
    mode instead of multicast hash table mode, so the hash table function
    will not be activated and all multicast frames will be recieved in this
    condition.

    This patch fixes the following issues with the r6040 NIC operating in
    multicast:

    1) When the IFF_ALLMULTI flag is set, we should write 0xffff to the NIC
    hash table registers to make it process multicast traffic.

    2) When the number of multicast address to handle is smaller than
    MCAST_MAX, we should use the NIC multicast registers MID1_{L,M,H}.

    3) The hashing of the address was not correct, due to an invalid
    substraction (15 - (crc & 0x0f)) instead of (crc & 0x0f) and an
    incorrect crc algorithm (ether_crc_le) instead of (ether_crc).

    4) If necessary, we should set HASH_EN flag in MCR0 to enable multicast
    hash table function.

    Reported-by: Marc Leclerc
    Tested-by: Marc Leclerc
    Signed-off-by: Shawn Lin
    Signed-off-by: Albert Chen
    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Shawn Lin
     
  • Recently had this bug halt reported to me:

    kernel BUG at net/rds/send.c:329!
    Oops: Exception in kernel mode, sig: 5 [#1]
    SMP NR_CPUS=1024 NUMA pSeries
    Modules linked in: rds sunrpc ipv6 dm_mirror dm_region_hash dm_log ibmveth sg
    ext4 jbd2 mbcache sd_mod crc_t10dif ibmvscsic scsi_transport_srp scsi_tgt
    dm_mod [last unloaded: scsi_wait_scan]
    NIP: d000000003ca68f4 LR: d000000003ca67fc CTR: d000000003ca8770
    REGS: c000000175cab980 TRAP: 0700 Not tainted (2.6.32-118.el6.ppc64)
    MSR: 8000000000029032 CR: 44000022 XER: 00000000
    TASK = c00000017586ec90[1896] 'krdsd' THREAD: c000000175ca8000 CPU: 0
    GPR00: 0000000000000150 c000000175cabc00 d000000003cb7340 0000000000002030
    GPR04: ffffffffffffffff 0000000000000030 0000000000000000 0000000000000030
    GPR08: 0000000000000001 0000000000000001 c0000001756b1e30 0000000000010000
    GPR12: d000000003caac90 c000000000fa2500 c0000001742b2858 c0000001742b2a00
    GPR16: c0000001742b2a08 c0000001742b2820 0000000000000001 0000000000000001
    GPR20: 0000000000000040 c0000001742b2814 c000000175cabc70 0800000000000000
    GPR24: 0000000000000004 0200000000000000 0000000000000000 c0000001742b2860
    GPR28: 0000000000000000 c0000001756b1c80 d000000003cb68e8 c0000001742b27b8
    NIP [d000000003ca68f4] .rds_send_xmit+0x4c4/0x8a0 [rds]
    LR [d000000003ca67fc] .rds_send_xmit+0x3cc/0x8a0 [rds]
    Call Trace:
    [c000000175cabc00] [d000000003ca67fc] .rds_send_xmit+0x3cc/0x8a0 [rds]
    (unreliable)
    [c000000175cabd30] [d000000003ca7e64] .rds_send_worker+0x54/0x100 [rds]
    [c000000175cabdb0] [c0000000000b475c] .worker_thread+0x1dc/0x3c0
    [c000000175cabed0] [c0000000000baa9c] .kthread+0xbc/0xd0
    [c000000175cabf90] [c000000000032114] .kernel_thread+0x54/0x70
    Instruction dump:
    4bfffd50 60000000 60000000 39080001 935f004c f91f0040 41820024 813d017c
    7d094a78 7d290074 7929d182 394a0020 40e2ff68 4bffffa4 39200000
    Kernel panic - not syncing: Fatal exception
    Call Trace:
    [c000000175cab560] [c000000000012e04] .show_stack+0x74/0x1c0 (unreliable)
    [c000000175cab610] [c0000000005a365c] .panic+0x80/0x1b4
    [c000000175cab6a0] [c00000000002fbcc] .die+0x21c/0x2a0
    [c000000175cab750] [c000000000030000] ._exception+0x110/0x220
    [c000000175cab910] [c000000000004b9c] program_check_common+0x11c/0x180

    Signed-off-by: David S. Miller

    Neil Horman
     

08 Mar, 2011

6 commits

  • Rename the rx_machine_lock to state_machine_lock as this makes more
    sense in light of it now protecting all the state machines against
    concurrency.

    Signed-off-by: Nils Carlson
    Signed-off-by: David S. Miller

    Nils Carlson
     
  • Changes since v1:
    * Clarify an unclear comment
    * Move a (possible) name change to a separate patch

    The ad_rx_machine, ad_periodic_machine and ad_port_selection_logic
    functions all inspect and alter common fields within the port structure.
    Previous to this patch, only the ad_rx_machines were mutexed, and the
    periodic and port_selection could run unmutexed against an ad_rx_machine
    trigged by an arriving LACPDU.

    This patch remedies the situation by protecting all the state machines
    from concurrency. This is accomplished by locking around all the state
    machines for a given port, which are executed at regular intervals; and
    the ad_rx_machine when handling an incoming LACPDU.

    Signed-off-by: Nils Carlson
    Signed-off-by: David S. Miller

    Nils Carlson
     
  • 'len' is unsigned of type size_t and can't be negative.

    Signed-off-by: Nicolas Kaiser
    Acked-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Nicolas Kaiser
     
  • The unix_dgram_recvmsg and unix_stream_recvmsg routines in
    net/af_unix.c utilize mutex_lock(&u->readlock) calls in order to
    serialize read operations of multiple threads on a single socket. This
    implies that, if all n threads of a process block in an AF_UNIX recv
    call trying to read data from the same socket, one of these threads
    will be sleeping in state TASK_INTERRUPTIBLE and all others in state
    TASK_UNINTERRUPTIBLE. Provided that a particular signal is supposed to
    be handled by a signal handler defined by the process and that none of
    this threads is blocking the signal, the complete_signal routine in
    kernel/signal.c will select the 'first' such thread it happens to
    encounter when deciding which thread to notify that a signal is
    supposed to be handled and if this is one of the TASK_UNINTERRUPTIBLE
    threads, the signal won't be handled until the one thread not blocking
    on the u->readlock mutex is woken up because some data to process has
    arrived (if this ever happens). The included patch fixes this by
    changing mutex_lock to mutex_lock_interruptible and handling possible
    error returns in the same way interruptions are handled by the actual
    receive-code.

    Signed-off-by: Rainer Weikusat
    Signed-off-by: David S. Miller

    Rainer Weikusat
     
  • exthdrs_core.c and addrconf_core.c in net/ipv6/ contain bits which
    must be made available even if IPv6 is disabled.

    net/ipv6/Makefile already correctly includes them if CONFIG_IPV6=n
    but net/Makefile prevents entering the subdirectory.

    Signed-off-by: Thomas Graf
    Acked-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • The smsc911x driver would drop frames longer than 1518 bytes, which is a
    problem for networks with VLAN tagging. The VLAN1 tag register is used
    to increase the legal frame size to 1522 when a VLAN tag is identified.

    Signed-off-by: Göran Weinholt
    Signed-off-by: David S. Miller

    Göran Weinholt
     

07 Mar, 2011

4 commits


04 Mar, 2011

10 commits

  • …s/security-testing-2.6

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
    DNS: Fix a NULL pointer deref when trying to read an error key [CVE-2011-1076]

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (42 commits)
    MAINTAINERS: Add Andy Gospodarek as co-maintainer.
    r8169: disable ASPM
    RxRPC: Fix v1 keys
    AF_RXRPC: Handle receiving ACKALL packets
    cnic: Fix lost interrupt on bnx2x
    cnic: Prevent status block race conditions with hardware
    net: dcbnl: check correct ops in dcbnl_ieee_set()
    e1000e: disable broken PHY wakeup for ICH10 LOMs, use MAC wakeup instead
    igb: fix sparse warning
    e1000: fix sparse warning
    netfilter: nf_log: avoid oops in (un)bind with invalid nfproto values
    dccp: fix oops on Reset after close
    ipvs: fix dst_lock locking on dest update
    davinci_emac: Add Carrier Link OK check in Davinci RX Handler
    bnx2x: update driver version to 1.62.00-6
    bnx2x: properly calculate lro_mss
    bnx2x: perform statistics "action" before state transition.
    bnx2x: properly configure coefficients for MinBW algorithm (NPAR mode).
    bnx2x: Fix ethtool -t link test for MF (non-pmf) devices.
    bnx2x: Fix nvram test for single port devices.
    ...

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    block: kill loop_mutex
    blktrace: Remove blk_fill_rwbs_rq.
    block: blk-flush shouldn't call directly into q->request_fn() __blk_run_queue()
    block: add @force_kblockd to __blk_run_queue()
    block: fix kernel-doc format for blkdev_issue_zeroout
    blk-throttle: Do not use kblockd workqueue for throtl work

    Linus Torvalds
     
  • * 'i_nlink' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    hfs: fix rename() over non-empty directory
    udf: fix i_nlink limit
    fix reiserfs mkdir() breakage
    exofs: i_nlink races in rename()
    nilfs2: i_nlink races in rename()
    minix: i_nlink races in rename()
    ufs: i_nlink races in rename()
    sysv: i_nlink races in rename()

    Linus Torvalds
     
  • When a DNS resolver key is instantiated with an error indication, attempts to
    read that key will result in an oops because user_read() is expecting there to
    be a payload - and there isn't one [CVE-2011-1076].

    Give the DNS resolver key its own read handler that returns the error cached in
    key->type_data.x[0] as an error rather than crashing.

    Also make the kenter() at the beginning of dns_resolver_instantiate() limit the
    amount of data it prints, since the data is not necessarily NUL-terminated.

    The buggy code was added in:

    commit 4a2d789267e00b5a1175ecd2ddefcc78b83fbf09
    Author: Wang Lei
    Date: Wed Aug 11 09:37:58 2010 +0100
    Subject: DNS: If the DNS server returns an error, allow that to be cached [ver #2]

    This can trivially be reproduced by any user with the following program
    compiled with -lkeyutils:

    #include
    #include
    #include
    static char payload[] = "#dnserror=6";
    int main()
    {
    key_serial_t key;
    key = add_key("dns_resolver", "a", payload, sizeof(payload),
    KEY_SPEC_SESSION_KEYRING);
    if (key == -1)
    err(1, "add_key");
    if (keyctl_read(key, NULL, 0) == -1)
    err(1, "read_key");
    return 0;
    }

    What should happen is that keyctl_read() reports error 6 (ENXIO) to the user:

    dns-break: read_key: No such device or address

    but instead the kernel oopses.

    This cannot be reproduced with the 'keyutils add' or 'keyutils padd' commands
    as both of those cut the data down below the NUL termination that must be
    included in the data. Without this dns_resolver_instantiate() will return
    -EINVAL and the key will not be instantiated such that it can be read.

    The oops looks like:

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
    IP: [] user_read+0x4f/0x8f
    PGD 3bdf8067 PUD 385b9067 PMD 0
    Oops: 0000 [#1] SMP
    last sysfs file: /sys/devices/pci0000:00/0000:00:19.0/irq
    CPU 0
    Modules linked in:

    Pid: 2150, comm: dns-break Not tainted 2.6.38-rc7-cachefs+ #468 /DG965RY
    RIP: 0010:[] [] user_read+0x4f/0x8f
    RSP: 0018:ffff88003bf47f08 EFLAGS: 00010246
    RAX: 0000000000000001 RBX: ffff88003b5ea378 RCX: ffffffff81972368
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88003b5ea378
    RBP: ffff88003bf47f28 R08: ffff88003be56620 R09: 0000000000000000
    R10: 0000000000000395 R11: 0000000000000002 R12: 0000000000000000
    R13: 0000000000000000 R14: 0000000000000000 R15: ffffffffffffffa1
    FS: 00007feab5751700(0000) GS:ffff88003e000000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000010 CR3: 000000003de40000 CR4: 00000000000006f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process dns-break (pid: 2150, threadinfo ffff88003bf46000, task ffff88003be56090)
    Stack:
    ffff88003b5ea378 ffff88003b5ea3a0 0000000000000000 0000000000000000
    ffff88003bf47f68 ffffffff811b708e ffff88003c442bc8 0000000000000000
    00000000004005a0 00007fffba368060 0000000000000000 0000000000000000
    Call Trace:
    [] keyctl_read_key+0xac/0xcf
    [] sys_keyctl+0x75/0xb6
    [] system_call_fastpath+0x16/0x1b
    Code: 75 1f 48 83 7b 28 00 75 18 c6 05 58 2b fb 00 01 be bb 00 00 00 48 c7 c7 76 1c 75 81 e8 13 c2 e9 ff 4c 8b b3 e0 00 00 00 4d 85 ed 0f b7 5e 10 74 2d 4d 85 e4 74 28 e8 98 79 ee ff 49 39 dd 48
    RIP [] user_read+0x4f/0x8f
    RSP
    CR2: 0000000000000010

    Signed-off-by: David Howells
    Acked-by: Jeff Layton
    cc: Wang Lei
    Signed-off-by: James Morris

    David Howells
     
  • Acked-by: Andy Gospodarek

    Signed-off-by: David S. Miller

    Jay Vosburgh
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    xfs: zero proper structure size for geometry calls

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
    nilfs2: fix regression that i-flag is not set on changeless checkpoints

    Linus Torvalds
     
  • For some time is known that ASPM is causing troubles on r8169, i.e. make
    device randomly stop working without any errors in dmesg.

    Currently Tomi Leppikangas reports that system with r8169 device hangs
    with MCE errors when ASPM is enabled:
    https://bugzilla.redhat.com/show_bug.cgi?id=642861#c4

    Lets disable ASPM for r8169 devices at all, to avoid problems with
    r8169 PCIe devices at least for some users.

    Reported-by: Tomi Leppikangas
    Cc: stable@kernel.org
    Signed-off-by: Stanislaw Gruszka
    Signed-off-by: David S. Miller

    Stanislaw Gruszka
     
  • Following steps lead to deadlock in kernel:

    dd if=/dev/zero of=img bs=512 count=1000
    losetup -f img
    mkfs.ext2 /dev/loop0
    mount -t ext2 -o loop /dev/loop0 mnt
    umount mnt/

    Stacktrace:
    [] irq_exit+0x36/0x59
    [] smp_apic_timer_interrupt+0x6b/0x75
    [] apic_timer_interrupt+0x31/0x38
    [] mutex_spin_on_owner+0x54/0x5b
    [] lo_release+0x12/0x67 [loop]
    [] __blkdev_put+0x7c/0x10c
    [] fput+0xd5/0x1aa
    [] loop_clr_fd+0x1a9/0x1b1 [loop]
    [] lo_release+0x39/0x67 [loop]
    [] __blkdev_put+0x7c/0x10c
    [] deactivate_locked_super+0x17/0x36
    [] sys_umount+0x27e/0x2a5
    [] sys_oldumount+0xb/0xe
    [] sysenter_do_call+0x12/0x26
    [] 0xffffffff

    Regression since 2a48fc0ab24241755dc9, which introduced the private
    loop_mutex as part of the BKL removal process.

    As per [1], the mutex can be safely removed.

    [1] http://www.gossamer-threads.com/lists/linux/kernel/1341930

    Addresses: https://bugzilla.novell.com/show_bug.cgi?id=669394
    Addresses: https://bugzilla.kernel.org/show_bug.cgi?id=29172

    Signed-off-by: Petr Uzel
    Cc: stable@kernel.org
    Reviewed-by: Nikanth Karthikesan
    Acked-by: Arnd Bergmann
    Signed-off-by: Jens Axboe

    Petr Uzel
     

03 Mar, 2011

12 commits

  • If we enable trace events to trace block actions, We use
    blk_fill_rwbs_rq to analyze the corresponding actions
    in request's cmd_flags, but we only choose the minor 2 bits
    from it, so most of other flags(e.g, REQ_SYNC) are missing.
    For example, with a sync write we get:
    write_test-2409 [001] 160.013869: block_rq_insert: 3,64 W 0 () 258135 + =
    8 [write_test]

    Since now we have integrated the flags of both bio and request,
    it is safe to pass rq->cmd_flags directly to blk_fill_rwbs and
    blk_fill_rwbs_rq isn't needed any more.

    With this patch, after a sync write we get:
    write_test-2417 [000] 226.603878: block_rq_insert: 3,64 WS 0 () 258135 +=
    8 [write_test]

    Signed-off-by: Tao Ma
    Acked-by: Jeff Moyer
    Signed-off-by: Jens Axboe

    Tao Ma
     
  • merge hfs_unlink() and hfs_rmdir(), while we are at it.

    Signed-off-by: Al Viro

    Al Viro
     
  • (256 << sizeof(x)) - 1 is not the maximal possible value of x...
    In reality, the maximal allowed value for UDF FileLinkCount is
    65535.

    Signed-off-by: Al Viro

    Al Viro
     
  • if directory has so many subdirectories that its link count is set
    to 1 (i.e. "can't tell accurately") and reiserfs_new_inode() fails,
    we shouldn't decrement the parent's link count in cleanup path;
    that's what DEC_DIR_INODE_NLINK() is for. As it is, we end up
    with parent suddenly getting zero i_nlink, with very unpleasant
    effects.

    Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • commit 339412841d7 (RxRPC: Allow key payloads to be passed in XDR form)
    broke klog for me. I notice the v1 key struct had a kif_version field
    added:

    -struct rxkad_key {
    - u16 security_index; /* RxRPC header security index */
    - u16 ticket_len; /* length of ticket[] */
    - u32 expiry; /* time at which expires */
    - u32 kvno; /* key version number */
    - u8 session_key[8]; /* DES session key */
    - u8 ticket[0]; /* the encrypted ticket */
    -};

    +struct rxrpc_key_data_v1 {
    + u32 kif_version; /* 1 */
    + u16 security_index;
    + u16 ticket_length;
    + u32 expiry; /* time_t */
    + u32 kvno;
    + u8 session_key[8];
    + u8 ticket[0];
    +};

    However the code in rxrpc_instantiate strips it away:

    data += sizeof(kver);
    datalen -= sizeof(kver);

    Removing kif_version fixes my problem.

    Signed-off-by: Anton Blanchard
    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    Anton Blanchard
     
  • The OpenAFS server is now sending ACKALL packets, so we need to handle them.
    Otherwise we report a protocol error and abort.

    Signed-off-by: David Howells
    Signed-off-by: David S. Miller

    David Howells
     
  • * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm/i915: fix memory corruption with GM965 and >4GB RAM

    Linus Torvalds