1. 15 10月, 2012 2 次提交
  2. 13 10月, 2012 1 次提交
    • J
      vfs: define struct filename and have getname() return it · 91a27b2a
      Jeff Layton 提交于
      getname() is intended to copy pathname strings from userspace into a
      kernel buffer. The result is just a string in kernel space. It would
      however be quite helpful to be able to attach some ancillary info to
      the string.
      
      For instance, we could attach some audit-related info to reduce the
      amount of audit-related processing needed. When auditing is enabled,
      we could also call getname() on the string more than once and not
      need to recopy it from userspace.
      
      This patchset converts the getname()/putname() interfaces to return
      a struct instead of a string. For now, the struct just tracks the
      string in kernel space and the original userland pointer for it.
      
      Later, we'll add other information to the struct as it becomes
      convenient.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      91a27b2a
  3. 23 9月, 2012 1 次提交
  4. 21 9月, 2012 1 次提交
    • T
      [IA64] Must enable interrupts in do_notify_resume_user before calling tracehook_notify_resume() · 0967237c
      Tony Luck 提交于
      If we call with interrupts disabled, we'll be hit with:
      
      WARNING: at kernel/softirq.c:160 local_bh_enable_ip+0x150/0x180() and a stack
      trace like this:
      
      Call Trace:
       [<a000000100015480>] show_stack+0x80/0xa0
       [<a000000100d9a520>] dump_stack+0x30/0x50
       [<a000000100072fc0>] warn_slowpath_common+0xc0/0x100
       [<a000000100073040>] warn_slowpath_null+0x40/0x60
       [<a0000001000884d0>] local_bh_enable_ip+0x150/0x180
       [<a000000100da2960>] _raw_write_unlock_bh+0x40/0x60
       [<a000000100cf03c0>] unix_release_sock+0x120/0x5a0
       [<a000000100cf0880>] unix_release+0x40/0x60
       [<a000000100b84400>] sock_release+0x60/0x1a0
       [<a000000100b84b70>] sock_close+0x30/0xa0
       [<a0000001001d10f0>] __fput+0x190/0x500
       [<a0000001001d1580>] ____fput+0x20/0x40
       [<a0000001000b6570>] task_work_run+0x1b0/0x260
       [<a000000100015190>] do_notify_resume_user+0x110/0x2a0
       [<a00000010000c5a0>] notify_resume_user+0x40/0x60
       [<a00000010000c4d0>] skip_rbs_switch+0xe0/0xf0
       [<a000000000040720>] ia64_ivt+0xffffffff00040720/0x400
      Fix-suggested-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      0967237c
  5. 24 5月, 2012 1 次提交
  6. 08 5月, 2012 1 次提交
  7. 30 3月, 2012 1 次提交
    • L
      Fix ia64 build errors (fallout from system.h disintegration) · 93f37888
      Luck, Tony 提交于
      Fix this build error on ia64:
      
        In file included from include/linux/sched.h:92,
                        from arch/ia64/kernel/asm-offsets.c:9:
        include/linux/llist.h:59:25: error: asm/cmpxchg.h: No such file or directory
        make[1]: *** [arch/ia64/kernel/asm-offsets.s] Error 1
      
      Right now we don't seem to need any actual contents for the
      asm/cmpxchg.h to make the build work ...  so leave the migration of
      xchg() and cmpxchg() to this new header file for a future patch.
      
      Also process.c needs <asm/switch_to.h> (for definition of pfm_syst_info).
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      93f37888
  8. 01 3月, 2012 1 次提交
  9. 13 1月, 2011 1 次提交
    • T
      ACPI, intel_idle: Cleanup idle= internal variables · d1896049
      Thomas Renninger 提交于
      Having four variables for the same thing:
        idle_halt, idle_nomwait, force_mwait and boot_option_idle_overrides
      is rather confusing and unnecessary complex.
      
      if idle= boot param is passed, only set up one variable:
      boot_option_idle_overrides
      
      Introduces following functional changes/fixes:
        - intel_idle driver does not register if any idle=xy
          boot param is passed.
        - processor_idle.c will also not register a cpuidle driver
          and get active if idle=halt is passed.
          Before a cpuidle driver with one (C1, halt) state got registered
          Now the default_idle function will be used which finally uses
          the same idle call to enter sleep state (safe_halt()), but
          without registering a whole cpuidle driver.
      
      That means idle= param will always avoid cpuidle drivers to register
      with one exception (same behavior as before):
      idle=nomwait
      may still register acpi_idle cpuidle driver, but C1 will not use
      mwait, but hlt. This can be a workaround for IO based deeper sleep
      states where C1 mwait causes problems.
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      cc: x86@kernel.org
      Signed-off-by: NLen Brown <len.brown@intel.com>
      d1896049
  10. 18 8月, 2010 1 次提交
    • D
      Make do_execve() take a const filename pointer · d7627467
      David Howells 提交于
      Make do_execve() take a const filename pointer so that kernel_execve() compiles
      correctly on ARM:
      
      arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type
      
      This also requires the argv and envp arguments to be consted twice, once for
      the pointer array and once for the strings the array points to.  This is
      because do_execve() passes a pointer to the filename (now const) to
      copy_strings_kernel().  A simpler alternative would be to cast the filename
      pointer in do_execve() when it's passed to copy_strings_kernel().
      
      do_execve() may not change any of the strings it is passed as part of the argv
      or envp lists as they are some of them in .rodata, so marking these strings as
      const should be fine.
      
      Further kernel_execve() and sys_execve() need to be changed to match.
      
      This has been test built on x86_64, frv, arm and mips.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Tested-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d7627467
  11. 14 8月, 2010 1 次提交
  12. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  13. 26 2月, 2010 1 次提交
    • A
      [IA64] Only build arch/ia64/kernel/acpi.o when CONFIG_ACPI · d868080d
      Alex Chiang 提交于
      The following commit broke the ia64 sim_defconfig build:
      	3b2b84c0b81108a9a869a88bf2beeb5a95d81dd1
      	ACPI: processor: driver doesn't need to evaluate _PDC
      
      This is because it added:
      	+#include <acpi/processor.h>
      
      To arch/ia64/kernel/acpi.c. Unfortunately, the ia64_simdefconfig does
      not turn on CONFIG_ACPI, and we get build errors.
      
      The fix described in $subject seems to be the most sensible way to
      untangle the mess.
      
      The other issue is that acpi_get_sysname() is required for all configs,
      most of which define CONFIG_ACPI, but are not CONFIG_IA64_GENERIC. Turn
      it into an inline to cover the "non generic" ia64 configs; to prevent
      a duplicate definition build error, we need to wrap the definition in
      acpi.o inside an #ifdef.
      
      Finally, move the pm_idle and pm_power_off exports into process.c (which
      is always built), similar to other architectures, and allow the sim
      defconfig to link.
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      d868080d
  14. 09 2月, 2010 1 次提交
    • T
      [IA64] Remove COMPAT_IA32 support · 32974ad4
      Tony Luck 提交于
      This has been broken since May 2008 when Al Viro killed altroot support.
      Since nobody has complained, it would appear that there are no users of
      this code (A plausible theory since the main OSVs that support ia64 prefer
      to use the IA32-EL software emulation).
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      32974ad4
  15. 15 9月, 2009 1 次提交
  16. 02 9月, 2009 1 次提交
    • D
      KEYS: Add a keyctl to install a process's session keyring on its parent [try #6] · ee18d64c
      David Howells 提交于
      Add a keyctl to install a process's session keyring onto its parent.  This
      replaces the parent's session keyring.  Because the COW credential code does
      not permit one process to change another process's credentials directly, the
      change is deferred until userspace next starts executing again.  Normally this
      will be after a wait*() syscall.
      
      To support this, three new security hooks have been provided:
      cred_alloc_blank() to allocate unset security creds, cred_transfer() to fill in
      the blank security creds and key_session_to_parent() - which asks the LSM if
      the process may replace its parent's session keyring.
      
      The replacement may only happen if the process has the same ownership details
      as its parent, and the process has LINK permission on the session keyring, and
      the session keyring is owned by the process, and the LSM permits it.
      
      Note that this requires alteration to each architecture's notify_resume path.
      This has been done for all arches barring blackfin, m68k* and xtensa, all of
      which need assembly alteration to support TIF_NOTIFY_RESUME.  This allows the
      replacement to be performed at the point the parent process resumes userspace
      execution.
      
      This allows the userspace AFS pioctl emulation to fully emulate newpag() and
      the VIOCSETTOK and VIOCSETTOK2 pioctls, all of which require the ability to
      alter the parent process's PAG membership.  However, since kAFS doesn't use
      PAGs per se, but rather dumps the keys into the session keyring, the session
      keyring of the parent must be replaced if, for example, VIOCSETTOK is passed
      the newpag flag.
      
      This can be tested with the following program:
      
      	#include <stdio.h>
      	#include <stdlib.h>
      	#include <keyutils.h>
      
      	#define KEYCTL_SESSION_TO_PARENT	18
      
      	#define OSERROR(X, S) do { if ((long)(X) == -1) { perror(S); exit(1); } } while(0)
      
      	int main(int argc, char **argv)
      	{
      		key_serial_t keyring, key;
      		long ret;
      
      		keyring = keyctl_join_session_keyring(argv[1]);
      		OSERROR(keyring, "keyctl_join_session_keyring");
      
      		key = add_key("user", "a", "b", 1, keyring);
      		OSERROR(key, "add_key");
      
      		ret = keyctl(KEYCTL_SESSION_TO_PARENT);
      		OSERROR(ret, "KEYCTL_SESSION_TO_PARENT");
      
      		return 0;
      	}
      
      Compiled and linked with -lkeyutils, you should see something like:
      
      	[dhowells@andromeda ~]$ keyctl show
      	Session Keyring
      	       -3 --alswrv   4043  4043  keyring: _ses
      	355907932 --alswrv   4043    -1   \_ keyring: _uid.4043
      	[dhowells@andromeda ~]$ /tmp/newpag
      	[dhowells@andromeda ~]$ keyctl show
      	Session Keyring
      	       -3 --alswrv   4043  4043  keyring: _ses
      	1055658746 --alswrv   4043  4043   \_ user: a
      	[dhowells@andromeda ~]$ /tmp/newpag hello
      	[dhowells@andromeda ~]$ keyctl show
      	Session Keyring
      	       -3 --alswrv   4043  4043  keyring: hello
      	340417692 --alswrv   4043  4043   \_ user: a
      
      Where the test program creates a new session keyring, sticks a user key named
      'a' into it and then installs it on its parent.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      ee18d64c
  17. 03 4月, 2009 1 次提交
  18. 18 10月, 2008 1 次提交
  19. 07 10月, 2008 1 次提交
  20. 17 7月, 2008 2 次提交
  21. 26 6月, 2008 1 次提交
  22. 15 5月, 2008 1 次提交
  23. 30 4月, 2008 1 次提交
  24. 13 3月, 2008 1 次提交
  25. 09 2月, 2008 3 次提交
  26. 20 12月, 2007 1 次提交
    • I
      [IA64] set_thread_area fails in IA32 chroot · e384f414
      Ian Wienand 提交于
      I tried to upgrade an IA32 chroot on my IA64 to a new glibc with TLS.
      It kept dying because set_thread_area was returning -ESRCH
      (bugs.debian.org/451939).
      
      I instrumented arch/ia64/ia32/sys_ia32.c:get_free_idx() and ended up
      seeing output like
      
      [pid] idx   desc->a  desc->b
      -----------------------------
      [2710] 0 -> c6b0ffff 40dff31b
      [2710] 1 -> 0 0
      [2710] 2 -> 0 0
      
      [2710] 0 -> c6b0ffff 40dff31b
      [2710] 1 -> c6b0ffff 40dff31b
      [2710] 2 -> 0 0
      
      [2711] 0 -> c6b0ffff 40dff31b
      [2711] 1 -> c6b0ffff 40dff31b
      [2711] 2 -> 48c0ffff 40dff317
      
      which suggested to me that TLS pointers were surviving exec() calls,
      leading to GDT pointers filling up and the eventual failure of
      get_free_idx().
      
      I think the solution is flushing the tls array on exec.
      Signed-Off-By: NIan Wienand <ianw@gelato.unsw.edu.au>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      e384f414
  27. 19 12月, 2007 1 次提交
  28. 20 10月, 2007 1 次提交
  29. 14 8月, 2007 1 次提交
    • D
      [IA64] disable irq's and check need_resched before safe_halt · 71416bea
      Dimitri Sivanich 提交于
      While sending interrupts to a cpu to repeatedly wake a thread, on occasion
      that thread will take a full timer tick cycle (4002 usec in my case)
      to wakeup.
      
      The problem concerns a race condition in the code around the safe_halt()
      call in the default_idle() routine.  Setting 'nohalt' on the kernel
      command line causes the long wakeups to disappear.
      
      void
      default_idle (void)
      {
              local_irq_enable();
              while (!need_resched()) {
      -->             if (can_do_pal_halt)
      -->                     safe_halt();
                      else
      
      A timer tick could arrive between the check for !need_resched and the
      actual call to safe_halt() (which does a pal call to PAL_HALT_LIGHT).
      By the time the timer tick completes, a thread that might now need to run
      could get held up for as long as a timer tick waiting for the halted cpu.
      
      I'm proposing that we disable irq's and check need_resched again before
      calling safe_halt().  Does anyone see any problem with this approach?
      Signed-off-by: NDimitri Sivanich <sivanich@sgi.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      71416bea
  30. 26 7月, 2007 1 次提交
  31. 12 7月, 2007 1 次提交
  32. 23 5月, 2007 1 次提交
    • R
      [IA64] Only unwind non-running tasks. · 6ae38488
      Robin Holt 提交于
      Unwinding a running task has proven problematic.
      
      In one instance, the running task was attempting to unwind itself and
      received an interrupt between when get_wchan allocated local variables on
      the stack and when unw_init_from_blocked_task was called which resulted
      in unw_init_frame_info to place this tasks task_struct pointer over the
      switch stack's ar_bspstore entry.
      Signed-off-by: NRobin Holt <holt@sgi.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      6ae38488
  33. 09 5月, 2007 4 次提交