1. 22 6月, 2018 1 次提交
  2. 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
  3. 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
  4. 12 5月, 2018 1 次提交
  5. 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
  6. 17 4月, 2018 2 次提交
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 13 12月, 2017 1 次提交
  14. 30 11月, 2017 1 次提交
  15. 13 11月, 2017 2 次提交
  16. 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
  17. 19 10月, 2017 1 次提交
  18. 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
  19. 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
  20. 11 7月, 2017 1 次提交
  21. 07 7月, 2017 1 次提交
  22. 29 6月, 2017 1 次提交
  23. 28 6月, 2017 1 次提交
  24. 26 6月, 2017 1 次提交
  25. 14 6月, 2017 2 次提交
  26. 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
  27. 24 5月, 2017 2 次提交
  28. 09 5月, 2017 2 次提交
  29. 02 5月, 2017 1 次提交
  30. 25 4月, 2017 1 次提交
  31. 26 3月, 2017 1 次提交
  32. 16 3月, 2017 1 次提交
    • T
      locking/lockdep: Handle statically initialized PER_CPU locks properly · 383776fa
      Thomas Gleixner 提交于
      If a PER_CPU struct which contains a spin_lock is statically initialized
      via:
      
      DEFINE_PER_CPU(struct foo, bla) = {
      	.lock = __SPIN_LOCK_UNLOCKED(bla.lock)
      };
      
      then lockdep assigns a seperate key to each lock because the logic for
      assigning a key to statically initialized locks is to use the address as
      the key. With per CPU locks the address is obvioulsy different on each CPU.
      
      That's wrong, because all locks should have the same key.
      
      To solve this the following modifications are required:
      
       1) Extend the is_kernel/module_percpu_addr() functions to hand back the
          canonical address of the per CPU address, i.e. the per CPU address
          minus the per CPU offset.
      
       2) Check the lock address with these functions and if the per CPU check
          matches use the returned canonical address as the lock key, so all per
          CPU locks have the same key.
      
       3) Move the static_obj(key) check into look_up_lock_class() so this check
          can be avoided for statically initialized per CPU locks.  That's
          required because the canonical address fails the static_obj(key) check
          for obvious reasons.
      Reported-by: NMike Galbraith <efault@gmx.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      [ Merged Dan's fixups for !MODULES and !SMP into this patch. ]
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dan Murphy <dmurphy@ti.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20170227143736.pectaimkjkan5kow@linutronix.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      383776fa
  33. 22 2月, 2017 1 次提交
    • L
      module: fix memory leak on early load_module() failures · a5544880
      Luis R. Rodriguez 提交于
      While looking for early possible module loading failures I was
      able to reproduce a memory leak possible with kmemleak. There
      are a few rare ways to trigger a failure:
      
        o we've run into a failure while processing kernel parameters
          (parse_args() returns an error)
        o mod_sysfs_setup() fails
        o we're a live patch module and copy_module_elf() fails
      
      Chances of running into this issue is really low.
      
      kmemleak splat:
      
      unreferenced object 0xffff9f2c4ada1b00 (size 32):
        comm "kworker/u16:4", pid 82, jiffies 4294897636 (age 681.816s)
        hex dump (first 32 bytes):
          6d 65 6d 73 74 69 63 6b 30 00 00 00 00 00 00 00  memstick0.......
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<ffffffff8c6cfeba>] kmemleak_alloc+0x4a/0xa0
          [<ffffffff8c200046>] __kmalloc_track_caller+0x126/0x230
          [<ffffffff8c1bc581>] kstrdup+0x31/0x60
          [<ffffffff8c1bc5d4>] kstrdup_const+0x24/0x30
          [<ffffffff8c3c23aa>] kvasprintf_const+0x7a/0x90
          [<ffffffff8c3b5481>] kobject_set_name_vargs+0x21/0x90
          [<ffffffff8c4fbdd7>] dev_set_name+0x47/0x50
          [<ffffffffc07819e5>] memstick_check+0x95/0x33c [memstick]
          [<ffffffff8c09c893>] process_one_work+0x1f3/0x4b0
          [<ffffffff8c09cb98>] worker_thread+0x48/0x4e0
          [<ffffffff8c0a2b79>] kthread+0xc9/0xe0
          [<ffffffff8c6dab5f>] ret_from_fork+0x1f/0x40
          [<ffffffffffffffff>] 0xffffffffffffffff
      
      Cc: stable <stable@vger.kernel.org> # v2.6.30
      Fixes: e180a6b7 ("param: fix charp parameters set via sysfs")
      Reviewed-by: NMiroslav Benes <mbenes@suse.cz>
      Reviewed-by: NAaron Tomlin <atomlin@redhat.com>
      Reviewed-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NJessica Yu <jeyu@redhat.com>
      a5544880
  34. 14 2月, 2017 1 次提交