Skip to content
  1. Feb 16, 2009
    • Yinghai Lu's avatar
      [IA64] fix __apci_unmap_table · 970ec1a8
      Yinghai Lu authored
      
      
      Impact: fix build error
      
      to fix:
      
        tip/arch/ia64/kernel/acpi.c:203: error: conflicting types for '__acpi_unmap_table'
        tip/include/linux/acpi.h:82: error: previous declaration of '__acpi_unmap_table' was here
        tip/arch/ia64/kernel/acpi.c:203: error: conflicting types for '__acpi_unmap_table'
        tip/include/linux/acpi.h:82: error: previous declaration of '__acpi_unmap_table' was here
      
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      970ec1a8
  2. Feb 11, 2009
  3. Feb 09, 2009
  4. Feb 08, 2009
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 · e83102ca
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
        PCI PM: make the PM core more careful with drivers using the new PM framework
        PCI PM: Read power state from device after trying to change it on resume
        PCI PM: Do not disable and enable bridges during suspend-resume
        PCI: PCIe portdrv: Simplify suspend and resume
        PCI PM: Fix saving of device state in pci_legacy_suspend
        PCI PM: Check if the state has been saved before trying to restore it
        PCI PM: Fix handling of devices without drivers
        PCI: return error on failure to read PCI ROMs
        PCI: properly clean up ASPM link state on device remove
      e83102ca
    • Rusty Russell's avatar
      module: remove over-zealous check in __module_get() · 7f9a50a5
      Rusty Russell authored
      
      
      Impact: fix spurious BUG_ON() triggered under load
      
      module_refcount() isn't reliable outside stop_machine(), as demonstrated
      by Karsten Keil <kkeil@suse.de>, networking can trigger it under load
      (an inc on one cpu and dec on another while module_refcount() is tallying
       can give false results, for example).
      
      Almost noone should be using __module_get, but that's another issue.
      
      Cc: Karsten Keil <kkeil@suse.de>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7f9a50a5
    • Linus Torvalds's avatar
      Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 · f12b12a8
      Linus Torvalds authored
      * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (30 commits)
        ACPI: Kconfig text - Fix the ACPI_CONTAINER module name according to the real module name.
        eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init
        ACPICA: Fix table entry truncation calculation
        ACPI: Enable bit 11 in _PDC to advertise hw coord
        ACPI: struct device - replace bus_id with dev_name(), dev_set_name()
        ACPI: add missing KERN_* constants to printks
        ACPI: dock: Don't eval _STA on every show_docked sysfs read
        ACPI: disable ACPI cleanly when bad RSDP found
        ACPI: delete CPU_IDLE=n code
        ACPI: cpufreq: Remove deprecated /proc/acpi/processor/../performance proc entries
        ACPI: make some IO ports off-limits to AML
        ACPICA: add debug dump of BIOS _OSI strings
        ACPI: proc_dir_entry 'video/VGA' already registered
        ACPI: Skip the first two elements in the _BCL package
        ACPI: remove BM_RLD access from idle entry path
        ACPI: remove locking from PM1x_STS register reads
        eeepc-laptop: use netlink interface
        eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop
        eeepc-laptop: Check return values from rfkill_register
        eeepc-laptop: Add support for extended hotkeys
        ...
      f12b12a8
  5. Feb 07, 2009
    • Len Brown's avatar
      Merge branches 'release', 'asus', 'bugzilla-12450', 'cpuidle', 'debug', 'ec',... · 2d29c6a0
      Len Brown authored
      Merge branches 'release', 'asus', 'bugzilla-12450', 'cpuidle', 'debug', 'ec', 'misc', 'printk' and 'processor' into release
      2d29c6a0
    • Thierry Vignaud's avatar
    • Darren Salt's avatar
      eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init · 7695fb04
      Darren Salt authored
      
      
      I got the following oops while changing the backlight brightness during
      startup.  When it happens, it prevents use of the hotkeys, Fn-Fx, and the
      lid button.
      
      It's a clear use-before-init, as I verified by testing with an
      appropriately-placed "else printk".
      
      BUG: unable to handle kernel NULL pointer dereference at 00000000
      *pde = 00000000
      Oops: 0002 [#1] PREEMPT SMP
      Pid: 160, comm: kacpi_notify Not tainted (2.6.28.1-eee901 #4) 901
      EIP: 0060:[<c0264e68>]  [<c0264e68>] eeepc_hotk_notify+26/da
      EFLAGS: 00010246 CPU: 1
      Using defaults from ksymoops -t elf32-i386 -a i386
      EAX: 00000009 EBX: 00000000 ECX: 00000009 EDX: f70dbf64
      ESI: 00000029 EDI: f7335188 EBP: c02112c9 ESP: f70dbf80
       DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
       f70731e0 f73acd50 c02164ac f7335180 f70aa040 c02112e6 f733518c c012b62f
       f70aa044 f70aa040 c012bdba f70aa04c 00000000 c012be6e 00000000 f70bdf80
       c012e198 f70dbfc4 f70dbfc4 f70aa040 c012bdba 00000000 c012e0c9 c012e091
      Call Trace:
       [<c02164ac>] ? acpi_ev_notify_dispatch+4c/55
       [<c02112e6>] ? acpi_os_execute_deferred+1d/25
       [<c012b62f>] ? run_workqueue+71/f1
       [<c012bdba>] ? worker_thread+0/bf
       [<c012be6e>] ? worker_thread+b4/bf
       [<c012e198>] ? autoremove_wake_function+0/2b
       [<c012bdba>] ? worker_thread+0/bf
       [<c012e0c9>] ? kthread+38/5f
       [<c012e091>] ? kthread+0/5f
       [<c0103abf>] ? kernel_thread_helper+7/10
      Code: 00 00 00 00 c3 83 3d 60 5c 50 c0 00 56 89 d6 53 0f 84 c4 00 00 00 8d 42
      e0 83 f8 0f 77 0f 8b 1d 68 5c 50 c0 89 d8 e8 a9 fa ff ff <89> 03 8b 1d 60 5c
      50 c0 89 f2 83 e2 7f 0f b7 4c 53 10 8d 41 01
      
      Signed-off-by: default avatarDarren Salt <linux@youmustbejoking.demon.co.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      7695fb04
    • Myron Stowe's avatar
      ACPICA: Fix table entry truncation calculation · 386e4a83
      Myron Stowe authored
      
      
      During early boot, ACPI RSDT/XSDT table entries are gathered into the
      'initial_tables[]' array.  This array is currently statically defined (see
      ./drivers/acpi/tables.c).  When there are more table entries than can be
      held in the 'initial_tables[]' array, the message "Truncating N table
      entries!" is output.  As currently implemented, this message will always
      erroneously calculate N as 0.
      
      This patch fixes the calculation that determines how many table entries
      will be missing (truncated).
      
      This modification may be used under either the GPL or the BSD-style
      license used for Intel ACPI CA code.
      
      Signed-off-by: default avatarMyron Stowe <myron.stowe@hp.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      386e4a83
    • Pallipadi, Venkatesh's avatar
      ACPI: Enable bit 11 in _PDC to advertise hw coord · d96f94c6
      Pallipadi, Venkatesh authored
      
      
      Bit 11 in intel PDC definitions is meant for OS capability to handle
      hardware coordination of P-states. In Linux we have always supported
      hwardware coordination of P-states. Just let the BIOSes know that we
      support it, by setting this bit.
      
      Some BIOSes use this bit to choose between hardware or software coordination
      and without this change below, BIOSes switch to software coordination, which
      is not very optimal in terms of power consumption and extra wakeups from idle.
      
      Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      d96f94c6
    • Kay Sievers's avatar
    • Frank Seidel's avatar
      ACPI: add missing KERN_* constants to printks · 4d939155
      Frank Seidel authored
      
      
      According to kerneljanitors todo list all printk calls (beginning
      a new line) should have an according KERN_* constant.
      Those are the missing peaces here for the acpi subsystem.
      
      Signed-off-by: default avatarFrank Seidel <frank@f-seidel.de>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      4d939155
    • Holger Macht's avatar
      ACPI: dock: Don't eval _STA on every show_docked sysfs read · fc5a9f88
      Holger Macht authored
      Some devices trigger a DEVICE_CHECK on every evalutation of _STA. This
      can also be seen in commit 8b59560a
      (ACPI: dock: avoid check _STA method).  If an undock is processed, the
      dock driver sends a uevent and userspace might read the show_docked
      property in sysfs. This causes an evaluation of _STA of the particular
      device which causes the dock driver to immediately dock again.
      
      In any case, evaluation of _STA (show_docked) does not necessarily mean
      that we are docked, so check with the internal device structure.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12360
      
      
      
      Signed-off-by: default avatarHolger Macht <hmacht@suse.de>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      fc5a9f88
    • Linus Torvalds's avatar
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable · ae1a25da
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (37 commits)
        Btrfs: Make sure dir is non-null before doing S_ISGID checks
        Btrfs: Fix memory leak in cache_drop_leaf_ref
        Btrfs: don't return congestion in write_cache_pages as often
        Btrfs: Only prep for btree deletion balances when nodes are mostly empty
        Btrfs: fix btrfs_unlock_up_safe to walk the entire path
        Btrfs: change btrfs_del_leaf to drop locks earlier
        Btrfs: Change btrfs_truncate_inode_items to stop when it hits the inode
        Btrfs: Don't try to compress pages past i_size
        Btrfs: join the transaction in __btrfs_setxattr
        Btrfs: Handle SGID bit when creating inodes
        Btrfs: Make btrfs_drop_snapshot work in larger and more efficient chunks
        Btrfs: Change btree locking to use explicit blocking points
        Btrfs: hash_lock is no longer needed
        Btrfs: disable leak debugging checks in extent_io.c
        Btrfs: sort references by byte number during btrfs_inc_ref
        Btrfs: async threads should try harder to find work
        Btrfs: selinux support
        Btrfs: make btrfs acls selectable
        Btrfs: Catch missed bios in the async bio submission thread
        Btrfs: fix readdir on 32 bit machines
        ...
      ae1a25da
    • Tyler Hicks's avatar
      eCryptfs: Regression in unencrypted filename symlinks · fd9fc842
      Tyler Hicks authored
      
      
      The addition of filename encryption caused a regression in unencrypted
      filename symlink support.  ecryptfs_copy_filename() is used when dealing
      with unencrypted filenames and it reported that the new, copied filename
      was a character longer than it should have been.
      
      This caused the return value of readlink() to count the NULL byte of the
      symlink target.  Most applications don't care about the extra NULL byte,
      but a version control system (bzr) helped in discovering the bug.
      
      Signed-off-by: default avatarTyler Hicks <tyhicks@linux.vnet.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fd9fc842
    • Linus Torvalds's avatar
    • Roland McGrath's avatar
      x86-64: fix int $0x80 -ENOSYS return · c09249f8
      Roland McGrath authored
      
      
      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: default avatarDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
      c09249f8
    • Linus Torvalds's avatar
    • Roland McGrath's avatar
      elf core dump: fix get_user use · 92dc07b1
      Roland McGrath authored
      
      
      The elf_core_dump() code does its work with set_fs(KERNEL_DS) in force,
      so vma_dump_size() needs to switch back with set_fs(USER_DS) to safely
      use get_user() for a normal user-space address.
      
      Checking for VM_READ optimizes out the case where get_user() would fail
      anyway.  The vm_file check here was already superfluous given the control
      flow earlier in the function, so that is a cleanup/optimization unrelated
      to other changes but an obvious and trivial one.
      
      Reported-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
      Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
      92dc07b1
    • David Howells's avatar
      CRED: Fix SUID exec regression · 0bf2f3ae
      David Howells authored
      The patch:
      
      	commit a6f76f23
      
      
      	CRED: Make execve() take advantage of copy-on-write credentials
      
      moved the place in which the 'safeness' of a SUID/SGID exec was performed to
      before de_thread() was called.  This means that LSM_UNSAFE_SHARE is now
      calculated incorrectly.  This flag is set if any of the usage counts for
      fs_struct, files_struct and sighand_struct are greater than 1 at the time the
      determination is made.  All of which are true for threads created by the
      pthread library.
      
      However, since we wish to make the security calculation before irrevocably
      damaging the process so that we can return it an error code in the case where
      we decide we want to reject the exec request on this basis, we have to make the
      determination before calling de_thread().
      
      So, instead, we count up the number of threads (CLONE_THREAD) that are sharing
      our fs_struct (CLONE_FS), files_struct (CLONE_FILES) and sighand_structs
      (CLONE_SIGHAND/CLONE_THREAD) with us.  These will be killed by de_thread() and
      so can be discounted by check_unsafe_exec().
      
      We do have to be careful because CLONE_THREAD does not imply FS or FILES.
      
      We _assume_ that there will be no extra references to these structs held by the
      threads we're going to kill.
      
      This can be tested with the attached pair of programs.  Build the two programs
      using the Makefile supplied, and run ./test1 as a non-root user.  If
      successful, you should see something like:
      
      	[dhowells@andromeda tmp]$ ./test1
      	--TEST1--
      	uid=4043, euid=4043 suid=4043
      	exec ./test2
      	--TEST2--
      	uid=4043, euid=0 suid=0
      	SUCCESS - Correct effective user ID
      
      and if unsuccessful, something like:
      
      	[dhowells@andromeda tmp]$ ./test1
      	--TEST1--
      	uid=4043, euid=4043 suid=4043
      	exec ./test2
      	--TEST2--
      	uid=4043, euid=4043 suid=4043
      	ERROR - Incorrect effective user ID!
      
      The non-root user ID you see will depend on the user you run as.
      
      [test1.c]
      #include <stdio.h>
      #include <stdlib.h>
      #include <unistd.h>
      #include <pthread.h>
      
      static void *thread_func(void *arg)
      {
      	while (1) {}
      }
      
      int main(int argc, char **argv)
      {
      	pthread_t tid;
      	uid_t uid, euid, suid;
      
      	printf("--TEST1--\n");
      	getresuid(&uid, &euid, &suid);
      	printf("uid=%d, euid=%d suid=%d\n", uid, euid, suid);
      
      	if (pthread_create(&tid, NULL, thread_func, NULL) < 0) {
      		perror("pthread_create");
      		exit(1);
      	}
      
      	printf("exec ./test2\n");
      	execlp("./test2", "test2", NULL);
      	perror("./test2");
      	_exit(1);
      }
      
      [test2.c]
      #include <stdio.h>
      #include <stdlib.h>
      #include <unistd.h>
      
      int main(int argc, char **argv)
      {
      	uid_t uid, euid, suid;
      
      	getresuid(&uid, &euid, &suid);
      	printf("--TEST2--\n");
      	printf("uid=%d, euid=%d suid=%d\n", uid, euid, suid);
      
      	if (euid != 0) {
      		fprintf(stderr, "ERROR - Incorrect effective user ID!\n");
      		exit(1);
      	}
      	printf("SUCCESS - Correct effective user ID\n");
      	exit(0);
      }
      
      [Makefile]
      CFLAGS = -D_GNU_SOURCE -Wall -Werror -Wunused
      all: test1 test2
      
      test1: test1.c
      	gcc $(CFLAGS) -o test1 test1.c -lpthread
      
      test2: test2.c
      	gcc $(CFLAGS) -o test2 test2.c
      	sudo chown root.root test2
      	sudo chmod +s test2
      
      Reported-by: default avatarDavid Smith <dsmith@redhat.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Acked-by: default avatarDavid Smith <dsmith@redhat.com>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      0bf2f3ae
    • Dave Kleikamp's avatar
      vfs: Don't call attach_nobh_buffers() with an empty list · d4cf109f
      Dave Kleikamp authored
      This is a modification of a patch by Bill Pemberton <wfp5p@virginia.edu>
      
      nobh_write_end() could call attach_nobh_buffers() with head == NULL.
      This would result in a trap when attach_nobh_buffers() attempted to
      access bh->b_this_page.
      
      This can be illustrated by running the writev01 testcase from LTP on jfs.
      
      This error was introduced by commit 5b41e74a
      
       "vfs: fix data leak in
      nobh_write_end()".  That patch did not take into account that if
      PageMappedToDisk() is true upon entry to nobh_write_begin(), then no
      buffers will be allocated for the page.  In that case, we won't have to
      worry about a failed write leaving unitialized data in the page.
      
      Of course, head != NULL implies !page_has_buffers(page), so no need to
      test both.
      
      Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Dmitri Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d4cf109f
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 · 6cec5083
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
        ALSA: hda - Add missing COEF initialization for ALC887
        ALSA: hda - Add missing initialization for ALC272
        sound: usb-audio: handle wMaxPacketSize for FIXED_ENDPOINT devices
        ALSA: hda - Fix misc workqueue issues
        ALSA: hda - Add quirk for FSC Amilo Xi2550
      6cec5083
    • Len Brown's avatar
      ACPI: disable ACPI cleanly when bad RSDP found · 9e3a9d1e
      Len Brown authored
      When ACPI is disabled in the BIOS of this VIA C3 box,
      it invalidates the RSDP, which Linux notices:
      
      ACPI Error (tbxfroot-0218): A valid RSDP was not found [20080926]
      
      Bug Linux neglected to disable ACPI at that stage,
      and later scribbled on smp_found_config:
      
      ACPI: No APIC-table, disabling MPS
      
      But this box doesn't run well in legacy PIC mode,
      it needed IOAPIC mode to perform correctly:
      
      http://lkml.org/lkml/2009/2/5/39
      
      
      
      So exit ACPI mode cleanly when we first detect
      that it is hopeless.
      
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      9e3a9d1e