1. 11 Jul, 2017 1 commit
    • Steven Rostedt (VMware)'s avatar
      tracing: Fixup trace file header alignment · b11fb737
      Steven Rostedt (VMware) authored
      The addition of TGID to the tracing header added a check to see if TGID
      shoudl be displayed or not, and updated the header accordingly.
      Unfortunately, it broke the default header.
      
      Also add constant strings to use for spacing. This does remove the
      visibility of the header a bit, but cuts it down from the extended lines
      much greater than 80 characters.
      
      Before this change:
      
       # tracer: function
       #
       #                            _-----=> irqs-off
       #                           / _----=> need-resched
       #                          | / _---=> hardirq/softirq
       #                          || / _--=> preempt-depth
       #                          ||| /     delay
       #           TASK-PID   CPU#||||    TIMESTAMP  FUNCTION
       #              | |       | ||||       |         |
              swapper/0-1     [000] ....     0.277830: migration_init <-do_one_initcall
              swapper/0-1     [002] d...    13.861967: Unknown type 1201
              swapper/0-1     [002] d..1    13.861970: Unknown type 1202
      
      After this change:
      
       # tracer: function
       #
       #                              _-----=> irqs-off
       #                             / _----=> need-resched
       #                            | / _---=> hardirq/softirq
       #                            || / _--=> preempt-depth
       #                            ||| /     delay
       #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
       #              | |       |   ||||       |         |
              swapper/0-1     [000] ....     0.278245: migration_init <-do_one_initcall
              swapper/0-1     [003] d...    13.861189: Unknown type 1201
              swapper/0-1     [003] d..1    13.861192: Unknown type 1202
      
      Cc: Joel Fernandes <joelaf@google.com>
      Fixes: 441dae8f ("tracing: Add support for display of tgid in trace output")
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      b11fb737
  2. 09 Jul, 2017 4 commits
  3. 07 Jul, 2017 3 commits
  4. 06 Jul, 2017 1 commit
  5. 05 Jul, 2017 2 commits
  6. 29 Jun, 2017 1 commit
    • Steven Rostedt (VMware)'s avatar
      ftrace: Fix regression with module command in stack_trace_filter · 0f179765
      Steven Rostedt (VMware) authored
      When doing the following command:
      
       # echo ":mod:kvm_intel" > /sys/kernel/tracing/stack_trace_filter
      
      it triggered a crash.
      
      This happened with the clean up of probes. It required all callers to the
      regex function (doing ftrace filtering) to have ops->private be a pointer to
      a trace_array. But for the stack tracer, that is not the case.
      
      Allow for the ops->private to be NULL, and change the function command
      callbacks to handle the trace_array pointer being NULL as well.
      
      Fixes: d2afd57a ("tracing/ftrace: Allow instances to have their own function probes")
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      0f179765
  7. 28 Jun, 2017 2 commits
  8. 27 Jun, 2017 5 commits
  9. 26 Jun, 2017 4 commits
    • Steven Rostedt (VMware)'s avatar
      ftrace: Have cached module filters be an active filter · 8c08f0d5
      Steven Rostedt (VMware) authored
      When a module filter is added to set_ftrace_filter, if the module is not
      loaded, it is cached. This should be considered an active filter, and
      function tracing should be filtered by this. That is, if a cached module
      filter is the only filter set, then no function tracing should be happening,
      as all the functions available will be filtered out.
      
      This makes sense, as the reason to add a cached module filter, is to trace
      the module when you load it. There shouldn't be any other tracing happening
      until then.
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      8c08f0d5
    • Steven Rostedt (VMware)'s avatar
      ftrace: Implement cached modules tracing on module load · d7fbf8df
      Steven Rostedt (VMware) authored
      If a module is cached in the set_ftrace_filter, and that module is loaded,
      then enable tracing on that module as if the cached module text was written
      into set_ftrace_filter just as the module is loaded.
      
        # echo ":mod:kvm_intel" >
        # cat /sys/kernel/tracing/set_ftrace_filter
       #### all functions enabled ####
       :mod:kvm_intel
        # modprobe kvm_intel
        # cat /sys/kernel/tracing/set_ftrace_filter
       vmx_get_rflags [kvm_intel]
       vmx_get_pkru [kvm_intel]
       vmx_get_interrupt_shadow [kvm_intel]
       vmx_rdtscp_supported [kvm_intel]
       vmx_invpcid_supported [kvm_intel]
       [..]
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      d7fbf8df
    • Steven Rostedt (VMware)'s avatar
      ftrace: Have the cached module list show in set_ftrace_filter · 5985ea8b
      Steven Rostedt (VMware) authored
      When writing in a module filter into set_ftrace_filter for a module that is
      not yet loaded, it it cached, and will be executed when the module is loaded
      (although that is not implemented yet at this commit). Display the list of
      cached modules to be traced.
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      5985ea8b
    • Steven Rostedt (VMware)'s avatar
      ftrace: Add :mod: caching infrastructure to trace_array · 673feb9d
      Steven Rostedt (VMware) authored
      This is the start of the infrastructure work to allow for tracing module
      functions before it is loaded.
      
      Currently the following command:
      
        # echo :mod:some-mod > set_ftrace_filter
      
      will enable tracing of all functions within the module "some-mod" if it is
      loaded. What we want, is if the module is not loaded, that line will be
      saved. When the module is loaded, then the "some-mod" will have that line
      executed on it, so that the functions within it starts being traced.
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      673feb9d
  10. 22 Jun, 2017 1 commit
    • Steven Rostedt (VMware)'s avatar
      tracing: Show address when function names are not found · feaf1283
      Steven Rostedt (VMware) authored
      Currently, when a function is not found in kallsyms, instead of simply
      showing the function address, it shows nothing at all:
      
       # echo ':mod:kvm_intel' > /sys/kernel/tracing/set_ftrace_filter
       # echo function > /sys/kernel/tracing/set_ftrace_filter
       # qemu -enable-kvm /home/my-qemu-image
         <Ctrl-C>
       # rmmod kvm_intel
       # cat /sys/kernel/tracing/trace
       qemu-system-x86-2408  [001] d..2   135.013238:  <-kvm_arch_hardware_enable
       qemu-system-x86-2408  [001] ....   135.014574:  <-kvm_arch_vm_ioctl
       qemu-system-x86-2408  [001] ....   135.015420:  <-kvm_vm_ioctl_check_extension
       qemu-system-x86-2408  [001] ....   135.045411:  <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ....   135.045412:  <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ....   135.045412:  <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ....   135.045412:  <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ...1   135.045413:  <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ....   135.045413:  <-__do_cpuid_ent
      
      When it should show:
      
       qemu-system-x86-2408  [001] d..2   135.013238: 0xffffffffa02a39f0 <-kvm_arch_hardware_enable
       qemu-system-x86-2408  [001] ....   135.014574: 0xffffffffa02a2ba0 <-kvm_arch_vm_ioctl
       qemu-system-x86-2408  [001] ....   135.015420: 0xffffffffa029e4e0 <-kvm_vm_ioctl_check_extension
       qemu-system-x86-2408  [001] ....   135.045411: 0xffffffffa02a1380 <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ....   135.045412: 0xffffffffa029e160 <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ....   135.045412: 0xffffffffa029e180 <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ....   135.045412: 0xffffffffa029e520 <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ...1   135.045413: 0xffffffffa02a13b0 <-__do_cpuid_ent
       qemu-system-x86-2408  [001] ....   135.045413: 0xffffffffa02a1380 <-__do_cpuid_ent
      
      instead.
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      feaf1283
  11. 21 Jun, 2017 1 commit
  12. 13 Jun, 2017 12 commits
  13. 11 Jun, 2017 3 commits
    • Linus Torvalds's avatar
      Linux 4.12-rc5 · 32c1431e
      Linus Torvalds authored
      32c1431e
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 32627645
      Linus Torvalds authored
      Pull key subsystem fixes from James Morris:
       "Here are a bunch of fixes for Linux keyrings, including:
      
         - Fix up the refcount handling now that key structs use the
           refcount_t type and the refcount_t ops don't allow a 0->1
           transition.
      
         - Fix a potential NULL deref after error in x509_cert_parse().
      
         - Don't put data for the crypto algorithms to use on the stack.
      
         - Fix the handling of a null payload being passed to add_key().
      
         - Fix incorrect cleanup an uninitialised key_preparsed_payload in
           key_update().
      
         - Explicit sanitisation of potentially secure data before freeing.
      
         - Fixes for the Diffie-Helman code"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (23 commits)
        KEYS: fix refcount_inc() on zero
        KEYS: Convert KEYCTL_DH_COMPUTE to use the crypto KPP API
        crypto : asymmetric_keys : verify_pefile:zero memory content before freeing
        KEYS: DH: add __user annotations to keyctl_kdf_params
        KEYS: DH: ensure the KDF counter is properly aligned
        KEYS: DH: don't feed uninitialized "otherinfo" into KDF
        KEYS: DH: forbid using digest_null as the KDF hash
        KEYS: sanitize key structs before freeing
        KEYS: trusted: sanitize all key material
        KEYS: encrypted: sanitize all key material
        KEYS: user_defined: sanitize key payloads
        KEYS: sanitize add_key() and keyctl() key payloads
        KEYS: fix freeing uninitialized memory in key_update()
        KEYS: fix dereferencing NULL payload with nonzero length
        KEYS: encrypted: use constant-time HMAC comparison
        KEYS: encrypted: fix race causing incorrect HMAC calculations
        KEYS: encrypted: fix buffer overread in valid_master_desc()
        KEYS: encrypted: avoid encrypting/decrypting stack buffers
        KEYS: put keyring if install_session_keyring_to_cred() fails
        KEYS: Delete an error message for a failed memory allocation in get_derived_key()
        ...
      32627645
    • Linus Torvalds's avatar
      compiler, clang: properly override 'inline' for clang · 6d53cefb
      Linus Torvalds authored
      Commit abb2ea7d ("compiler, clang: suppress warning for unused
      static inline functions") just caused more warnings due to re-defining
      the 'inline' macro.
      
      So undef it before re-defining it, and also add the 'notrace' attribute
      like the gcc version that this is overriding does.
      
      Maybe this makes clang happier.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6d53cefb