1. 16 3月, 2009 2 次提交
    • A
      UBIFS: use KERN_CONT · c9927c3e
      Artem Bityutskiy 提交于
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      c9927c3e
    • A
      UBIFS: fix lprops committing bug · 0a6fb8d9
      Artem Bityutskiy 提交于
      When writing lprop nodes, do not forget to set @from to 0 when
      switching the LEB. This fixes the following bug:
      
      UBIFS error (pid 27768): ubifs_leb_write: writing -15456 bytes at 16:15880, error -22
      UBIFS error (pid 27768): do_commit: commit failed, error -22
      UBIFS warning (pid 27768): ubifs_ro_mode: switched to read-only mode, error -22
      Pid: 27768, comm: freespace Not tainted 2.6.29-rc4-ubifs-2.6 #43
      Call Trace:
       [<ffffffffa00c46d6>] ubifs_ro_mode+0x54/0x56 [ubifs]
       [<ffffffffa00cfa16>] do_commit+0x4f5/0x50a [ubifs]
       [<ffffffffa00cfae7>] ubifs_run_commit+0xbc/0xdb [ubifs]
       [<ffffffffa00d42b9>] ubifs_budget_space+0x742/0x9ed [ubifs]
       [<ffffffff812daf45>] ? __mutex_lock_common+0x361/0x3ae
       [<ffffffffa00bc437>] ? ubifs_write_begin+0x18d/0x44c [ubifs]
       [<ffffffffa00bc5cb>] ubifs_write_begin+0x321/0x44c [ubifs]
       [<ffffffff8106222b>] ? trace_hardirqs_on_caller+0x1f/0x14d
       [<ffffffff81097ce2>] generic_file_buffered_write+0x12f/0x2d9
       [<ffffffff8109828d>] __generic_file_aio_write_nolock+0x261/0x295
       [<ffffffff81098aff>] generic_file_aio_write+0x69/0xc5
       [<ffffffffa00bb914>] ubifs_aio_write+0x14c/0x19e [ubifs]
       [<ffffffff810c8f42>] do_sync_write+0xe7/0x12d
       [<ffffffff81055378>] ? autoremove_wake_function+0x0/0x38
       [<ffffffff81149edc>] ? security_file_permission+0x11/0x13
       [<ffffffff810c9827>] vfs_write+0xab/0x105
       [<ffffffff810c9945>] sys_write+0x47/0x6f
       [<ffffffff8100c35b>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      0a6fb8d9
  2. 15 3月, 2009 1 次提交
  3. 14 3月, 2009 1 次提交
    • A
      UBIFS: fix bug where page is marked uptodate when out of space · f55aa591
      Adrian Hunter 提交于
      UBIFS fast path in write_begin may mark a page up to date
      and then discover that there may not be enough space to do
      the write, and so fall back to a slow path.  The slow path
      tries harder, but may still find no space - leaving the page
      marked up to date, when it is not.  This patch ensures that
      the page is marked not up to date in that case.
      
      The bug that this patch fixes becomes evident when the write
      is into a hole (sparse file) or is at the end of the file
      and a subsequent read is off the end of the file.  In both
      cases, the file system should return zeros but was instead
      returning the page that had not been written because the
      file system was out of space.
      Signed-off-by: NAdrian Hunter <ext-adrian.hunter@nokia.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      f55aa591
  4. 08 3月, 2009 2 次提交
  5. 17 2月, 2009 1 次提交
  6. 09 2月, 2009 12 次提交
  7. 08 2月, 2009 3 次提交
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 · e83102ca
      Linus Torvalds 提交于
      * '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
    • R
      module: remove over-zealous check in __module_get() · 7f9a50a5
      Rusty Russell 提交于
      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: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7f9a50a5
    • L
      Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 · f12b12a8
      Linus Torvalds 提交于
      * '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
  8. 07 2月, 2009 18 次提交
    • L
      Merge branches 'release', 'asus', 'bugzilla-12450', 'cpuidle', 'debug', 'ec',... · 2d29c6a0
      Len Brown 提交于
      Merge branches 'release', 'asus', 'bugzilla-12450', 'cpuidle', 'debug', 'ec', 'misc', 'printk' and 'processor' into release
      2d29c6a0
    • T
    • D
      eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init · 7695fb04
      Darren Salt 提交于
      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: NDarren Salt <linux@youmustbejoking.demon.co.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      7695fb04
    • M
      ACPICA: Fix table entry truncation calculation · 386e4a83
      Myron Stowe 提交于
      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: NMyron Stowe <myron.stowe@hp.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      386e4a83
    • P
      ACPI: Enable bit 11 in _PDC to advertise hw coord · d96f94c6
      Pallipadi, Venkatesh 提交于
      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: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      d96f94c6
    • K
    • F
      ACPI: add missing KERN_* constants to printks · 4d939155
      Frank Seidel 提交于
      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: NFrank Seidel <frank@f-seidel.de>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      4d939155
    • H
      ACPI: dock: Don't eval _STA on every show_docked sysfs read · fc5a9f88
      Holger Macht 提交于
      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=12360Signed-off-by: NHolger Macht <hmacht@suse.de>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      fc5a9f88
    • L
      ccfef646
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable · ae1a25da
      Linus Torvalds 提交于
      * 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
    • T
      eCryptfs: Regression in unencrypted filename symlinks · fd9fc842
      Tyler Hicks 提交于
      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: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fd9fc842
    • L
    • R
      x86-64: fix int $0x80 -ENOSYS return · c09249f8
      Roland McGrath 提交于
      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: NDmitry V. Levin <ldv@altlinux.org>
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      c09249f8
    • L
    • R
      elf core dump: fix get_user use · 92dc07b1
      Roland McGrath 提交于
      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: NGerald Schaefer <gerald.schaefer@de.ibm.com>
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      92dc07b1
    • D
      CRED: Fix SUID exec regression · 0bf2f3ae
      David Howells 提交于
      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: NDavid Smith <dsmith@redhat.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NDavid Smith <dsmith@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      0bf2f3ae
    • D
      vfs: Don't call attach_nobh_buffers() with an empty list · d4cf109f
      Dave Kleikamp 提交于
      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: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Dmitri Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d4cf109f
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 · 6cec5083
      Linus Torvalds 提交于
      * '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