Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on May 3, 2007
  1. @AdrianBunk


    AdrianBunk authored
Commits on May 1, 2007
  1. @AdrianBunk


    AdrianBunk authored
Commits on Apr 30, 2007
  1. @AdrianBunk

    [IPV6]: Disallow RH0 by default (CVE-2007-2242)

    AdrianBunk authored
    A security issue is emerging.  Disallow Routing Header Type 0 by default
    as we have been doing for IPv4.
    This version already includes a fix for the original patch.
    Signed-off-by: YOSHIFUJI Hideaki <>
    Signed-off-by: Adrian Bunk <>
  2. @AdrianBunk

    [NETLINK]: Infinite recursion in netlink (CVE-2007-1861)

    AdrianBunk authored
    Reply to NETLINK_FIB_LOOKUP messages were misrouted back to kernel,
    which resulted in infinite recursion and stack overflow.
    The bug is present in all kernel versions since the feature appeared.
    The patch also makes some minimal cleanup:
    1. Return something consistent (-ENOENT) when fib table is missing
    2. Do not crash when queue is empty (does not happen, but yet)
    3. Put result of lookup
    Sergey Vlasov:
    Oops fix
    Signed-off-by: Alexey Kuznetsov <>
    Signed-off-by: Sergey Vlasov <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
Commits on Apr 25, 2007
  1. @jirislaby @AdrianBunk

    Char: icom, mark __init as __devinit

    jirislaby authored AdrianBunk committed
    Two functions are called from __devinit context, but they are marked as
    __init. Fix this.
    Signed-off-by: Jiri Slaby <>
    Signed-off-by: Adrian Bunk <>
  2. @AdrianBunk

    aio: remove bare user-triggerable error printk

    Zach Brown authored AdrianBunk committed
    The user can generate console output if they cause do_mmap() to fail
    during sys_io_setup().  This was seen in a regression test that does
    exactly that by spinning calling mmap() until it gets -ENOMEM before
    calling io_setup().
    We don't need this printk at all, just remove it.
    Signed-off-by: Zach Brown <>
    Signed-off-by: Adrian Bunk <>
  3. @AdrianBunk

    mca_nmi_hook() can be called at any point

    Al Viro authored AdrianBunk committed
    ... and having it __init is a bad idea.
    Signed-off-by: Al Viro <>
    Signed-off-by: Adrian Bunk <>
  4. @AdrianBunk

    IrDA: irttp_dup spin_lock initialisation

    Guennadi Liakhovetski authored AdrianBunk committed
    Without this initialization one gets
    kernel BUG at kernel/rtmutex_common.h:80!
    Signed-off-by: G. Liakhovetski <>
    Signed-off-by: Samuel Ortiz <>
    Acked-by: David Miller <>
    Signed-off-by: Adrian Bunk <>
  5. @AdrianBunk

    IrDA: Incorrect TTP header reservation

    Jeet Chaudhuri authored AdrianBunk committed
    We must reserve SAR + MAX_HEADER bytes for IrLMP to fit in.
    This fixes an oops reported (and fixed) by Jeet Chaudhuri, when max_sdu_size
    is greater than 0.
    Signed-off-by: Samuel Ortiz <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
Commits on Apr 23, 2007
  1. @AdrianBunk

    x86 microcode: don't check the size

    Shaohua Li authored AdrianBunk committed
    IA32 manual says if micorcode update's size is 0, then the size is
    default size (2048 bytes). But this doesn't suggest all microcode
    update's size should be above 2048 bytes to me. We actually had a
    microcode update whose size is 1024 bytes. The patch just removed the
    Backported by Daniel Drake.
    Signed-off-by: Daniel Drake <>
    Signed-off-by: Adrian Bunk <>
Commits on Apr 22, 2007
  1. @AdrianBunk


    AdrianBunk authored
Commits on Apr 20, 2007
  1. @AdrianBunk


    AdrianBunk authored
  2. @aristeu @AdrianBunk

    tty_io: fix race in master pty close/slave pty close path

    aristeu authored AdrianBunk committed
    This patch fixes a possible race that leads to double freeing an idr index.
     When the master begin to close, release_dev() is called and then
    pty_close() is called:
            if (tty->driver->close)
                    tty->driver->close(tty, filp);
    This is done without helding any locks other than BKL.  Inside pty_close(),
    being a master close, the devpts entry will be removed:
    #ifdef CONFIG_UNIX98_PTYS
                    if (tty->driver == ptm_driver)
    But devpts_pty_kill() will call get_node() that may sleep while waiting for
    &devpts_root->d_inode->i_sem.  When this happens and the slave is being
    opened, tty_open() just found the driver and index:
            driver = get_tty_driver(device, &index);
            if (!driver) {
                    return -ENODEV;
    This part of the code is already protected under tty_mute.  The problem is
    that the slave close already got an index.  Then init_dev() is called and
    blocks waiting for the same &devpts_root->d_inode->i_sem.
    When the master close resumes, it removes the devpts entry, and the
    relation between idr index and the tty is gone.  The master then sleeps
    waiting for the tty_mutex on release_dev().
    Slave open resumes and found no tty for that index.  As result, a NULL tty
    is returned and init_dev() doesn't flow to fast_track:
            /* check whether we're reopening an existing tty */
            if (driver->flags & TTY_DRIVER_DEVPTS_MEM) {
                    tty = devpts_get_tty(idx);
                    if (tty && driver->subtype == PTY_TYPE_MASTER)
                            tty = tty->link;
            } else {
                    tty = driver->ttys[idx];
            if (tty) goto fast_track;
    The result of this, is that a new tty will be created and init_dev() returns
    sucessfull. After returning, tty_mutex is dropped and master close may resume.
    Master close finds it's the only use and both sides are closing, then releases
    the tty and the index. At this point, the idr index is free, but slave still
    has it.
    Slave open then calls pty_open() and finds that tty->link->count is 0,
    because there's no master and returns error.  Then tty_open() calls
    release_dev() which executes without any warning, as it was a case of last
    slave close when the master is already closed (master->count == 0,
    slave->count == 1).  The tty is then released with the already released idr
    This normally would only issue a warning on idr_remove() but in case of a
    customer's critical application, it's never too simple:
    thread1: opens master, gets index X
    thread1: begin closing master
    thread2: begin opening slave with index X
    thread1: finishes closing master, index X released
    thread3: opens master, gets index X, just released
    thread2: fails opening slave, releases index X         <----
    thread4: opens master, gets index X, init_dev() then find an already in use
             and healthy tty and fails
    If no more indexes are released, ptmx_open() will keep failing, as the
    first free index available is X, and it will make init_dev() fail because
    you're trying to "reopen a master" which isn't valid.
    The patch notices when this race happens and make init_dev() fail
    imediately.  The init_dev() function is called with tty_mutex held, so it's
    safe to continue with tty till the end of function because release_dev()
    won't make any further changes without grabbing the tty_mutex.
    Without the patch, on some machines it's possible get easily idr warnings
    like this one:
    idr_remove called for id=15 which is not allocated.
     [<c02555b9>] idr_remove+0x139/0x170
     [<c02a1b62>] release_mem+0x182/0x230
     [<c02a28e7>] release_dev+0x4b7/0x700
     [<c02a0ea7>] tty_ldisc_enable+0x27/0x30
     [<c02a1e64>] init_dev+0x254/0x580
     [<c02a0d64>] check_tty_count+0x14/0xb0
     [<c02a4f05>] tty_open+0x1c5/0x340
     [<c02a4d40>] tty_open+0x0/0x340
     [<c017388f>] chrdev_open+0xaf/0x180
     [<c017c2ac>] open_namei+0x8c/0x760
     [<c01737e0>] chrdev_open+0x0/0x180
     [<c0167bc9>] __dentry_open+0xc9/0x210
     [<c0167e2c>] do_filp_open+0x5c/0x70
     [<c0167a91>] get_unused_fd+0x61/0xd0
     [<c0167e93>] do_sys_open+0x53/0x100
     [<c0167f97>] sys_open+0x27/0x30
     [<c010303b>] syscall_call+0x7/0xb
    using this test application available on:
    Signed-off-by: Aristeu Sergio Rozanski Filho <>
    Signed-off-by: Adrian Bunk <>
  3. @AdrianBunk

    elevator: move clearing of unplug flag earlier

    Linas Vepstas authored AdrianBunk committed
    A flag was recently added to the elevator code to avoid
    performing an unplug when reuests are being re-queued.
    The goal of this flag was to avoid a deep recursion that
    can occur when re-queueing requests after a SCSI device/host
    reset.  See
    However, that fix added the flag near the bottom of a case
    statement, where an earlier break (in an if statement) could
    transport one out of the case, without setting the flag.
    This patch sets the flag earlier in the case statement.
    I re-discovered the deep recursion recently during testing;
    I was told that it was a known problem, and the fix to it was
    in the kernel I was testing. Indeed it was ... but it didn't
    fix the bug. With the patch below, I no longer see the bug.
    Signed-off by: Linas Vepstas <>
    Signed-off-by: Jens Axboe <>
    Signed-off-by: Adrian Bunk <>
  4. @ardje @AdrianBunk

    start_kernel: test if irq's got enabled early, barf, and disable them…

    ardje authored AdrianBunk committed
    … again
    The calls made by parse_parms to other initialization code might enable
    interrupts again way too early.
    Having interrupts on this early can make systems PANIC when they initialize
    the IRQ controllers (which happens later in the code).  This patch detects
    that irq's are enabled again, barfs about it and disables them again as a
    safety net.
    [ cleanups]
    Signed-off-by: Ard van Breemen <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Adrian Bunk <>
Commits on Apr 19, 2007
  1. @AdrianBunk

    [IrDA]: Correctly handling socket error

    Olaf Kirch authored AdrianBunk committed
    This patch fixes an oops first reported in mid 2006 - see The cause of this bug report is that
    when an error is signalled on the socket, irda_recvmsg_stream returns
    without removing a local wait_queue variable from the socket's sk_sleep
    queue. This causes havoc further down the road.
    In response to this problem, a patch was made that invoked sock_orphan on
    the socket when receiving a disconnect indication. This is not a good fix,
    as this sets sk_sleep to NULL, causing applications sleeping in recvmsg
    (and other places) to oops.
    Signed-off-by: Olaf Kirch <>
    Signed-off-by: Samuel Ortiz <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  2. @AdrianBunk

    hwmon/w83627ehf: Fix the fan5 clock divider write

    Jean Delvare authored AdrianBunk committed
    Users have been complaining about the w83627ehf driver flooding their logs
    with debug messages like:
    w83627ehf 9191-0a10: Increasing fan 4 clock divider from 64 to 128
    w83627ehf 9191-0290: Increasing fan 4 clock divider from 4 to 8
    The reason is that we failed to actually write the LSB of the encoded clock
    divider value for that fan, causing the next read to report the same old value
    again and again.
    Additionally, the fan number was improperly reported, making the bug harder to
    Signed-off-by: Jean Delvare <>
    Signed-off-by: Adrian Bunk <>
  3. @aubreyli @AdrianBunk

    [NET]: Fix UDP checksum issue in net poll mode.

    aubreyli authored AdrianBunk committed
    In net poll mode, the current checksum function doesn't consider the
    kind of packet which is padded to reach a specific minimum length. I
    believe that's the problem causing my test case failed. The following
    patch fixed this issue.
    Signed-off-by: Aubrey Li <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  4. @spotrh @AdrianBunk

    [SPARC64]: Fix inline directive in pci_iommu.c

    spotrh authored AdrianBunk committed
    While building a test kernel for the new esp driver (against
    git-current), I hit this bug. Trivial fix, put the inline declaration
    in the right place. :)
    Signed-off-by: Tom Callaway <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  5. @davem330 @AdrianBunk

    [SPARC64]: Fix arg passing to compat_sys_ipc().

    davem330 authored AdrianBunk committed
    Do not sign extend args using the sys32_ipc stub, that is
    buggy and unnecessary.
    Based upon an excellent report by Mikael Pettersson.
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  6. @davem330 @AdrianBunk

    [SPARC64]: Fix SBUS IOMMU allocation code.

    davem330 authored AdrianBunk committed
    There are several IOMMU allocator bugs.  Instead of trying to fix this
    overly complicated code, just mirror the PCI IOMMU arena allocator
    which is very stable and well stress tested.
    I tried to make the code as identical as possible so we can switch
    sun4u PCI and SBUS over to a common piece of IOMMU code.  All that
    will be need are two callbacks, one to do a full IOMMU flush and one
    to do a streaming buffer flush.
    This patch gets rid of a lot of hangs and mysterious crashes on SBUS
    sparc64 systems, at least for me.
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  7. @davem330 @AdrianBunk

    [SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.

    davem330 authored AdrianBunk committed
    We only map DMA when cmd->request_bufflen is non-zero for non-sg
    buffers, we thus should make the same check when unmapping.
    Based upon a report from Pasi Pirhonen.
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
Commits on Apr 15, 2007
  1. @AdrianBunk


    AdrianBunk authored
Commits on Apr 13, 2007
  1. @AdrianBunk


    AdrianBunk authored
  2. @kaber @AdrianBunk

    [NET_SCHED]: cls_tcindex: fix compatibility breakage

    kaber authored AdrianBunk committed
    Userspace uses an integer for TCA_TCINDEX_SHIFT, the kernel was changed
    to expect and use a u16 value in 2.6.11, which broke compatibility on
    big endian machines. Change back to use int.
    Reported by Ole Reinartz <>
    Signed-off-by: Patrick McHardy <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  3. @herbertx @AdrianBunk

    [IPSEC]: Reject packets within replay window but outside the bit mask

    herbertx authored AdrianBunk committed
    Up until this point we've accepted replay window settings greater than
    32 but our bit mask can only accomodate 32 packets.  Thus any packet
    with a sequence number within the window but outside the bit mask would
    be accepted.
    This patch causes those packets to be rejected instead.
    Signed-off-by: Herbert Xu <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  4. @AdrianBunk

    [TCP]: Do receiver-side SWS avoidance for rcvbuf < MSS.

    John Heffner authored AdrianBunk committed
    Signed-off-by: John Heffner <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  5. @AdrianBunk

    [IPv6]: Fix incorrect length check in rawv6_sendmsg()

    YOSHIFUJI Hideaki authored AdrianBunk committed
    In article <> (at Thu, 29 Mar 2007 14:26:44 -0700 (PDT)), David Miller <> says:
    > From: Sridhar Samudrala <>
    > Date: Thu, 29 Mar 2007 14:17:28 -0700
    > > The check for length in rawv6_sendmsg() is incorrect.
    > > As len is an unsigned int, (len < 0) will never be TRUE.
    > > I think checking for IPV6_MAXPLEN(65535) is better.
    > >
    > > Is it possible to send ipv6 jumbo packets using raw
    > > sockets? If so, we can remove this check.
    > I don't see why such a limitation against jumbo would exist,
    > does anyone else?
    > Thanks for catching this Sridhar.  A good compiler should simply
    > fail to compile "if (x < 0)" when 'x' is an unsigned type, don't
    > you think :-)
    Dave, we use "int" for returning value,
    so we should fix this anyway, IMHO;
    we should not allow len > INT_MAX.
    Signed-off-by: YOSHIFUJI Hideaki <>
    Acked-by: Sridhar Samudrala <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  6. @kaber @AdrianBunk

    [NET_SCHED]: cls_basic: fix memory leak in basic_destroy

    kaber authored AdrianBunk committed
    tp->root is not freed on destruction.
    Signed-off-by: Patrick McHardy <>
    Signed-off-by: David S. Miller <>
    Signed-off-by: Adrian Bunk <>
  7. @AdrianBunk

    V4L/DVB: Pluto2: fix incorrect TSCR register setting

    Andreas Oberritter authored AdrianBunk committed
    The ADEF bits in the TSCR register have different meanings in read and
    write mode. For this reason ADEF has to be reset on every
    read-modify-write operation.
    This patch introduces a special write function for this register, which
    takes care of it.
    Thanks to Holger Magnussen for pointing my nose at this problem.
    Signed-off-by: Andreas Oberritter <>
    Signed-off-by: Adrian Bunk <>
  8. @AdrianBunk

    V4L: saa7146: Fix allocation of clipping memory

    Oliver Endriss authored AdrianBunk committed
    Olaf Hering pointed out that SAA7146_CLIPPING_MEM would become
    very large for PAGE_SIZE > 4K.
    In fact, the number of clipping windows is limited to 16,
    and calculate_clipping_registers_rect() does not use more
    than 256 bytes. SAA7146_CLIPPING_MEM adjusted accordingly.
    (cherry picked from commit 7a7cd19)
    Thanks-to: Olaf Hering <>
    Signed-off-by: Oliver Endriss <>
    Signed-off-by: Michael Krufky <>
    Signed-off-by: Adrian Bunk <>
  9. @AdrianBunk

    V4L: radio: Fix error in Kbuild file

    Trent Piepho authored AdrianBunk committed
    All the radio drivers need video_dev, but they were depending on
    VIDEO_DEV!=n.  That meant that one could try to compile the driver into
    the kernel when VIDEO_DEV=m, which will not work.  If video_dev is a
    module, then the radio drivers must be modules too.
    (cherry picked from commit b10fece)
    Signed-off-by: Trent Piepho <>
    Signed-off-by: Michael Krufky <>
    Signed-off-by: Adrian Bunk <>
  10. @mkrufky @AdrianBunk

    V4L: tveeprom: autodetect LG TAPC G701D as tuner type 37

    mkrufky authored AdrianBunk committed
    Autodetect LG TAPC G701D as tuner type 37, fixing
    mis-detected tuners in some Hauppauge tv tuner cards.
    Thanks to Adonis Papas, for pointing this out.
    (cherry picked from commit 1323fbd)
    Signed-off-by: Michael Krufky <>
    Signed-off-by: Adrian Bunk <>
  11. @AdrianBunk

    sky2: turn on clocks when doing resume

    Stephen Hemminger authored AdrianBunk committed
    Some of these chips are disabled until clock is enabled.
    This fixes:
    Signed-off-by: Stephen Hemminger <>
    Signed-off-by: Adrian Bunk <>
  12. @AdrianBunk

    sky2: turn carrier off when down

    Stephen Hemminger authored AdrianBunk committed
    Driver needs to turn off carrier when down.
    Signed-off-by: Stephen Hemminger <>
    Signed-off-by: Adrian Bunk <>
Something went wrong with that request. Please try again.