1. 01 Jun, 2012 5 commits
    • Steven Rostedt's avatar
      ftrace/x86: Do not change stacks in DEBUG when calling lockdep · 5963e317
      Steven Rostedt authored
      When both DYNAMIC_FTRACE and LOCKDEP are set, the TRACE_IRQS_ON/OFF
      will call into the lockdep code. The lockdep code can call lots of
      functions that may be traced by ftrace. When ftrace is updating its
      code and hits a breakpoint, the breakpoint handler will call into
      lockdep. If lockdep happens to call a function that also has a breakpoint
      attached, it will jump back into the breakpoint handler resetting
      the stack to the debug stack and corrupt the contents currently on
      that stack.
      
      The 'do_sym' call that calls do_int3() is protected by modifying the
      IST table to point to a different location if another breakpoint is
      hit. But the TRACE_IRQS_OFF/ON are outside that protection, and if
      a breakpoint is hit from those, the stack will get corrupted, and
      the kernel will crash:
      
      [ 1013.243754] BUG: unable to handle kernel NULL pointer dereference at 0000000000000002
      [ 1013.272665] IP: [<ffff880145cc0000>] 0xffff880145cbffff
      [ 1013.285186] PGD 1401b2067 PUD 14324c067 PMD 0
      [ 1013.298832] Oops: 0010 [#1] PREEMPT SMP
      [ 1013.310600] CPU 2
      [ 1013.317904] Modules linked in: ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables crc32c_intel ghash_clmulni_intel microcode usb_debug serio_raw pcspkr iTCO_wdt i2c_i801 iTCO_vendor_support e1000e nfsd nfs_acl auth_rpcgss lockd sunrpc i915 video i2c_algo_bit drm_kms_helper drm i2c_core [last unloaded: scsi_wait_scan]
      [ 1013.401848]
      [ 1013.407399] Pid: 112, comm: kworker/2:1 Not tainted 3.4.0+ #30
      [ 1013.437943] RIP: 8eb8:[<ffff88014630a000>]  [<ffff88014630a000>] 0xffff880146309fff
      [ 1013.459871] RSP: ffffffff8165e919:ffff88014780f408  EFLAGS: 00010046
      [ 1013.477909] RAX: 0000000000000001 RBX: ffffffff81104020 RCX: 0000000000000000
      [ 1013.499458] RDX: ffff880148008ea8 RSI: ffffffff8131ef40 RDI: ffffffff82203b20
      [ 1013.521612] RBP: ffffffff81005751 R08: 0000000000000000 R09: 0000000000000000
      [ 1013.543121] R10: ffffffff82cdc318 R11: 0000000000000000 R12: ffff880145cc0000
      [ 1013.564614] R13: ffff880148008eb8 R14: 0000000000000002 R15: ffff88014780cb40
      [ 1013.586108] FS:  0000000000000000(0000) GS:ffff880148000000(0000) knlGS:0000000000000000
      [ 1013.609458] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [ 1013.627420] CR2: 0000000000000002 CR3: 0000000141f10000 CR4: 00000000001407e0
      [ 1013.649051] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 1013.670724] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [ 1013.692376] Process kworker/2:1 (pid: 112, threadinfo ffff88013fe0e000, task ffff88014020a6a0)
      [ 1013.717028] Stack:
      [ 1013.724131]  ffff88014780f570 ffff880145cc0000 0000400000004000 0000000000000000
      [ 1013.745918]  cccccccccccccccc ffff88014780cca8 ffffffff811072bb ffffffff81651627
      [ 1013.767870]  ffffffff8118f8a7 ffffffff811072bb ffffffff81f2b6c5 ffffffff81f11bdb
      [ 1013.790021] Call Trace:
      [ 1013.800701] Code: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a <e7> d7 64 81 ff ff ff ff 01 00 00 00 00 00 00 00 65 d9 64 81 ff
      [ 1013.861443] RIP  [<ffff88014630a000>] 0xffff880146309fff
      [ 1013.884466]  RSP <ffff88014780f408>
      [ 1013.901507] CR2: 0000000000000002
      
      The solution was to reuse the NMI functions that change the IDT table to make the debug
      stack keep its current stack (in kernel mode) when hitting a breakpoint:
      
        call debug_stack_set_zero
        TRACE_IRQS_ON
        call debug_stack_reset
      
      If the TRACE_IRQS_ON happens to hit a breakpoint then it will keep the current stack
      and not crash the box.
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      5963e317
    • Steven Rostedt's avatar
      x86: Allow nesting of the debug stack IDT setting · f8988175
      Steven Rostedt authored
      When the NMI handler runs, it checks if it preempted a debug handler
      and if that handler is using the debug stack. If it is, it changes the
      IDT table not to update the stack, otherwise it will reset the debug
      stack and corrupt the debug handler it preempted.
      
      Now that ftrace uses breakpoints to change functions from nops to
      callers, many more places may hit a breakpoint. Unfortunately this
      includes some of the calls that lockdep performs. Which causes issues
      with the debug stack. It too needs to change the debug stack before
      tracing (if called from the debug handler).
      
      Allow the debug_stack_set_zero() and debug_stack_reset() to be nested
      so that the debug handlers can take advantage of them too.
      
      [ Used this_cpu_*() over __get_cpu_var() as suggested by H. Peter Anvin ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f8988175
    • Steven Rostedt's avatar
      x86: Reset the debug_stack update counter · c0525a69
      Steven Rostedt authored
      When an NMI goes off and it sees that it preempted the debug stack,
      to keep the debug stack safe, it changes the IDT to point to one that
      does not modify the stack on breakpoint (to allow breakpoints in NMIs).
      
      But the variable that gets set to know to undo it on exit never gets
      cleared on exit. Thus every NMI will reset it on exit the first time
      it is done even if it does not need to be reset.
      
      [ Added H. Peter Anvin's suggestion to use this_cpu_read/write ]
      
      Cc: <stable@vger.kernel.org> # v3.3
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      c0525a69
    • Steven Rostedt's avatar
      ftrace: Use breakpoint method to update ftrace caller · 8a4d0a68
      Steven Rostedt authored
      On boot up and module load, it is fine to modify the code directly,
      without the use of breakpoints. This is because boot up modification
      is done before SMP is initialized, thus the modification is serial,
      and module load is done before the module executes.
      
      But after that we must use a SMP safe method to modify running code.
      Otherwise, if we are running the function tracer and update its
      function (by starting off the stack tracer, or perf tracing)
      the change of the function called by the ftrace trampoline is done
      directly. If this is being executed on another CPU, that CPU may
      take a GPF and crash the kernel.
      
      The breakpoint method is used to change the nops at all the functions, but
      the change of the ftrace callback handler itself was still using a
      direct modification. If tracing was enabled and the function callback
      was changed then another CPU could fault if it was currently calling
      the original callback. This modification must use the breakpoint method
      too.
      
      Note, the direct method is still used for boot up and module load.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      8a4d0a68
    • Steven Rostedt's avatar
      ftrace: Synchronize variable setting with breakpoints · a192cd04
      Steven Rostedt authored
      When the function tracer starts modifying the code via breakpoints
      it sets a variable (modifying_ftrace_code) to inform the breakpoint
      handler to call the ftrace int3 code.
      
      But there's no synchronization between setting this code and the
      handler, thus it is possible for the handler to be called on another
      CPU before it sees the variable. This will cause a kernel crash as
      the int3 handler will not know what to do with it.
      
      I originally added smp_mb()'s to force the visibility of the variable
      but H. Peter Anvin suggested that I just make it atomic.
      
      [ Added comments as suggested by Peter Zijlstra ]
      Suggested-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a192cd04
  2. 24 May, 2012 16 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo' of... · c985f781
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Fixes for the recently merged libtraceevent, from Arnaldo Carvalho de Melo:
      
      * Selected fixes for libtraceevent, from various contributors, submitter by
        Namhyung Kim in agreement with Steven Rostedt, all from the trace-cmd repo,
        i.e. they have been in use for quite a while in trace-cmd.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c985f781
    • Namhyung Kim's avatar
      tools lib traceevent: Fix signature of create_arg_item() · eaec12d7
      Namhyung Kim authored
      The @type should be a type of enum event_type not enum filter_arg_type.
      
      This fixes following warning:
      
       $ make
        COMPILE FPIC           parse-events.o
        COMPILE FPIC           parse-filter.o
      /home/namhyung/project/trace-cmd/parse-filter.c: In function ‘create_arg_item’:
      /home/namhyung/project/trace-cmd/parse-filter.c:343:9: warning: comparison between ‘enum filter_arg_type’ and ‘enum event_type’ [-Wenum-compare]
      /home/namhyung/project/trace-cmd/parse-filter.c:339:2: warning: case value ‘8’ not in enumerated type ‘enum filter_arg_type’ [-Wswitch]
        BUILD STATIC LIB       libparsevent.a
        BUILD STATIC LIB       libtracecmd.a
        BUILD                  trace-cmd
      /usr/bin/make -C /home/namhyung/project/trace-cmd/Documentation all
      make[1]: Nothing to be done for `all'.
      Note: to build the gui, type "make gui"
      
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337740619-27925-20-git-send-email-namhyung.kim@lge.comSigned-off-by: default avatarNamhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      eaec12d7
    • Namhyung Kim's avatar
      tools lib traceevent: Use proper function parameter type · 21c69e72
      Namhyung Kim authored
      The param needs to be updated when setting args up so that
      the loop in process_defined_func() can see the correct
      param->type for the farg.
      
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337740619-27925-15-git-send-email-namhyung.kim@lge.comSigned-off-by: default avatarNamhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      21c69e72
    • Namhyung Kim's avatar
      tools lib traceevent: Fix freeing arg on process_dynamic_array() · b3511d05
      Namhyung Kim authored
      The @arg paremeter should not be freed inside of process_XXX(),
      because it'd be freed from the caller of process_arg(). We can
      free it only after it was reused for local usage.
      
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337740619-27925-14-git-send-email-namhyung.kim@lge.comSigned-off-by: default avatarNamhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b3511d05
    • Namhyung Kim's avatar
      tools lib traceevent: Fix a possibly wrong memory dereference · d1de1087
      Namhyung Kim authored
      If set_op_prio() failed, the token will be freed at out_free,
      then arg->op.op would turn out to be a dangle pointer. After
      returning EVENT_ERROR from process_op(), free_arg() will be
      called and then it will finally see the dangling pointer.
      
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337740619-27925-13-git-send-email-namhyung.kim@lge.comSigned-off-by: default avatarNamhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d1de1087
    • Namhyung Kim's avatar
      tools lib traceevent: Fix a possible memory leak · 57d34dc5
      Namhyung Kim authored
      If event_read_fields failed in the middle, each member of
      struct format_field should be freed also.
      
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337740619-27925-11-git-send-email-namhyung.kim@lge.comSigned-off-by: default avatarNamhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      57d34dc5
    • Stefan Hajnoczi's avatar
      tools lib traceevent: Allow expressions in __print_symbolic() fields · 00b9da72
      Stefan Hajnoczi authored
      The __print_symbolic() function takes a sequence of key-value pairs for
      pretty-printing a constant.  The new kvm:kvm_exit print fmt uses the
      expression:
      
        __print_symbolic(..., { 0x040 + 1, "DB excp" }, ...)
      
      Currently only atoms are supported and this print fmt fails to parse.
      This patch adds support for expressions instead of just atoms so that
      0x040 + 1 is parsed successfully.
      
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337740619-27925-6-git-send-email-namhyung.kim@lge.comSigned-off-by: default avatarNamhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      00b9da72
    • Ingo Molnar's avatar
      Merge branch 'perf/core' of... · e76df19b
      Ingo Molnar authored
      Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull a 'perf evlist' fix from Arnaldo Carvalho de Melo.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e76df19b
    • Ingo Molnar's avatar
      Merge branch 'tip/perf/urgent' of... · 9ba05414
      Ingo Molnar authored
      Merge branch 'tip/perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/urgent
      
      Pull an ftrace ring-buffer fix from Steve Rostedt:
      
       * fix kernel crash when changing the size of the ring-buffer on
         boxes where possible_cpus != online_cpus.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      9ba05414
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal · f9369910
      Linus Torvalds authored
      Pull first series of signal handling cleanups from Al Viro:
       "This is just the first part of the queue (about a half of it);
        assorted fixes all over the place in signal handling.
      
        This one ends with all sigsuspend() implementations switched to
        generic one (->saved_sigmask-based).
      
        With this, a bunch of assorted old buglets are fixed and most of the
        missing bits of NOTIFY_RESUME hookup are in place.  Two more fixes sit
        in arm and um trees respectively, and there's a couple of broken ones
        that need obvious fixes - parisc and avr32 check TIF_NOTIFY_RESUME
        only on one of two codepaths; fixes for that will happen in the next
        series"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (55 commits)
        unicore32: if there's no handler we need to restore sigmask, syscall or no syscall
        xtensa: add handling of TIF_NOTIFY_RESUME
        microblaze: drop 'oldset' argument of do_notify_resume()
        microblaze: handle TIF_NOTIFY_RESUME
        score: add handling of NOTIFY_RESUME to do_notify_resume()
        m68k: add TIF_NOTIFY_RESUME and handle it.
        sparc: kill ancient comment in sparc_sigaction()
        h8300: missing checks of __get_user()/__put_user() return values
        frv: missing checks of __get_user()/__put_user() return values
        cris: missing checks of __get_user()/__put_user() return values
        powerpc: missing checks of __get_user()/__put_user() return values
        sh: missing checks of __get_user()/__put_user() return values
        sparc: missing checks of __get_user()/__put_user() return values
        avr32: struct old_sigaction is never used
        m32r: struct old_sigaction is never used
        xtensa: xtensa_sigaction doesn't exist
        alpha: tidy signal delivery up
        score: don't open-code force_sigsegv()
        cris: don't open-code force_sigsegv()
        blackfin: don't open-code force_sigsegv()
        ...
      f9369910
    • Mel Gorman's avatar
      mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkages · 05f144a0
      Mel Gorman authored
      Dave Jones' system call fuzz testing tool "trinity" triggered the
      following bug error with slab debugging enabled
      
          =============================================================================
          BUG numa_policy (Not tainted): Poison overwritten
          -----------------------------------------------------------------------------
      
          INFO: 0xffff880146498250-0xffff880146498250. First byte 0x6a instead of 0x6b
          INFO: Allocated in mpol_new+0xa3/0x140 age=46310 cpu=6 pid=32154
           __slab_alloc+0x3d3/0x445
           kmem_cache_alloc+0x29d/0x2b0
           mpol_new+0xa3/0x140
           sys_mbind+0x142/0x620
           system_call_fastpath+0x16/0x1b
          INFO: Freed in __mpol_put+0x27/0x30 age=46268 cpu=6 pid=32154
           __slab_free+0x2e/0x1de
           kmem_cache_free+0x25a/0x260
           __mpol_put+0x27/0x30
           remove_vma+0x68/0x90
           exit_mmap+0x118/0x140
           mmput+0x73/0x110
           exit_mm+0x108/0x130
           do_exit+0x162/0xb90
           do_group_exit+0x4f/0xc0
           sys_exit_group+0x17/0x20
           system_call_fastpath+0x16/0x1b
          INFO: Slab 0xffffea0005192600 objects=27 used=27 fp=0x          (null) flags=0x20000000004080
          INFO: Object 0xffff880146498250 @offset=592 fp=0xffff88014649b9d0
      
      This implied a reference counting bug and the problem happened during
      mbind().
      
      mbind() applies a new memory policy to a range and uses mbind_range() to
      merge existing VMAs or split them as necessary.  In the event of splits,
      mpol_dup() will allocate a new struct mempolicy and maintain existing
      reference counts whose rules are documented in
      Documentation/vm/numa_memory_policy.txt .
      
      The problem occurs with shared memory policies.  The vm_op->set_policy
      increments the reference count if necessary and split_vma() and
      vma_merge() have already handled the existing reference counts.
      However, policy_vma() screws it up by replacing an existing
      vma->vm_policy with one that potentially has the wrong reference count
      leading to a premature free.  This patch removes the damage caused by
      policy_vma().
      
      With this patch applied Dave's trinity tool runs an mbind test for 5
      minutes without error.  /proc/slabinfo reported that there are no
      numa_policy or shared_policy_node objects allocated after the test
      completed and the shared memory region was deleted.
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Cc: Dave Jones <davej@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Stephen Wilson <wilsons@start.ca>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      05f144a0
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Explicititely initialize input_name · a1d44b9a
      Arnaldo Carvalho de Melo authored
      It was a global variable, so it was initialized, implicitely, to zero by
      being placed in the bss.
      
      Now it is just a local variable that is then passed to the __cmd_evlist
      routine, so it must be explicitely set to NULL.
      
      The problem manifested on a Fedora 17 system, using:
      
       gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC)
      
      But not on several other systems, by luck.
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-5e8wolcjs3rgd5i6yi995gfh@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a1d44b9a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace · 644473e9
      Linus Torvalds authored
      Pull user namespace enhancements from Eric Biederman:
       "This is a course correction for the user namespace, so that we can
        reach an inexpensive, maintainable, and reasonably complete
        implementation.
      
        Highlights:
         - Config guards make it impossible to enable the user namespace and
           code that has not been converted to be user namespace safe.
      
         - Use of the new kuid_t type ensures the if you somehow get past the
           config guards the kernel will encounter type errors if you enable
           user namespaces and attempt to compile in code whose permission
           checks have not been updated to be user namespace safe.
      
         - All uids from child user namespaces are mapped into the initial
           user namespace before they are processed.  Removing the need to add
           an additional check to see if the user namespace of the compared
           uids remains the same.
      
         - With the user namespaces compiled out the performance is as good or
           better than it is today.
      
         - For most operations absolutely nothing changes performance or
           operationally with the user namespace enabled.
      
         - The worst case performance I could come up with was timing 1
           billion cache cold stat operations with the user namespace code
           enabled.  This went from 156s to 164s on my laptop (or 156ns to
           164ns per stat operation).
      
         - (uid_t)-1 and (gid_t)-1 are reserved as an internal error value.
           Most uid/gid setting system calls treat these value specially
           anyway so attempting to use -1 as a uid would likely cause
           entertaining failures in userspace.
      
         - If setuid is called with a uid that can not be mapped setuid fails.
           I have looked at sendmail, login, ssh and every other program I
           could think of that would call setuid and they all check for and
           handle the case where setuid fails.
      
         - If stat or a similar system call is called from a context in which
           we can not map a uid we lie and return overflowuid.  The LFS
           experience suggests not lying and returning an error code might be
           better, but the historical precedent with uids is different and I
           can not think of anything that would break by lying about a uid we
           can't map.
      
         - Capabilities are localized to the current user namespace making it
           safe to give the initial user in a user namespace all capabilities.
      
        My git tree covers all of the modifications needed to convert the core
        kernel and enough changes to make a system bootable to runlevel 1."
      
      Fix up trivial conflicts due to nearby independent changes in fs/stat.c
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (46 commits)
        userns:  Silence silly gcc warning.
        cred: use correct cred accessor with regards to rcu read lock
        userns: Convert the move_pages, and migrate_pages permission checks to use uid_eq
        userns: Convert cgroup permission checks to use uid_eq
        userns: Convert tmpfs to use kuid and kgid where appropriate
        userns: Convert sysfs to use kgid/kuid where appropriate
        userns: Convert sysctl permission checks to use kuid and kgids.
        userns: Convert proc to use kuid/kgid where appropriate
        userns: Convert ext4 to user kuid/kgid where appropriate
        userns: Convert ext3 to use kuid/kgid where appropriate
        userns: Convert ext2 to use kuid/kgid where appropriate.
        userns: Convert devpts to use kuid/kgid where appropriate
        userns: Convert binary formats to use kuid/kgid where appropriate
        userns: Add negative depends on entries to avoid building code that is userns unsafe
        userns: signal remove unnecessary map_cred_ns
        userns: Teach inode_capable to understand inodes whose uids map to other namespaces.
        userns: Fail exec for suid and sgid binaries with ids outside our user namespace.
        userns: Convert stat to return values mapped from kuids and kgids
        userns: Convert user specfied uids and gids in chown into kuids and kgid
        userns: Use uid_eq gid_eq helpers when comparing kuids and kgids in the vfs
        ...
      644473e9
    • Linus Torvalds's avatar
      Merge tag 'module-for-linus' of... · fb827ec6
      Linus Torvalds authored
      Merge tag 'module-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
      
      Pull module patches from Rusty Russell, who really sells them:
       "Three trivial patches of no real utility.  Modules are boring."
      
      But to make things slightly more exciting, he adds:
       "Fortunately David Howells is looking to change this, with his module
        signing patchset.  But that's for next merge window...
      
        Cheers,
        Rusty."
      
      * tag 'module-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
        Guard check in module loader against integer overflow
        modpost: use proper kernel style for autogenerated files
        modpost: Stop grab_file() from leaking filedescriptors if fstat() fails
      fb827ec6
    • Linus Torvalds's avatar
      Merge branch 'delete-mca' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux · d5b4bb4d
      Linus Torvalds authored
      Pull the MCA deletion branch from Paul Gortmaker:
       "It was good that we could support MCA machines back in the day, but
        realistically, nobody is using them anymore.  They were mostly limited
        to 386-sx 16MHz CPU and some 486 class machines and never more than
        64MB of RAM.  Even the enthusiast hobbyist community seems to have
        dried up close to ten years ago, based on what you can find searching
        various websites dedicated to the relatively short lived hardware.
      
        So lets remove the support relating to CONFIG_MCA.  There is no point
        carrying this forward, wasting cycles doing routine maintenance on it;
        wasting allyesconfig build time on validating it, wasting I/O on git
        grep'ping over it, and so on."
      
      Let's see if anybody screams.  It generally has compiled, and James
      Bottomley pointed out that there was a MCA extension from NCR that
      allowed for up to 4GB of memory and PPro-class machines.  So in *theory*
      there may be users out there.
      
      But even James (technically listed as a maintainer) doesn't actually
      have a system, and while Alan Cox claims to have a machine in his cellar
      that he offered to anybody who wants to take it off his hands, he didn't
      argue for keeping MCA support either.
      
      So we could bring it back.  But somebody had better speak up and talk
      about how they have actually been using said MCA hardware with modern
      kernels for us to do that.  And David already took the patch to delete
      all the networking driver code (commit a5e371f6: "drivers/net:
      delete all code/drivers depending on CONFIG_MCA").
      
      * 'delete-mca' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
        MCA: delete all remaining traces of microchannel bus support.
        scsi: delete the MCA specific drivers and driver code
        serial: delete the MCA specific 8250 support.
        arm: remove ability to select CONFIG_MCA
      d5b4bb4d
    • Linus Torvalds's avatar
      Merge tag 'md-3.5' of git://neil.brown.name/md · c80ddb52
      Linus Torvalds authored
      Pull md updates from NeilBrown:
       "It's been a busy cycle for md - lots of fun stuff here..  if you like
        this kind of thing :-)
      
        Main features:
         - RAID10 arrays can be reshaped - adding and removing devices and
           changing chunks (not 'far' array though)
         - allow RAID5 arrays to be reshaped with a backup file (not tested
           yet, but the priciple works fine for RAID10).
         - arrays can be reshaped while a bitmap is present - you no longer
           need to remove it first
         - SSSE3 support for RAID6 syndrome calculations
      
        and of course a number of minor fixes etc."
      
      * tag 'md-3.5' of git://neil.brown.name/md: (56 commits)
        md/bitmap: record the space available for the bitmap in the superblock.
        md/raid10: Remove extras after reshape to smaller number of devices.
        md/raid5: improve removal of extra devices after reshape.
        md: check the return of mddev_find()
        MD RAID1: Further conditionalize 'fullsync'
        DM RAID: Use md_error() in place of simply setting Faulty bit
        DM RAID: Record and handle missing devices
        DM RAID: Set recovery flags on resume
        md/raid5: Allow reshape while a bitmap is present.
        md/raid10: resize bitmap when required during reshape.
        md: allow array to be resized while bitmap is present.
        md/bitmap: make sure reshape request are reflected in superblock.
        md/bitmap: add bitmap_resize function to allow bitmap resizing.
        md/bitmap: use DIV_ROUND_UP instead of open-code
        md/bitmap: create a 'struct bitmap_counts' substructure of 'struct bitmap'
        md/bitmap: make bitmap bitops atomic.
        md/bitmap: make _page_attr bitops atomic.
        md/bitmap: merge bitmap_file_unmap and bitmap_file_put.
        md/bitmap: remove async freeing of bitmap file.
        md/bitmap: convert some spin_lock_irqsave to spin_lock_irq
        ...
      c80ddb52
  3. 23 May, 2012 19 commits
    • Linus Torvalds's avatar
      Merge branch 'sbp-target-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 2c13bc0f
      Linus Torvalds authored
      Pull sbp-2 (firewire) target mode support from Nicholas Bellinger:
       "The FireWire SBP-2 Target is a driver for using an IEEE-1394
        connection as a SCSI transport.  This module uses the SCSI Target
        framework to expose LUNs to other machines attached to a FireWire bus,
        in effect acting as a FireWire hard disk similar to FireWire Target
        Disk mode on many Apple computers.
      
        Also included are the two drivers/firewire/ patches required by
        sbp-target to access fw_request fabric speed needed for mgt_agent
        TCODE_WRITE_BLOCK_REQUEST ops, and exporting fw_card kref logic used
        when creating/destroying active session references to individual
        endpoints.
      
        A credit goes to Chris in being able to get this code up and running
        so quickly w/o any target core changes, and special thanks goes out to
        Stefan Richter + Clemens Ladisch + Andy Grover for their help in
        getting this driver ready for mainline.  Also, one of Chris's goals
        was to be able to connect sbp-target to a PowerPC based MacOS-X based
        client, that he accomplished along the way in this obligatory
        screenshot:
      
          http://linux-iscsi.org/wiki/File:Linux-fireware-target-bootc-macosx.png
      
        Great work Chris + linux-1394 team !!"
      Acked-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      
      * 'sbp-target-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        sbp-target: Initial merge of firewire/ieee-1394 target mode support
        firewire: Move fw_card kref functions into linux/firewire.h
        firewire: Add function to get speed from opaque struct fw_request
      2c13bc0f
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 0bd3fbd4
      Linus Torvalds authored
      Pull crypto updates from Herbert Xu:
       - New cipher/hash driver for ARM ux500.
       - Code clean-up for aesni-intel.
       - Misc fixes.
      
      Fixed up conflicts in arch/arm/mach-ux500/devices-common.h, where quite
      frankly some of it made no sense at all (the pull brought in a
      declaration for the dbx500_add_platform_device_noirq() function, which
      neither exists nor is used anywhere).
      
      Also some trivial add-add context conflicts in the Kconfig file in
      drivers/{char/hw_random,crypto}/
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: aesni-intel - move more common code to ablk_init_common
        crypto: aesni-intel - use crypto_[un]register_algs
        crypto: ux500 - Cleanup hardware identification
        crypto: ux500 - Update DMA handling for 3.4
        mach-ux500: crypto - core support for CRYP/HASH module.
        crypto: ux500 - Add driver for HASH hardware
        crypto: ux500 - Add driver for CRYP hardware
        hwrng: Kconfig - modify default state for atmel-rng driver
        hwrng: omap - use devm_request_and_ioremap
        crypto: crypto4xx - move up err_request_irq label
        crypto, xor: Sanitize checksumming function selection output
        crypto: caam - add backward compatible string sec4.0
      0bd3fbd4
    • Linus Torvalds's avatar
      Merge git://www.linux-watchdog.org/linux-watchdog · 0b87da68
      Linus Torvalds authored
      Pull first set of watchdog updates from Wim Van Sebroeck:
       "This pull contains:
      
         - The removal of ixp2000_wdt
         - The addition of ie6xx_wdt
         - Some documentation fixes
         - Small fixes and improvements
      
        (Note: Part 2 will contain generic watchdog core changes + conversion
        of some more drivers)"
      
      * git://www.linux-watchdog.org/linux-watchdog:
        Documentation/watchdog: Fix the file descriptor leak when no cmdline arg given
        Documentation/watchdog: close the fd when cmdline arg given
        Documentation/watchdog: Fix a small typo
        watchdog: s3c2410_wdt: Set timeout to actually achieved timeout
        watchdog: wm831x: Convert to gpio_request_one()
        watchdog: via_wdt: depends on PCI
        watchdog: ie6xx_wdt needs io.h
        watchdog: ie6xx_wdt.c: fix printk format warning
        watchdog: Add watchdog driver for Intel Atom E6XX
        watchdog: it87_wdt: Add support for IT8728F watchdog.
        watchdog: i6300esb: don't depend on X86
        watchdog: Use module_pci_driver
        watchdog: sch311x_wdt.c: Remove RESGEN
        watchdog: s3c2410-wdt: Use of_match_ptr().
        watchdog: Device tree support for pnx4008-wdt
        watchdog: ar7_wdt.c: use devm_request_and_ioremap
        watchdog: remove ixp2000 driver
        watchdog: sp5100_tco.c: quiet sparse noise about using plain integer was NULL pointer
      0b87da68
    • Linus Torvalds's avatar
      Merge tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev · 59d0952b
      Linus Torvalds authored
      Pull libata update from Jeff Garzik:
       "Changes, all of them boring and minor:
      
        1) Ugly MSFT Hyper-V workaround in ata_piix
      
        2) Fix a longstanding error recovery delay caused by excessive
           re-re-retries, when media errors occur.
      
        3) Minor hw-specific workarounds and quirks
      
        4) New PATA driver for ep93xx"
      
      * tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
        PATA host controller driver for ep93xx
        [libata] Add " 2GB ATA Flash Disk"/"ADMA428M" to DMA blacklist
        ata_generic: Skip is_intel_ider() check when ata_generic=1 is set
        libata-eh don't waste time retrying media errors (v3)
        ata_piix: defer disks to the Hyper-V drivers by default
        libata: add a host flag to ignore detected ATA devices
      59d0952b
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 1259f6ee
      Linus Torvalds authored
      Pull hwmon updates from Guenter Roeck:
       "New driver for INA219 and INA226, added support for IT8782F and
        IT8783E/F to it87 driver, plus cleanups in a couple of drivers."
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (it87) Make temp3 attribute conditional for IT8782F
        hwmon: (it87) Convert to use devm_kzalloc and devm_request_region
        hwmon: INA219 and INA226 support
        hwmon: (it87) Create voltage attributes only if voltage is enabled
        hwmon: (ntc_thermistor) Fix checkpatch warning
        hwmon: (ntc_thermistor) Optimize and fix build warning
        hwmon: (ntc_thermistor) Return error code from hwmon_device_register
        hwmon: (ntc_thermistor) Convert to devm_kzalloc
        hwmon: (ad7314) Remove unused defines, and rename OFFSET to SHIFT
        acpi_power_meter: clean up code around setup_attrs
        acpi_power_meter: drop meter_rw_attrs, use common meter_attrs
        acpi_power_meter: remove duplicate code between register_{ro,rw}_attrs
        acpi_power_meter: use a {RW,RO}_SENSOR_TEMPLATE macro to clean things up
        acpi_power_meter: use the same struct {rw,ro}_sensor_template for both
        hwmon: use module_pci_driver
        hwmon: (it87) Add support for IT8782F and IT8783E/F
      1259f6ee
    • Linus Torvalds's avatar
      Merge tag 'pm-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 468f4d1a
      Linus Torvalds authored
      Pull power management updates from Rafael Wysocki:
      
       - Implementation of opportunistic suspend (autosleep) and user space
         interface for manipulating wakeup sources.
      
       - Hibernate updates from Bojan Smojver and Minho Ban.
      
       - Updates of the runtime PM core and generic PM domains framework
         related to PM QoS.
      
       - Assorted fixes.
      
      * tag 'pm-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (25 commits)
        epoll: Fix user space breakage related to EPOLLWAKEUP
        PM / Domains: Make it possible to add devices to inactive domains
        PM / Hibernate: Use get_gendisk to verify partition if resume_file is integer format
        PM / Domains: Fix computation of maximum domain off time
        PM / Domains: Fix link checking when add subdomain
        PM / Sleep: User space wakeup sources garbage collector Kconfig option
        PM / Sleep: Make the limit of user space wakeup sources configurable
        PM / Documentation: suspend-and-cpuhotplug.txt: Fix typo
        PM / Domains: Cache device stop and domain power off governor results, v3
        PM / Domains: Make device removal more straightforward
        PM / Sleep: Fix a mistake in a conditional in autosleep_store()
        epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready
        PM / QoS: Create device constraints objects on notifier registration
        PM / Runtime: Remove device fields related to suspend time, v2
        PM / Domains: Rework default domain power off governor function, v2
        PM / Domains: Rework default device stop governor function, v2
        PM / Sleep: Add user space interface for manipulating wakeup sources, v3
        PM / Sleep: Add "prevent autosleep time" statistics to wakeup sources
        PM / Sleep: Implement opportunistic sleep, v2
        PM / Sleep: Add wakeup_source_activate and wakeup_source_deactivate tracepoints
        ...
      468f4d1a
    • Linus Torvalds's avatar
      Merge tag 'regmap-domain-deps' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · eb2689e0
      Linus Torvalds authored
      Pull a regmap kconfig dependency fix from Mark Brown:
       "Fix the dependency on IRQ_DOMAIN for REGMAP_IRQ in the core
      
        Fixes a missing select from the Palmas driver a bit more throoughly."
      
      * tag 'regmap-domain-deps' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: Use select .. if to get IRQ_DOMAIN enabled
      eb2689e0
    • Linus Torvalds's avatar
      Merge tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 2e341ca6
      Linus Torvalds authored
      Pull sound updates from Takashi Iwai:
       "This is the first big chunk for 3.5 merges of sound stuff.
      
        There are a few big changes in different areas.  First off, the
        streaming logic of USB-audio endpoints has been largely rewritten for
        the better support of "implicit feedback".  If anything about USB got
        broken, this change has to be checked.
      
        For HD-audio, the resume procedure was changed; instead of delaying
        the resume of the hardware until the first use, now waking up
        immediately at resume.  This is for buggy BIOS.
      
        For ASoC, dynamic PCM support and the improved support for digital
        links between off-SoC devices are major framework changes.
      
        Some highlights are below:
      
        * HD-audio
         - Avoid accesses of invalid pin-control bits that may stall the codec
         - V-ref setup cleanups
         - Fix the races in power-saving code
         - Fix the races in codec cache hashes and connection lists
         - Split some common codes for BIOS auto-parser to hda_auto_parser.c
         - Changed the PM resume code to wake up immediately for buggy BIOS
         - Creative SoundCore3D support
         - Add Conexant CX20751/2/3/4 codec support
      
        * ASoC
         - Dynamic PCM support, allowing support for SoCs with internal
           routing through components with tight sequencing and formatting
           constraints within their internal paths or where there are multiple
           components connected with CPU managed DMA controllers inside the
           SoC.
         - Greatly improved support for direct digital links between off-SoC
           devices, providing a much simpler way of connecting things like
           digital basebands to CODECs.
         - Much more fine grained and robust locking, cleaning up some of the
           confusion that crept in with multi-component.
         - CPU support for nVidia Tegra 30 I2S and audio hub controllers and
           ST-Ericsson MSP I2S controolers
         - New CODEC drivers for Cirrus CS42L52, LAPIS Semiconductor ML26124,
           Texas Instruments LM49453.
         - Some regmap changes needed by the Tegra I2S driver.
         - mc13783 audio support.
      
        * Misc
         - Rewrite with module_pci_driver()
         - Xonar DGX support for snd-oxygen
         - Improvement of packet handling in snd-firewire driver
         - New USB-endpoint streaming logic
         - Enhanced M-audio FTU quirks and relevant cleanups
         - Increment the support of OSS devices to 256
         - snd-aloop accuracy improvement
      
        There are a few more pending changes for 3.5, but they will be sent
        slightly later as partly depending on the changes of DRM."
      
      Fix up conflicts in regmap (due to duplicate patches, with some further
      updates then having already come in from the regmap tree).  Also some
      fairly trivial context conflicts in the imx and mcx soc drivers.
      
      * tag 'sound-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (280 commits)
        ALSA: snd-usb: fix stream info output in /proc
        ALSA: pcm - Add proper state checks to snd_pcm_drain()
        ALSA: sh: Fix up namespace collision in sh_dac_audio.
        ALSA: hda/realtek - Fix unused variable compile warning
        ASoC: sh: fsi: enable chip specific data transfer mode
        ASoC: sh: fsi: call fsi_hw_startup/shutdown from fsi_dai_trigger()
        ASoC: sh: fsi: use same format for IN/OUT
        ASoC: sh: fsi: add fsi_version() and removed meaningless version check
        ASoC: sh: fsi: use register field macro name on IN/OUT_DMAC
        ASoC: tegra: Add machine driver for WM8753 codec
        ALSA: hda - Fix possible races of accesses to connection list array
        ASoC: OMAP: HDMI: Introduce codec
        ARM: mx31_3ds: Add sound support
        ASoC: imx-mc13783 cleanup
        mx31moboard: Add sound support
        ASoC: mc13783 codec cleanups
        ASoC: add imx-mc13783 sound support
        ASoC: Add mc13783 codec
        mfd: mc13xxx: add codec platform data
        ASoC: don't flip master of DT-instantiated DAI links
        ...
      2e341ca6
    • Linus Torvalds's avatar
      Merge tag 'ktest-v3.5-spelling' of... · 927ad551
      Linus Torvalds authored
      Merge tag 'ktest-v3.5-spelling' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest
      
      Pull trivial ktest spelling fix from Steven Rostedt:
       "I promised Jesper that I would push this for 3.5, but forgot to add it
        to my queue.  It's just a spelling fix, but it should go in regardless
        to hide my inability to get words in the English language correct."
      
      Becuse gud spealing is impurtunt.
      
      * tag 'ktest-v3.5-spelling' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
        ktest: Change singular "paranthesis" to plural "parentheses"
      927ad551
    • Steven Rostedt's avatar
      ring-buffer: Check for valid buffer before changing size · 6a31e1f1
      Steven Rostedt authored
      On some machines the number of possible CPUS is not the same as the
      number of CPUs that is on the machine. Ftrace uses possible_cpus to
      update the tracing structures but the ring buffer only allocates
      per cpu buffers for online CPUs when they come up.
      
      When the wakeup tracer was enabled in such a case, the ftrace code
      enabled all possible cpu buffers, but the code in ring_buffer_resize()
      did not check to see if the buffer in question was allocated. Since
      boot up CPUs did not match possible CPUs it caused the following
      crash:
      
      BUG: unable to handle kernel NULL pointer dereference at 00000020
      IP: [<c1097851>] ring_buffer_resize+0x16a/0x28d
      *pde = 00000000
      Oops: 0000 [#1] PREEMPT SMP
      Dumping ftrace buffer:
         (ftrace buffer empty)
      Modules linked in: [last unloaded: scsi_wait_scan]
      
      Pid: 1387, comm: bash Not tainted 3.4.0-test+ #13                  /DG965MQ
      EIP: 0060:[<c1097851>] EFLAGS: 00010217 CPU: 0
      EIP is at ring_buffer_resize+0x16a/0x28d
      EAX: f5a14340 EBX: f6026b80 ECX: 00000ff4 EDX: 00000ff3
      ESI: 00000000 EDI: 00000002 EBP: f4275ecc ESP: f4275eb0
       DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
      CR0: 80050033 CR2: 00000020 CR3: 34396000 CR4: 000007d0
      DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      DR6: ffff0ff0 DR7: 00000400
      Process bash (pid: 1387, ti=f4274000 task=f4380cb0 task.ti=f4274000)
      Stack:
       c109cf9a f6026b98 00000162 00160f68 00000006 00160f68 00000002 f4275ef0
       c109d013 f4275ee8 c123b72a c1c0bf00 c1cc81dc 00000005 f4275f98 00000007
       f4275f70 c109d0c7 7700000e 75656b61 00000070 f5e90900 f5c4e198 00000301
      Call Trace:
       [<c109cf9a>] ? tracing_set_tracer+0x115/0x1e9
       [<c109d013>] tracing_set_tracer+0x18e/0x1e9
       [<c123b72a>] ? _copy_from_user+0x30/0x46
       [<c109d0c7>] tracing_set_trace_write+0x59/0x7f
       [<c10ec01e>] ? fput+0x18/0x1c6
       [<c11f8732>] ? security_file_permission+0x27/0x2b
       [<c10eaacd>] ? rw_verify_area+0xcf/0xf2
       [<c10ec01e>] ? fput+0x18/0x1c6
       [<c109d06e>] ? tracing_set_tracer+0x1e9/0x1e9
       [<c10ead77>] vfs_write+0x8b/0xe3
       [<c10ebead>] ? fget_light+0x30/0x81
       [<c10eaf54>] sys_write+0x42/0x63
       [<c1834fbf>] sysenter_do_call+0x12/0x28
      
      This happens with the latency tracer as the ftrace code updates the
      saved max buffer via its cpumask and not with a global setting.
      
      Adding a check in ring_buffer_resize() to make sure the buffer being resized
      exists, fixes the problem.
      
      Cc: Vaibhav Nagarnaik <vnagarnaik@google.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      6a31e1f1
    • Linus Torvalds's avatar
      Merge branches 'perf-urgent-for-linus' and 'perf-core-for-linus' of... · 56edab31
      Linus Torvalds authored
      Merge branches 'perf-urgent-for-linus' and 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
      
      Pull perf fixes from Ingo Molnar:
      
       - Leftover AMD PMU driver fix fix from the end of the v3.4
         stabilization cycle.
      
       - Late tools/perf/ changes that missed the first round:
          * endianness fixes
          * event parsing improvements
          * libtraceevent fixes factored out from trace-cmd
          * perl scripting engine fixes related to libtraceevent,
          * testcase improvements
          * perf inject / pipe mode fixes
          * plus a kernel side fix
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86: Update event scheduling constraints for AMD family 15h models
      
      * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        Revert "sched, perf: Use a single callback into the scheduler"
        perf evlist: Show event attribute details
        perf tools: Bump default sample freq to 4 kHz
        perf buildid-list: Work better with pipe mode
        perf tools: Fix piped mode read code
        perf inject: Fix broken perf inject -b
        perf tools: rename HEADER_TRACE_INFO to HEADER_TRACING_DATA
        perf tools: Add union u64_swap type for swapping u64 data
        perf tools: Carry perf_event_attr bitfield throught different endians
        perf record: Fix documentation for branch stack sampling
        perf target: Add cpu flag to sample_type if target has cpu
        perf tools: Always try to build libtraceevent
        perf tools: Rename libparsevent to libtraceevent in Makefile
        perf script: Rename struct event to struct event_format in perl engine
        perf script: Explicitly handle known default print arg type
        perf tools: Add hardcoded name term for pmu events
        perf tools: Separate 'mem:' event scanner bits
        perf tools: Use allocated list for each parsed event
        perf tools: Add support for displaying event parser debug info
        perf test: Move parse event automated tests to separated object
      56edab31
    • Linus Torvalds's avatar
      Merge tag 'ia64-3.5-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux · 3813d402
      Linus Torvalds authored
      Pull Itanium fixes from Tony Luck.
      
      * tag 'ia64-3.5-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
        [IA64] Liberate the signal layer from IA64 assembler
        [IA64] Add cmpxchg.h to exported userspace headers
        [IA64] Fix fast syscall version of getcpu()
        [IA64] Removed "task_size" element from thread_struct - it is now constant
      3813d402
    • Linus Torvalds's avatar
      Merge branch 'x86-reboot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2335a836
      Linus Torvalds authored
      Pull x86 reboot changes from Ingo Molnar:
       "The biggest change is a gentler method of rebooting/stopping via IRQs
        first and then via NMIs.  There are several cleanups in the tree as
        well."
      
      * 'x86-reboot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/reboot: Update nonmi_ipi parameter
        x86/reboot: Use NMI to assist in shutting down if IRQ fails
        Revert "x86, reboot: Use NMI instead of REBOOT_VECTOR to stop cpus"
        x86/reboot: Clean up coding style
        x86/reboot: Reduce to a single DMI table for reboot quirks
      2335a836
    • Linus Torvalds's avatar
      Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 44bc40e1
      Linus Torvalds authored
      Pull x86 platform changes from Ingo Molnar:
       "This tree includes assorted platform driver updates and a preparatory
        series for a platform with custom DMA remapping semantics (sta2x11 I/O
        hub)."
      
      * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/vsmp: Fix number of CPUs when vsmp is disabled
        keyboard: Use BIOS Keyboard variable to set Numlock
        x86/olpc/xo1/sci: Report RTC wakeup events
        x86/olpc/xo1/sci: Produce wakeup events for buttons and switches
        x86, platform: Initial support for sta2x11 I/O hub
        x86: Introduce CONFIG_X86_DMA_REMAP
        x86-32: Introduce CONFIG_X86_DEV_DMA_OPS
      44bc40e1
    • Linus Torvalds's avatar
      Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 02171b4a
      Linus Torvalds authored
      Pull x86 mm changes from Ingo Molnar:
       "This tree includes a micro-optimization that avoids cr3 switches
        during idling; it fixes corner cases and there's also small cleanups"
      
      Fix up trivial context conflict with the percpu_xx -> this_cpu_xx
      changes.
      
      * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86-64: Fix accounting in kernel_physical_mapping_init()
        x86/tlb: Clean up and unify TLB_FLUSH_ALL definition
        x86: Drop obsolete ARCH_BOOTMEM support
        x86, tlb: Switch cr3 in leave_mm() only when needed
        x86/mm: Fix the size calculation of mapping tables
      02171b4a
    • Linus Torvalds's avatar
      Merge branch 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 70311aaa
      Linus Torvalds authored
      Pull MCE updates from Ingo Molnar:
       "This tree updates/fixes MCE hardware support, it makes the APIC LVT
        thresholding interrupt optional because a subset of AMD F15h models
        don't support it."
      
      * 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, MCE, AMD: Disable error thresholding bank 4 on some models
        x86, MCE, AMD: Hide interrupt_enable sysfs node
        x86, MCE, AMD: Make APIC LVT thresholding interrupt optional
      70311aaa
    • Linus Torvalds's avatar
      Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ec0d7f18
      Linus Torvalds authored
      Pull fpu state cleanups from Ingo Molnar:
       "This tree streamlines further aspects of FPU handling by eliminating
        the prepare_to_copy() complication and moving that logic to
        arch_dup_task_struct().
      
        It also fixes the FPU dumps in threaded core dumps, removes and old
        (and now invalid) assumption plus micro-optimizes the exit path by
        avoiding an FPU save for dead tasks."
      
      Fixed up trivial add-add conflict in arch/sh/kernel/process.c that came
      in because we now do the FPU handling in arch_dup_task_struct() rather
      than the legacy (and now gone) prepare_to_copy().
      
      * 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, fpu: drop the fpu state during thread exit
        x86, xsave: remove thread_has_fpu() bug check in __sanitize_i387_state()
        coredump: ensure the fpu state is flushed for proper multi-threaded core dump
        fork: move the real prepare_to_copy() users to arch_dup_task_struct()
      ec0d7f18
    • Linus Torvalds's avatar
      Merge branch 'x86-extable-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 269af9a1
      Linus Torvalds authored
      Pull exception table generation updates from Ingo Molnar:
       "The biggest change here is to allow the build-time sorting of the
        exception table, to speed up booting.  This is achieved by the
        architecture enabling BUILDTIME_EXTABLE_SORT.  This option is enabled
        for x86 and MIPS currently.
      
        On x86 a number of fixes and changes were needed to allow build-time
        sorting of the exception table, in particular a relocation invariant
        exception table format was needed.  This required the abstracting out
        of exception table protocol and the removal of 20 years of accumulated
        assumptions about the x86 exception table format.
      
        While at it, this tree also cleans up various other aspects of
        exception handling, such as early(er) exception handling for
        rdmsr_safe() et al.
      
        All in one, as the result of these changes the x86 exception code is
        now pretty nice and modern.  As an added bonus any regressions in this
        code will be early and violent crashes, so if you see any of those,
        you'll know whom to blame!"
      
      Fix up trivial conflicts in arch/{mips,x86}/Kconfig files due to nearby
      modifications of other core architecture options.
      
      * 'x86-extable-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (35 commits)
        Revert "x86, extable: Disable presorted exception table for now"
        scripts/sortextable: Handle relative entries, and other cleanups
        x86, extable: Switch to relative exception table entries
        x86, extable: Disable presorted exception table for now
        x86, extable: Add _ASM_EXTABLE_EX() macro
        x86, extable: Remove open-coded exception table entries in arch/x86/ia32/ia32entry.S
        x86, extable: Remove open-coded exception table entries in arch/x86/include/asm/xsave.h
        x86, extable: Remove open-coded exception table entries in arch/x86/include/asm/kvm_host.h
        x86, extable: Remove the now-unused __ASM_EX_SEC macros
        x86, extable: Remove open-coded exception table entries in arch/x86/xen/xen-asm_32.S
        x86, extable: Remove open-coded exception table entries in arch/x86/um/checksum_32.S
        x86, extable: Remove open-coded exception table entries in arch/x86/lib/usercopy_32.c
        x86, extable: Remove open-coded exception table entries in arch/x86/lib/putuser.S
        x86, extable: Remove open-coded exception table entries in arch/x86/lib/getuser.S
        x86, extable: Remove open-coded exception table entries in arch/x86/lib/csum-copy_64.S
        x86, extable: Remove open-coded exception table entries in arch/x86/lib/copy_user_nocache_64.S
        x86, extable: Remove open-coded exception table entries in arch/x86/lib/copy_user_64.S
        x86, extable: Remove open-coded exception table entries in arch/x86/lib/checksum_32.S
        x86, extable: Remove open-coded exception table entries in arch/x86/kernel/test_rodata.c
        x86, extable: Remove open-coded exception table entries in arch/x86/kernel/entry_64.S
        ...
      269af9a1
    • Linus Torvalds's avatar
      Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8ca038dc
      Linus Torvalds authored
      Pull x86 EFI updates from Ingo Molnar:
       "This patchset makes changes to the bzImage EFI header, so that it can
        be signed with a secure boot signature tool.  It should not affect
        anyone who is not using the EFI self-boot feature in any way."
      
      * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86, efi: Fix NumberOfRvaAndSizes field in PE32 header for EFI_STUB
        x86, efi: Fix .text section overlapping image header for EFI_STUB
        x86, efi: Fix issue of overlapping .reloc section for EFI_STUB
      8ca038dc