]> Git Repo - linux.git/commitdiff
Merge tag 'modules-for-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu...
authorLinus Torvalds <[email protected]>
Fri, 15 Jun 2018 22:36:39 +0000 (07:36 +0900)
committerLinus Torvalds <[email protected]>
Fri, 15 Jun 2018 22:36:39 +0000 (07:36 +0900)
Pull module updates from Jessica Yu:
 "Minor code cleanup and also allow sig_enforce param to be shown in
  sysfs with CONFIG_MODULE_SIG_FORCE"

* tag 'modules-for-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
  module: Allow to always show the status of modsign
  module: Do not access sig_enforce directly

1  2 
kernel/module.c

diff --combined kernel/module.c
index 68469b37d61a0c87e6a78a53006334cdcef8b7d5,1e3337bcf1e708d43661febc49f98ccc1e535d78..f475f30eed8c031abc5e88241ee5088056dbb664
@@@ -274,9 -274,7 +274,7 @@@ static void module_assert_mutex_or_pree
  }
  
  static bool sig_enforce = IS_ENABLED(CONFIG_MODULE_SIG_FORCE);
- #ifndef CONFIG_MODULE_SIG_FORCE
  module_param(sig_enforce, bool_enable_only, 0644);
- #endif /* !CONFIG_MODULE_SIG_FORCE */
  
  /*
   * Export sig_enforce kernel cmdline parameter to allow other subsystems rely
@@@ -1472,8 -1470,7 +1470,8 @@@ static ssize_t module_sect_show(struct 
  {
        struct module_sect_attr *sattr =
                container_of(mattr, struct module_sect_attr, mattr);
 -      return sprintf(buf, "0x%pK\n", (void *)sattr->address);
 +      return sprintf(buf, "0x%px\n", kptr_restrict < 2 ?
 +                     (void *)sattr->address : NULL);
  }
  
  static void free_sect_attrs(struct module_sect_attrs *sect_attrs)
@@@ -1604,7 -1601,8 +1602,7 @@@ static void add_notes_attrs(struct modu
        if (notes == 0)
                return;
  
 -      notes_attrs = kzalloc(sizeof(*notes_attrs)
 -                            + notes * sizeof(notes_attrs->attrs[0]),
 +      notes_attrs = kzalloc(struct_size(notes_attrs, attrs, notes),
                              GFP_KERNEL);
        if (notes_attrs == NULL)
                return;
@@@ -2785,7 -2783,7 +2783,7 @@@ static int module_sig_check(struct load
        }
  
        /* Not having a signature is only an error if we're strict. */
-       if (err == -ENOKEY && !sig_enforce)
+       if (err == -ENOKEY && !is_module_sig_enforced())
                err = 0;
  
        return err;
@@@ -3516,11 -3514,6 +3514,11 @@@ static noinline int do_init_module(stru
         * walking this with preempt disabled.  In all the failure paths, we
         * call synchronize_sched(), but we don't want to slow down the success
         * path, so use actual RCU here.
 +       * Note that module_alloc() on most architectures creates W+X page
 +       * mappings which won't be cleaned up until do_free_init() runs.  Any
 +       * code such as mark_rodata_ro() which depends on those mappings to
 +       * be cleaned up needs to sync with the queued work - ie
 +       * rcu_barrier_sched()
         */
        call_rcu_sched(&freeinit->rcu, do_free_init);
        mutex_unlock(&module_mutex);
This page took 0.071669 seconds and 4 git commands to generate.