1. 04 6月, 2019 1 次提交
  2. 31 5月, 2019 1 次提交
    • N
      x86/modules: Avoid breaking W^X while loading modules · 8715ce03
      Nadav Amit 提交于
      [ Upstream commit f2c65fb3221adc6b73b0549fc7ba892022db9797 ]
      
      When modules and BPF filters are loaded, there is a time window in
      which some memory is both writable and executable. An attacker that has
      already found another vulnerability (e.g., a dangling pointer) might be
      able to exploit this behavior to overwrite kernel code. Prevent having
      writable executable PTEs in this stage.
      
      In addition, avoiding having W+X mappings can also slightly simplify the
      patching of modules code on initialization (e.g., by alternatives and
      static-key), as would be done in the next patch. This was actually the
      main motivation for this patch.
      
      To avoid having W+X mappings, set them initially as RW (NX) and after
      they are set as RO set them as X as well. Setting them as executable is
      done as a separate step to avoid one core in which the old PTE is cached
      (hence writable), and another which sees the updated PTE (executable),
      which would break the W^X protection.
      Suggested-by: NThomas Gleixner <tglx@linutronix.de>
      Suggested-by: NAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: NNadav Amit <namit@vmware.com>
      Signed-off-by: NRick Edgecombe <rick.p.edgecombe@intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: <akpm@linux-foundation.org>
      Cc: <ard.biesheuvel@linaro.org>
      Cc: <deneen.t.dock@intel.com>
      Cc: <kernel-hardening@lists.openwall.com>
      Cc: <kristen@linux.intel.com>
      Cc: <linux_dti@icloud.com>
      Cc: <will.deacon@arm.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Rik van Riel <riel@surriel.com>
      Link: https://lkml.kernel.org/r/20190426001143.4983-12-namit@vmware.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8715ce03
  3. 13 2月, 2019 1 次提交
  4. 23 8月, 2018 1 次提交
    • A
      module: use relative references for __ksymtab entries · 7290d580
      Ard Biesheuvel 提交于
      An ordinary arm64 defconfig build has ~64 KB worth of __ksymtab entries,
      each consisting of two 64-bit fields containing absolute references, to
      the symbol itself and to a char array containing its name, respectively.
      
      When we build the same configuration with KASLR enabled, we end up with an
      additional ~192 KB of relocations in the .init section, i.e., one 24 byte
      entry for each absolute reference, which all need to be processed at boot
      time.
      
      Given how the struct kernel_symbol that describes each entry is completely
      local to module.c (except for the references emitted by EXPORT_SYMBOL()
      itself), we can easily modify it to contain two 32-bit relative references
      instead.  This reduces the size of the __ksymtab section by 50% for all
      64-bit architectures, and gets rid of the runtime relocations entirely for
      architectures implementing KASLR, either via standard PIE linking (arm64)
      or using custom host tools (x86).
      
      Note that the binary search involving __ksymtab contents relies on each
      section being sorted by symbol name.  This is implemented based on the
      input section names, not the names in the ksymtab entries, so this patch
      does not interfere with that.
      
      Given that the use of place-relative relocations requires support both in
      the toolchain and in the module loader, we cannot enable this feature for
      all architectures.  So make it dependent on whether
      CONFIG_HAVE_ARCH_PREL32_RELOCATIONS is defined.
      
      Link: http://lkml.kernel.org/r/20180704083651.24360-4-ard.biesheuvel@linaro.orgSigned-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NJessica Yu <jeyu@kernel.org>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: James Morris <james.morris@microsoft.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Nicolas Pitre <nico@linaro.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Garnier <thgarnie@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7290d580
  5. 03 8月, 2018 1 次提交
  6. 17 7月, 2018 1 次提交
  7. 02 7月, 2018 1 次提交
    • J
      modsign: log module name in the event of an error · f314dfea
      Jessica Yu 提交于
      Now that we have the load_info struct all initialized (including
      info->name, which contains the name of the module) before
      module_sig_check(), make the load_info struct and hence module name
      available to mod_verify_sig() so that we can log the module name in the
      event of an error.
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      f314dfea
  8. 25 6月, 2018 2 次提交
  9. 22 6月, 2018 2 次提交
    • J
      module: setup load info before module_sig_check() · 5fdc7db6
      Jessica Yu 提交于
      We want to be able to log the module name in early error messages, such as
      when module signature verification fails.  Previously, the module name is
      set in layout_and_allocate(), meaning that any error messages that happen
      before (such as those in module_sig_check()) won't be logged with a module
      name, which isn't terribly helpful.
      
      In order to do this, reshuffle the order in load_module() and set up
      load info earlier so that we can log the module name along with these
      error messages. This requires splitting rewrite_section_headers() out of
      setup_load_info().
      
      While we're at it, clean up and split up the operations done in
      layout_and_allocate(), setup_load_info(), and rewrite_section_headers()
      more cleanly so these functions only perform what their names suggest.
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      5fdc7db6
    • J
      module: make it clear when we're handling the module copy in info->hdr · 81a0abd9
      Jessica Yu 提交于
      In load_module(), it's not always clear whether we're handling the
      temporary module copy in info->hdr (which is freed at the end of
      load_module()) or if we're handling the module already allocated and
      copied to it's final place. Adding an info->mod field and using it
      whenever we're handling the temporary copy makes that explicitly clear.
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      81a0abd9
  10. 18 6月, 2018 1 次提交
    • J
      module: exclude SHN_UNDEF symbols from kallsyms api · 9f2d1e68
      Jessica Yu 提交于
      Livepatch modules are special in that we preserve their entire symbol
      tables in order to be able to apply relocations after module load. The
      unwanted side effect of this is that undefined (SHN_UNDEF) symbols of
      livepatch modules are accessible via the kallsyms api and this can
      confuse symbol resolution in livepatch (klp_find_object_symbol()) and
      cause subtle bugs in livepatch.
      
      Have the module kallsyms api skip over SHN_UNDEF symbols. These symbols
      are usually not available for normal modules anyway as we cut down their
      symbol tables to just the core (non-undefined) symbols, so this should
      really just affect livepatch modules. Note that this patch doesn't
      affect the display of undefined symbols in /proc/kallsyms.
      Reported-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Tested-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Reviewed-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      9f2d1e68
  11. 07 6月, 2018 1 次提交
    • K
      treewide: Use struct_size() for kmalloc()-family · acafe7e3
      Kees Cook 提交于
      One of the more common cases of allocation size calculations is finding
      the size of a structure that has a zero-sized array at the end, along
      with memory for some number of elements for that array. For example:
      
      struct foo {
          int stuff;
          void *entry[];
      };
      
      instance = kmalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);
      
      Instead of leaving these open-coded and prone to type mistakes, we can
      now use the new struct_size() helper:
      
      instance = kmalloc(struct_size(instance, entry, count), GFP_KERNEL);
      
      This patch makes the changes for kmalloc()-family (and kvmalloc()-family)
      uses. It was done via automatic conversion with manual review for the
      "CHECKME" non-standard cases noted below, using the following Coccinelle
      script:
      
      // pkey_cache = kmalloc(sizeof *pkey_cache + tprops->pkey_tbl_len *
      //                      sizeof *pkey_cache->table, GFP_KERNEL);
      @@
      identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
      expression GFP;
      identifier VAR, ELEMENT;
      expression COUNT;
      @@
      
      - alloc(sizeof(*VAR) + COUNT * sizeof(*VAR->ELEMENT), GFP)
      + alloc(struct_size(VAR, ELEMENT, COUNT), GFP)
      
      // mr = kzalloc(sizeof(*mr) + m * sizeof(mr->map[0]), GFP_KERNEL);
      @@
      identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
      expression GFP;
      identifier VAR, ELEMENT;
      expression COUNT;
      @@
      
      - alloc(sizeof(*VAR) + COUNT * sizeof(VAR->ELEMENT[0]), GFP)
      + alloc(struct_size(VAR, ELEMENT, COUNT), GFP)
      
      // Same pattern, but can't trivially locate the trailing element name,
      // or variable name.
      @@
      identifier alloc =~ "kmalloc|kzalloc|kvmalloc|kvzalloc";
      expression GFP;
      expression SOMETHING, COUNT, ELEMENT;
      @@
      
      - alloc(sizeof(SOMETHING) + COUNT * sizeof(ELEMENT), GFP)
      + alloc(CHECKME_struct_size(&SOMETHING, ELEMENT, COUNT), GFP)
      Signed-off-by: NKees Cook <keescook@chromium.org>
      acafe7e3
  12. 12 5月, 2018 1 次提交
  13. 19 4月, 2018 1 次提交
    • T
      module: Fix display of wrong module .text address · be71eda5
      Thomas Richter 提交于
      Reading file /proc/modules shows the correct address:
      [root@s35lp76 ~]# cat /proc/modules | egrep '^qeth_l2'
      qeth_l2 94208 1 - Live 0x000003ff80401000
      
      and reading file /sys/module/qeth_l2/sections/.text
      [root@s35lp76 ~]# cat /sys/module/qeth_l2/sections/.text
      0x0000000018ea8363
      displays a random address.
      
      This breaks the perf tool which uses this address on s390
      to calculate start of .text section in memory.
      
      Fix this by printing the correct (unhashed) address.
      
      Thanks to Jessica Yu for helping on this.
      
      Fixes: ef0010a3 ("vsprintf: don't use 'restricted_pointer()' when not restricting")
      Cc: <stable@vger.kernel.org> # v4.15+
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Cc: Jessica Yu <jeyu@kernel.org>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      be71eda5
  14. 17 4月, 2018 2 次提交
  15. 16 3月, 2018 1 次提交
    • A
      mm: remove blackfin MPU support · 1a842913
      Arnd Bergmann 提交于
      The CONFIG_MPU option was only defined on blackfin, and that architecture
      is now being removed, so the respective code can be simplified.
      
      A lot of other microcontrollers have an MPU, but I suspect that if we
      want to bring that support back, we'd do it differently anyway.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      1a842913
  16. 09 3月, 2018 1 次提交
    • L
      module: propagate error in modules_open() · 3f553b30
      Leon Yu 提交于
      otherwise kernel can oops later in seq_release() due to dereferencing null
      file->private_data which is only set if seq_open() succeeds.
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
      IP: seq_release+0xc/0x30
      Call Trace:
       close_pdeo+0x37/0xd0
       proc_reg_release+0x5d/0x60
       __fput+0x9d/0x1d0
       ____fput+0x9/0x10
       task_work_run+0x75/0x90
       do_exit+0x252/0xa00
       do_group_exit+0x36/0xb0
       SyS_exit_group+0xf/0x10
      
      Fixes: 516fb7f2 ("/proc/module: use the same logic as /proc/kallsyms for address exposure")
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: stable@vger.kernel.org # 4.15+
      Signed-off-by: NLeon Yu <chianglungyu@gmail.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      3f553b30
  17. 26 1月, 2018 1 次提交
    • A
      module/retpoline: Warn about missing retpoline in module · caf7501a
      Andi Kleen 提交于
      There's a risk that a kernel which has full retpoline mitigations becomes
      vulnerable when a module gets loaded that hasn't been compiled with the
      right compiler or the right option.
      
      To enable detection of that mismatch at module load time, add a module info
      string "retpoline" at build time when the module was compiled with
      retpoline support. This only covers compiled C source, but assembler source
      or prebuilt object files are not checked.
      
      If a retpoline enabled kernel detects a non retpoline protected module at
      load time, print a warning and report it in the sysfs vulnerability file.
      
      [ tglx: Massaged changelog ]
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: gregkh@linuxfoundation.org
      Cc: torvalds@linux-foundation.org
      Cc: jeyu@kernel.org
      Cc: arjan@linux.intel.com
      Link: https://lkml.kernel.org/r/20180125235028.31211-1-andi@firstfloor.org
      caf7501a
  18. 16 1月, 2018 1 次提交
    • N
      ftrace/module: Move ftrace_release_mod() to ddebug_cleanup label · 1323eac7
      Namit Gupta 提交于
      ftrace_module_init happen after dynamic_debug_setup, it is desired that
      cleanup should be called after this label however in current implementation
      it is called in free module label,ie:even though ftrace in not initialized,
      from so many fail case ftrace_release_mod() will be called and unnecessary
      traverse the whole list.
      In below patch we moved ftrace_release_mod() from free_module label to
      ddebug_cleanup label. that is the best possible location, other solution
      is to make new label to ftrace_release_mod() but since ftrace_module_init()
      is not return with minimum changes it should be in ddebug_cleanup label.
      Signed-off-by: NNamit Gupta <gupta.namit@samsung.com>
      Reviewed-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      1323eac7
  19. 13 1月, 2018 1 次提交
    • M
      error-injection: Separate error-injection from kprobe · 540adea3
      Masami Hiramatsu 提交于
      Since error-injection framework is not limited to be used
      by kprobes, nor bpf. Other kernel subsystems can use it
      freely for checking safeness of error-injection, e.g.
      livepatch, ftrace etc.
      So this separate error-injection framework from kprobes.
      
      Some differences has been made:
      
      - "kprobe" word is removed from any APIs/structures.
      - BPF_ALLOW_ERROR_INJECTION() is renamed to
        ALLOW_ERROR_INJECTION() since it is not limited for BPF too.
      - CONFIG_FUNCTION_ERROR_INJECTION is the config item of this
        feature. It is automatically enabled if the arch supports
        error injection feature for kprobe or ftrace etc.
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Reviewed-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      540adea3
  20. 09 1月, 2018 1 次提交
    • S
      sections: split dereference_function_descriptor() · b865ea64
      Sergey Senozhatsky 提交于
      There are two format specifiers to print out a pointer in symbolic
      format: '%pS/%ps' and '%pF/%pf'. On most architectures, the two
      mean exactly the same thing, but some architectures (ia64, ppc64,
      parisc64) use an indirect pointer for C function pointers, where
      the function pointer points to a function descriptor (which in
      turn contains the actual pointer to the code). The '%pF/%pf, when
      used appropriately, automatically does the appropriate function
      descriptor dereference on such architectures.
      
      The "when used appropriately" part is tricky. Basically this is
      a subtle ABI detail, specific to some platforms, that made it to
      the API level and people can be unaware of it and miss the whole
      "we need to dereference the function" business out. [1] proves
      that point (note that it fixes only '%pF' and '%pS', there might
      be '%pf' and '%ps' cases as well).
      
      It appears that we can handle everything within the affected
      arches and make '%pS/%ps' smart enough to retire '%pF/%pf'.
      Function descriptors live in .opd elf section and all affected
      arches (ia64, ppc64, parisc64) handle it properly for kernel
      and modules. So we, technically, can decide if the dereference
      is needed by simply looking at the pointer: if it belongs to
      .opd section then we need to dereference it.
      
      The kernel and modules have their own .opd sections, obviously,
      that's why we need to split dereference_function_descriptor()
      and use separate kernel and module dereference arch callbacks.
      
      This patch does the first step, it
      a) adds dereference_kernel_function_descriptor() function.
      b) adds a weak alias to dereference_module_function_descriptor()
         function.
      
      So, for the time being, we will have:
      1) dereference_function_descriptor()
         A generic function, that simply dereferences the pointer. There is
         bunch of places that call it: kgdbts, init/main.c, extable, etc.
      
      2) dereference_kernel_function_descriptor()
         A function to call on kernel symbols that does kernel .opd section
         address range test.
      
      3) dereference_module_function_descriptor()
         A function to call on modules' symbols that does modules' .opd
         section address range test.
      
      [1] https://marc.info/?l=linux-kernel&m=150472969730573
      
      Link: http://lkml.kernel.org/r/20171109234830.5067-2-sergey.senozhatsky@gmail.com
      To: Fenghua Yu <fenghua.yu@intel.com>
      To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      To: Paul Mackerras <paulus@samba.org>
      To: Michael Ellerman <mpe@ellerman.id.au>
      To: James Bottomley <jejb@parisc-linux.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-ia64@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Tested-by: Tony Luck <tony.luck@intel.com> #ia64
      Tested-by: Santosh Sivaraj <santosh@fossix.org> #powerpc
      Tested-by: Helge Deller <deller@gmx.de> #parisc64
      Signed-off-by: NPetr Mladek <pmladek@suse.com>
      b865ea64
  21. 13 12月, 2017 1 次提交
  22. 30 11月, 2017 1 次提交
  23. 13 11月, 2017 2 次提交
  24. 09 11月, 2017 1 次提交
    • B
      module: export module signature enforcement status · fda784e5
      Bruno E. O. Meneguele 提交于
      A static variable sig_enforce is used as status var to indicate the real
      value of CONFIG_MODULE_SIG_FORCE, once this one is set the var will hold
      true, but if the CONFIG is not set the status var will hold whatever
      value is present in the module.sig_enforce kernel cmdline param: true
      when =1 and false when =0 or not present.
      
      Considering this cmdline param take place over the CONFIG value when
      it's not set, other places in the kernel could misbehave since they
      would have only the CONFIG_MODULE_SIG_FORCE value to rely on. Exporting
      this status var allows the kernel to rely in the effective value of
      module signature enforcement, being it from CONFIG value or cmdline
      param.
      Signed-off-by: NBruno E. O. Meneguele <brdeoliv@redhat.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      fda784e5
  25. 19 10月, 2017 1 次提交
  26. 06 10月, 2017 2 次提交
    • S
      ftrace: Save module init functions kallsyms symbols for tracing · aba4b5c2
      Steven Rostedt (VMware) 提交于
      If function tracing is active when the module init functions are freed, then
      store them to be referenced by kallsyms. As module init functions can now be
      traced on module load, they were useless:
      
       ># echo ':mod:snd_seq' > set_ftrace_filter
       ># echo function > current_tracer
       ># modprobe snd_seq
       ># cat trace
       # tracer: function
       #
       #                              _-----=> irqs-off
       #                             / _----=> need-resched
       #                            | / _---=> hardirq/softirq
       #                            || / _--=> preempt-depth
       #                            ||| /     delay
       #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
       #              | |       |   ||||       |         |
               modprobe-2786  [000] ....  3189.037874: 0xffffffffa0860000 <-do_one_initcall
               modprobe-2786  [000] ....  3189.037876: 0xffffffffa086004d <-0xffffffffa086000f
               modprobe-2786  [000] ....  3189.037876: 0xffffffffa086010d <-0xffffffffa0860018
               modprobe-2786  [000] ....  3189.037877: 0xffffffffa086011a <-0xffffffffa0860021
               modprobe-2786  [000] ....  3189.037877: 0xffffffffa0860080 <-0xffffffffa086002a
               modprobe-2786  [000] ....  3189.039523: 0xffffffffa0860400 <-0xffffffffa0860033
               modprobe-2786  [000] ....  3189.039523: 0xffffffffa086038a <-0xffffffffa086041c
               modprobe-2786  [000] ....  3189.039591: 0xffffffffa086038a <-0xffffffffa0860436
               modprobe-2786  [000] ....  3189.039657: 0xffffffffa086038a <-0xffffffffa0860450
               modprobe-2786  [000] ....  3189.039719: 0xffffffffa0860127 <-0xffffffffa086003c
               modprobe-2786  [000] ....  3189.039742: snd_seq_create_kernel_client <-0xffffffffa08601f6
      
      When the output is shown, the kallsyms for the module init functions have
      already been freed, and the output of the trace can not convert them to
      their function names.
      
      Now this looks like this:
      
       # tracer: function
       #
       #                              _-----=> irqs-off
       #                             / _----=> need-resched
       #                            | / _---=> hardirq/softirq
       #                            || / _--=> preempt-depth
       #                            ||| /     delay
       #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
       #              | |       |   ||||       |         |
               modprobe-2463  [002] ....   174.243237: alsa_seq_init <-do_one_initcall
               modprobe-2463  [002] ....   174.243239: client_init_data <-alsa_seq_init
               modprobe-2463  [002] ....   174.243240: snd_sequencer_memory_init <-alsa_seq_init
               modprobe-2463  [002] ....   174.243240: snd_seq_queues_init <-alsa_seq_init
               modprobe-2463  [002] ....   174.243240: snd_sequencer_device_init <-alsa_seq_init
               modprobe-2463  [002] ....   174.244860: snd_seq_info_init <-alsa_seq_init
               modprobe-2463  [002] ....   174.244861: create_info_entry <-snd_seq_info_init
               modprobe-2463  [002] ....   174.244936: create_info_entry <-snd_seq_info_init
               modprobe-2463  [002] ....   174.245003: create_info_entry <-snd_seq_info_init
               modprobe-2463  [002] ....   174.245072: snd_seq_system_client_init <-alsa_seq_init
               modprobe-2463  [002] ....   174.245094: snd_seq_create_kernel_client <-snd_seq_system_client_init
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      aba4b5c2
    • S
      ftrace: Allow module init functions to be traced · 3e234289
      Steven Rostedt (VMware) 提交于
      Allow for module init sections to be traced as well as core kernel init
      sections. Now that filtering modules functions can be stored, for when they
      are loaded, it makes sense to be able to trace them.
      
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      3e234289
  27. 25 7月, 2017 1 次提交
    • Z
      module: fix ddebug_remove_module() · 52796312
      Zhou Chengming 提交于
      ddebug_remove_module() use mod->name to find the ddebug_table of the
      module and remove it. But dynamic_debug_setup() use the first
      _ddebug->modname to create ddebug_table for the module. It's ok when
      the _ddebug->modname is the same with the mod->name.
      
      But livepatch module is special, it may contain _ddebugs of other
      modules, the modname of which is different from the name of livepatch
      module. So ddebug_remove_module() can't use mod->name to find the
      right ddebug_table and remove it. It can cause kernel crash when we cat
      the file <debugfs>/dynamic_debug/control.
      Signed-off-by: NZhou Chengming <zhouchengming1@huawei.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      52796312
  28. 11 7月, 2017 1 次提交
  29. 07 7月, 2017 1 次提交
  30. 29 6月, 2017 1 次提交
  31. 28 6月, 2017 1 次提交
  32. 26 6月, 2017 1 次提交
  33. 14 6月, 2017 2 次提交
  34. 26 5月, 2017 1 次提交
    • P
      kobject: support passing in variables for synthetic uevents · f36776fa
      Peter Rajnoha 提交于
      This patch makes it possible to pass additional arguments in addition
      to uevent action name when writing /sys/.../uevent attribute. These
      additional arguments are then inserted into generated synthetic uevent
      as additional environment variables.
      
      Before, we were not able to pass any additional uevent environment
      variables for synthetic uevents. This made it hard to identify such uevents
      properly in userspace to make proper distinction between genuine uevents
      originating from kernel and synthetic uevents triggered from userspace.
      Also, it was not possible to pass any additional information which would
      make it possible to optimize and change the way the synthetic uevents are
      processed back in userspace based on the originating environment of the
      triggering action in userspace. With the extra additional variables, we are
      able to pass through this extra information needed and also it makes it
      possible to synchronize with such synthetic uevents as they can be clearly
      identified back in userspace.
      
      The format for writing the uevent attribute is following:
      
          ACTION [UUID [KEY=VALUE ...]
      
      There's no change in how "ACTION" is recognized - it stays the same
      ("add", "change", "remove"). The "ACTION" is the only argument required
      to generate synthetic uevent, the rest of arguments, that this patch
      adds support for, are optional.
      
      The "UUID" is considered as transaction identifier so it's possible to
      use the same UUID value for one or more synthetic uevents in which case
      we logically group these uevents together for any userspace listeners.
      The "UUID" is expected to be in "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      format where "x" is a hex digit. The value appears in uevent as
      "SYNTH_UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" environment variable.
      
      The "KEY=VALUE" pairs can contain alphanumeric characters only. It's
      possible to define zero or more more pairs - each pair is then delimited
      by a space character " ". Each pair appears in synthetic uevents as
      "SYNTH_ARG_KEY=VALUE" environment variable. That means the KEY name gains
      "SYNTH_ARG_" prefix to avoid possible collisions with existing variables.
      To pass the "KEY=VALUE" pairs, it's also required to pass in the "UUID"
      part for the synthetic uevent first.
      
      If "UUID" is not passed in, the generated synthetic uevent gains
      "SYNTH_UUID=0" environment variable automatically so it's possible to
      identify this situation in userspace when reading generated uevent and so
      we can still make a difference between genuine and synthetic uevents.
      Signed-off-by: NPeter Rajnoha <prajnoha@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f36776fa