1. 06 Apr, 2007 17 commits
    • Mikael Pettersson's avatar
      SPARC: Fix sparc builds with gcc-4.2.x · f85ca20e
      Mikael Pettersson authored
      [SPARC]: sparc64 gcc-4.2.0 20070317 -Werror failure
      
      Compiling 2.6.21-rc5 with gcc-4.2.0 20070317 (prerelease)
      for sparc64 fails as follows:
      
        gcc -Wp,-MD,arch/sparc64/kernel/.time.o.d  -nostdinc -isystem /home/mikpe/pkgs/linux-sparc64/gcc-4.2.0/lib/gcc/sparc64-unknown-linux-gnu/4.2.0/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs -fomit-frame-pointer  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -Werror   -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(time)"  -D"KBUILD_MODNAME=KBUILD_STR(time)" -c -o arch/sparc64/kernel/time.o arch/sparc64/kernel/time.c
      cc1: warnings being treated as errors
      arch/sparc64/kernel/time.c: In function 'kick_start_clock':
      arch/sparc64/kernel/time.c:559: warning: overflow in implicit constant conversion
      make[1]: *** [arch/sparc64/kernel/time.o] Error 1
      make: *** [arch/sparc64/kernel] Error 2
      
      gcc gets unhappy when the MSTK_SET macro's u8 __val variable
      is updated with &= ~0xff (MSTK_YEAR_MASK). Making the constant
      unsigned fixes the problem.
      
      [ I fixed up the sparc32 side as well -DaveM ]
      Signed-off-by: default avatarMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f85ca20e
    • Alexey Dobriyan's avatar
      NET: Fix sock_attach_fd() failure in sys_accept() · 4870b7bf
      Alexey Dobriyan authored
      [NET]: Correct accept(2) recovery after sock_attach_fd()
      
      * d_alloc() in sock_attach_fd() fails leaving ->f_dentry of new file NULL
      * bail out to out_fd label, doing fput()/__fput() on new file
      * but __fput() assumes valid ->f_dentry and dereferences it
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4870b7bf
    • David Miller's avatar
      VIDEO: Fix FFB DAC revision probing · cb8b4fce
      David Miller authored
      [VIDEO] ffb: Fix two DAC handling bugs.
      
      The determination of whether the DAC has inverted cursor logic is
      broken, import the version checks the X.org driver uses to fix this.
      
      Next, when we change the timing generator, borrow code from X.org that
      does 10 NOP reads of the timing generator register afterwards to make
      sure the video-enable transition occurs cleanly.
      
      Finally, use macros for the DAC registers and fields in order to
      provide documentation for the next person who reads this code.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      cb8b4fce
    • Arnaldo Carvalho de Melo's avatar
      DCCP: Fix exploitable hole in DCCP socket options · 4eb3dd59
      Arnaldo Carvalho de Melo authored
      [DCCP] getsockopt: Fix DCCP_SOCKOPT_[SEND,RECV]_CSCOV
      
      We were only checking if there was enough space to put the int, but
      left len as specified by the (malicious) user, sigh, fix it by setting
      len to sizeof(val) and transfering just one int worth of data, the one
      asked for.
      
      Also check for negative len values.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4eb3dd59
    • G. Liakhovetski's avatar
      PPP: Fix PPP skb leak · 6fcc93a7
      G. Liakhovetski authored
      [PPP]: Don't leak an sk_buff on interface destruction.
      Signed-off-by: default avatarG. Liakhovetski <gl@dsa-ac.de>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6fcc93a7
    • David Miller's avatar
      IPV6: Fix ipv6 round-robin locking. · 00d3a802
      David Miller authored
      [IPV6]: Fix routing round-robin locking.
      
      As per RFC2461, section 6.3.6, item #2, when no routers on the
      matching list are known to be reachable or probably reachable we
      do round robin on those available routes so that we make sure
      to probe as many of them as possible to detect when one becomes
      reachable faster.
      
      Each routing table has a rwlock protecting the tree and the linked
      list of routes at each leaf.  The round robin code executes during
      lookup and thus with the rwlock taken as a reader.  A small local
      spinlock tries to provide protection but this does not work at all
      for two reasons:
      
      1) The round-robin list manipulation, as coded, goes like this (with
         read lock held):
      
      	walk routes finding head and tail
      
      	spin_lock();
      	rotate list using head and tail
      	spin_unlock();
      
         While one thread is rotating the list, another thread can
         end up with stale values of head and tail and then proceed
         to corrupt the list when it gets the lock.  This ends up causing
         the OOPS in fib6_add() later onthat many people have been hitting.
      
      2) All the other code paths that run with the rwlock held as
         a reader do not expect the list to change on them, they
         expect it to remain completely fixed while they hold the
         lock in that way.
      
      So, simply stated, it is impossible to implement this correctly using
      a manipulation of the list without violating the rwlock locking
      semantics.
      
      Reimplement using a per-fib6_node round-robin pointer.  This way we
      don't need to manipulate the list at all, and since the round-robin
      pointer can only ever point to real existing entries we don't need
      to perform any locking on the changing of the round-robin pointer
      itself.  We only need to reset the round-robin pointer to NULL when
      the entry it is pointing to is removed.
      
      The idea is from Thomas Graf and it is very similar to how this
      was implemented before the advanced router selection code when in.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00d3a802
    • Patrick McHardy's avatar
      NET_SCHED: Fix ingress qdisc locking. · 5d50dcec
      Patrick McHardy authored
      [NET_SCHED]: Fix ingress locking
      
      Ingress queueing uses a seperate lock for serializing enqueue operations,
      but fails to properly protect itself against concurrent changes to the
      qdisc tree. Use queue_lock for now since the real fix it quite intrusive.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5d50dcec
    • Patrick McHardy's avatar
      NET: Fix packet classidier NULL pointer OOPS · 04301ff6
      Patrick McHardy authored
      [NET_SCHED]: cls_basic: fix NULL pointer dereference
      
      cls_basic doesn't allocate tp->root before it is linked into the
      active classifier list, resulting in a NULL pointer dereference
      when packets hit the classifier before its ->change function is
      called.
      
      Reported by Chris Madden <chris@reflexsecurity.com>
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      04301ff6
    • Stefan Richter's avatar
      ieee1394: dv1394: fix CardBus card ejection · 04117289
      Stefan Richter authored
      Fix NULL pointer dereference on hot ejection of a FireWire card while
      dv1394 was loaded.  http://bugzilla.kernel.org/show_bug.cgi?id=7121
      I did not test card ejection with open /dev/dv1394 files yet.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      04117289
    • Paolo 'Blaisorblade' Giarrusso's avatar
      uml: fix unreasonably long udelay · 16ad6a90
      Paolo 'Blaisorblade' Giarrusso authored
      Currently we have a confused udelay implementation.
      
      * __const_udelay does not accept usecs but xloops in i386 and x86_64
      * our implementation requires usecs as arg
      * it gets a xloops count when called by asm/arch/delay.h
      
      Bugs related to this (extremely long shutdown times) where reported by some
      x86_64 users, especially using Device Mapper.
      
      To hit this bug, a compile-time constant time parameter must be passed - that's
      why UML seems to work most times.
      Fix this with a simple udelay implementation.
      Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      16ad6a90
    • Jeff Dike's avatar
      UML - use correct register file size everywhere · 93420eaf
      Jeff Dike authored
      This patch uses MAX_REG_NR consistently to refer to the register file
      size.  FRAME_SIZE isn't sufficient because on x86_64, it is smaller
      than the ptrace register file size.  MAX_REG_NR was introduced as a
      consistent way to get the number of registers, but wasn't used
      everywhere it should be.
      
      When this causes a problem, it makes PTRACE_SETREGS fail on x86_64
      because of a corrupted segment register value in the known-good
      register file. The patch also adds a register dump at that point in
      case there are any future problems here.
      Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      93420eaf
    • Jeff Dike's avatar
      UML - Fix static linking · b40b478e
      Jeff Dike authored
      During a static link, ld has started putting a .note section in the
      .uml.setup.init section.  This has the result that the UML setups
      begin with 32 bytes of garbage and UML crashes immediately on boot.
      
      This patch creates a specific .note section for ld to drop this stuff
      into.
      Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b40b478e
    • Jeff Dike's avatar
      UML - host VDSO fix · 6f601709
      Jeff Dike authored
      This fixes a problem seen by a number of people running UML on newer host
      kernels.  init would hang with an infinite segfault loop.
      
      It turns out that the host kernel was providing a AT_SYSINFO_EHDR of
      0xffffe000, which faked UML into believing that the host VDSO page could be
      reused.  However, AT_SYSINFO pointed into the middle of the address space, and
      was unmapped as a result.  Because UML was providing AT_SYSINFO_EHDR and
      AT_SYSINFO to its own processes, these would branch to nowhere when trying to
      use the VDSO.
      
      The fix is to also check the location of AT_SYSINFO when deciding whether to
      use the host's VDSO.
      Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6f601709
    • Jeff Dike's avatar
      UML - fix epoll · edfcf73f
      Jeff Dike authored
      UML/x86_64 needs the same packing of struct epoll_event as x86_64.
      Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      edfcf73f
    • Robert Hancock's avatar
      sata_nv: delay on switching between NCQ and non-NCQ commands · 83b72f1c
      Robert Hancock authored
      sata_nv: delay on switching between NCQ and non-NCQ commands
      
      This patch appears to solve some problems with commands timing out in
      cases where an NCQ command is immediately followed by a non-NCQ command
      (or possibly vice versa). This is a rather ugly solution, but until we
      know more about why this is needed, this is about all we can do.
      
      [backport to 2.6.20 by Chuck Ebbert <cebbert@redhat.com>]
      Signed-off-by: default avatarRobert Hancock <hancockr@shaw.ca>
      Cc: Chuck Ebbert <cebbert@redhat.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      
      83b72f1c
    • Albert Lee's avatar
      ide: remove clearing bmdma status from cdrom_decode_status() (rev #4) · 9f6a92b4
      Albert Lee authored
      ide: remove clearing bmdma status from cdrom_decode_status() (rev #4)
      
      patch 2/2:
        Remove clearing bmdma status from cdrom_decode_status() since ATA devices
        might need it as well.
      
        (http://lkml.org/lkml/2006/12/4/201 and http://lkml.org/lkml/2006/11/15/94)
      Signed-off-by: default avatarAlbert Lee <albertcc@tw.ibm.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: "Adam W. Hawks" <awhawks@us.ibm.com>
      Cc: Chuck Ebbert <cebbert@redhat.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9f6a92b4
    • Albert Lee's avatar
      ide: clear bmdma status in ide_intr() for ICHx controllers (revised #4) · 9757c1a0
      Albert Lee authored
      ide: clear bmdma status in ide_intr() for ICHx controllers (revised #4)
      
      patch 1/2 (revised):
      - Fix drive->waiting_for_dma to work with CDB-intr devices.
      - Do the dma status clearing in ide_intr() and add a new
        hwif->ide_dma_clear_irq for Intel ICHx controllers.
      
      Revised per Alan, Sergei and Bart's advice.
      
      Patch against 2.6.20-rc6. Tested ok on my ICH4 and pdc20275 adapters.
      Please review/apply, thanks.
      Signed-off-by: default avatarAlbert Lee <albertcc@tw.ibm.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Adam Hawks <awhawks@us.ibm.com>
      Cc: Chuck Ebbert <cebbert@redhat.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9757c1a0
  2. 23 Mar, 2007 23 commits