1. 01 2月, 2018 3 次提交
  2. 29 1月, 2018 1 次提交
  3. 28 1月, 2018 1 次提交
  4. 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
  5. 25 1月, 2018 3 次提交
    • M
      kbuild: fix W= option checks for extra DTC warnings · f759625a
      Masahiro Yamada 提交于
      Kbuild supports 3 levels of extra warnings, and multiple levels can
      be combined, like W=12, W=123.  It was added by commit a6de553d
      ("kbuild: Allow to combine multiple W= levels").
      
      From the log of commit 8654cb8d ("dtc: update warning settings
      for new bus and node/property name checks"), I assume:
      
       - unit_address_vs_reg, simple_bus_reg, etc. belong to level 1
       - node_name_chars_strict, property_name_chars_strict belong to level 2
      
      However, the level 1 warnings are displayed by any argument to W=.
      On the other hand, the level 2 warnings are displayed by W=2, but
      not by W=12, or W=123.
      
      Use $(findstring ...) like scripts/Makefile.extrawarn.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      f759625a
    • P
      kconfig: make "Selected by:" and "Implied by:" readable · 1ccb2714
      Petr Vorel 提交于
      Reverse dependency expressions can get rather unwieldy, especially if
      a symbol is selected by more than a handful of other symbols. I.e. it's
      possible to have near endless expressions like:
         A && B && !C || D || F && (G || H) || [...]
      
      Chop these expressions into actually readable chunks:
         - A && B && !C
         - D
         - F && (G || H)
         - [...]
      
      I.e. transform the top level OR tokens into newlines and prepend each
      line with a minus. This makes the "Selected by:" and "Implied by:" blurb
      much easier to read. This is done only if there is more than one top
      level OR. "Depends on:" and "Range :" were deliberately left as they are.
      
      Based on idea from Paul Bolle.
      Suggested-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NPetr Vorel <petr.vorel@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      1ccb2714
    • M
      kconfig: announce removal of oldnoconfig if used · 312ee687
      Masahiro Yamada 提交于
      The 'oldnoconfig' is really confusing due to its counter-intuitive name.
      It was renamed by commit fb16d891 ("kconfig: replace 'oldnoconfig'
      with 'olddefconfig', and keep the old name as an alias").
      
      The 'oldnoconfig' has been kept as an alias for enough period of time,
      and finally I am planning to remove it.  I will give people a little
      more time for migration.  Meanwhile, the following message will be
      displayed if oldnoconfig is used.
      
          WARNING: "oldnoconfig" target will be removed after Linux 4.19
                    Please use "olddefconfig" instead, which is an alias.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      312ee687
  6. 22 1月, 2018 3 次提交
  7. 21 1月, 2018 16 次提交
  8. 20 1月, 2018 2 次提交
  9. 18 1月, 2018 8 次提交
    • X
      Kbuild: suppress packed-not-aligned warning for default setting only · 321cb030
      Xiongfeng Wang 提交于
      gcc-8 reports many -Wpacked-not-aligned warnings. The below are some
      examples.
      
      ./include/linux/ceph/msgr.h:67:1: warning: alignment 1 of 'struct
      ceph_entity_addr' is less than 8 [-Wpacked-not-aligned]
       } __attribute__ ((packed));
      
      ./include/linux/ceph/msgr.h:67:1: warning: alignment 1 of 'struct
      ceph_entity_addr' is less than 8 [-Wpacked-not-aligned]
       } __attribute__ ((packed));
      
      ./include/linux/ceph/msgr.h:67:1: warning: alignment 1 of 'struct
      ceph_entity_addr' is less than 8 [-Wpacked-not-aligned]
       } __attribute__ ((packed));
      
      This patch suppresses this kind of warnings for default setting.
      Signed-off-by: NXiongfeng Wang <xiongfeng.wang@linaro.org>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      321cb030
    • M
      fixdep: use existing helper to check modular CONFIG options · ab9ce9fe
      Masahiro Yamada 提交于
      str_ends_with() tests if the given token ends with a particular string.
      Currently, it is used to check file paths without $(srctree).
      
      Actually, we have one more place where this helper is useful.  Use it
      to check if CONFIG option ends with _MODULE.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      ab9ce9fe
    • M
      fixdep: refactor parse_dep_file() · 87b95a81
      Masahiro Yamada 提交于
      parse_dep_file() has too much indentation, and puts the code far to
      the right.  This commit refactors the code and reduces the one level
      of indentation.
      
      strrcmp() computes 'slen' by itself, but the caller already knows the
      length of the token, so 'slen' can be passed via function argument.
      With this, we can swap the order of strrcmp() and "*p = \0;"
      
      Also, strrcmp() is an ambiguous function name.  Flip the logic and
      rename it to str_ends_with().
      
      I added a new helper is_ignored_file() - this returns 1 if the token
      represents a file that should be ignored.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      87b95a81
    • M
      fixdep: move global variables to local variables of main() · 5d1ef76f
      Masahiro Yamada 提交于
      I do not mind global variables where they are useful enough.  In this
      case, I do not see a good reason to use global variables since they
      are just referenced in shallow places.  It is easy to pass them via
      function arguments.
      
      I squashed print_cmdline() into main() since it is just one line code.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      5d1ef76f
    • M
      fixdep: remove unneeded memcpy() in parse_dep_file() · ccfe7887
      Masahiro Yamada 提交于
      Each token in the depfile is copied to the temporary buffer 's' to
      terminate the token with zero.  We do not need to do this any more
      because the parsed buffer is now writable.  Insert '\0' directly in
      the buffer without calling memcpy().
      
      <limits.h> is no longer necessary. (It was needed for PATH_MAX).
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      ccfe7887
    • M
      fixdep: factor out common code for reading files · 4003fd80
      Masahiro Yamada 提交于
      Now, do_config_files() and print_deps() are almost the same.  Only
      the difference is the parser function called (parse_config_file vs
      parse_dep_file).
      
      We can reduce the code duplication by factoring out the common code
      into read_file() - this function allocates a buffer and loads a file
      to it.  It returns the pointer to the allocated buffer.  (As before,
      it bails out by exit(2) for any error.)  The caller must free the
      buffer when done.
      
      Having empty source files is possible; fixdep should simply skip them.
      I deleted the "st.st_size == 0" check, so read_file() allocates 1-byte
      buffer for an empty file.  strstr() will immediately return NULL, and
      this is what we expect.
      
      On the other hand, an empty dep_file should be treated as an error.
      In this case, parse_dep_file() will error out with "no targets found"
      and it is a correct error message.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      4003fd80
    • M
      fixdep: use malloc() and read() to load dep_file to buffer · 01b5cbe7
      Masahiro Yamada 提交于
      Commit dee81e98 ("fixdep: faster CONFIG_ search") changed how to
      read files in which CONFIG options are searched.  It used malloc()
      and read() instead of mmap() because it needed to zero-terminate the
      buffer in order to use strstr().  print_deps() was left untouched
      since there was no reason to change it.
      
      Now, I have two motivations to change it in the same way.
      
       - do_config_file() and print_deps() do quite similar things; they
         open a file, load it onto memory, and pass it to a parser function.
         If we use malloc() and read() for print_deps() too, we can factor
         out the common code.  (I will do this in the next commit.)
      
       - parse_dep_file() copies each token to a temporary buffer because
         it needs to zero-terminate it to be passed to printf().  It is not
         possible to modify the buffer directly because it is mmap'ed with
         O_RDONLY.  If we load the file content into a malloc'ed buffer, we
         can insert '\0' after each token, and save memcpy().  (I will do
         this in the commit after next.)
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      01b5cbe7
    • M
      fixdep: remove unnecessary <arpa/inet.h> inclusion · 41f92cff
      Masahiro Yamada 提交于
      <arpa/inet.h> was included for ntohl(), but it was removed by
      commit dee81e98 ("fixdep: faster CONFIG_ search").
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      41f92cff
  10. 16 1月, 2018 2 次提交