1. 28 1月, 2020 1 次提交
  2. 23 1月, 2020 1 次提交
  3. 20 1月, 2020 1 次提交
    • A
      ARM: 8950/1: ftrace/recordmcount: filter relocation types · 927d780e
      Alex Sverdlin 提交于
      Scenario 1, ARMv7
      =================
      
      If code in arch/arm/kernel/ftrace.c would operate on mcount() pointer
      the following may be generated:
      
      00000230 <prealloc_fixed_plts>:
       230:   b5f8            push    {r3, r4, r5, r6, r7, lr}
       232:   b500            push    {lr}
       234:   f7ff fffe       bl      0 <__gnu_mcount_nc>
                              234: R_ARM_THM_CALL     __gnu_mcount_nc
       238:   f240 0600       movw    r6, #0
                              238: R_ARM_THM_MOVW_ABS_NC      __gnu_mcount_nc
       23c:   f8d0 1180       ldr.w   r1, [r0, #384]  ; 0x180
      
      FTRACE currently is not able to deal with it:
      
      WARNING: CPU: 0 PID: 0 at .../kernel/trace/ftrace.c:1979 ftrace_bug+0x1ad/0x230()
      ...
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.116-... #1
      ...
      [<c0314e3d>] (unwind_backtrace) from [<c03115e9>] (show_stack+0x11/0x14)
      [<c03115e9>] (show_stack) from [<c051a7f1>] (dump_stack+0x81/0xa8)
      [<c051a7f1>] (dump_stack) from [<c0321c5d>] (warn_slowpath_common+0x69/0x90)
      [<c0321c5d>] (warn_slowpath_common) from [<c0321cf3>] (warn_slowpath_null+0x17/0x1c)
      [<c0321cf3>] (warn_slowpath_null) from [<c038ee9d>] (ftrace_bug+0x1ad/0x230)
      [<c038ee9d>] (ftrace_bug) from [<c038f1f9>] (ftrace_process_locs+0x27d/0x444)
      [<c038f1f9>] (ftrace_process_locs) from [<c08915bd>] (ftrace_init+0x91/0xe8)
      [<c08915bd>] (ftrace_init) from [<c0885a67>] (start_kernel+0x34b/0x358)
      [<c0885a67>] (start_kernel) from [<00308095>] (0x308095)
      ---[ end trace cb88537fdc8fa200 ]---
      ftrace failed to modify [<c031266c>] prealloc_fixed_plts+0x8/0x60
       actual: 44:f2:e1:36
      ftrace record flags: 0
       (0)   expected tramp: c03143e9
      
      Scenario 2, ARMv4T
      ==================
      
      ftrace: allocating 14435 entries in 43 pages
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 0 at kernel/trace/ftrace.c:2029 ftrace_bug+0x204/0x310
      CPU: 0 PID: 0 Comm: swapper Not tainted 4.19.5 #1
      Hardware name: Cirrus Logic EDB9302 Evaluation Board
      [<c0010a24>] (unwind_backtrace) from [<c000ecb0>] (show_stack+0x20/0x2c)
      [<c000ecb0>] (show_stack) from [<c03c72e8>] (dump_stack+0x20/0x30)
      [<c03c72e8>] (dump_stack) from [<c0021c18>] (__warn+0xdc/0x104)
      [<c0021c18>] (__warn) from [<c0021d7c>] (warn_slowpath_null+0x4c/0x5c)
      [<c0021d7c>] (warn_slowpath_null) from [<c0095360>] (ftrace_bug+0x204/0x310)
      [<c0095360>] (ftrace_bug) from [<c04dabac>] (ftrace_init+0x3b4/0x4d4)
      [<c04dabac>] (ftrace_init) from [<c04cef4c>] (start_kernel+0x20c/0x410)
      [<c04cef4c>] (start_kernel) from [<00000000>] (  (null))
      ---[ end trace 0506a2f5dae6b341 ]---
      ftrace failed to modify
      [<c000c350>] perf_trace_sys_exit+0x5c/0xe8
       actual:   1e:ff:2f:e1
      Initializing ftrace call sites
      ftrace record flags: 0
       (0)
       expected tramp: c000fb24
      
      The analysis for this problem has been already performed previously,
      refer to the link below.
      
      Fix the above problems by allowing only selected reloc types in
      __mcount_loc. The list itself comes from the legacy recordmcount.pl
      script.
      
      Link: https://lore.kernel.org/lkml/56961010.6000806@pengutronix.de/
      Cc: stable@vger.kernel.org
      Fixes: ed60453f ("ARM: 6511/1: ftrace: add ARM support for C version of recordmcount")
      Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com>
      Acked-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      927d780e
  4. 15 1月, 2020 1 次提交
  5. 14 1月, 2020 1 次提交
  6. 06 1月, 2020 1 次提交
  7. 03 1月, 2020 2 次提交
  8. 17 12月, 2019 3 次提交
  9. 14 12月, 2019 3 次提交
    • M
      scripts/kallsyms: fix offset overflow of kallsyms_relative_base · fd2ab2f6
      Masahiro Yamada 提交于
      Since commit 5e5c4fa7 ("scripts/kallsyms: shrink table before
      sorting it"), kallsyms_relative_base can be larger than _text, which
      causes overflow when building the 32-bit kernel.
      
      https://lkml.org/lkml/2019/12/7/156
      
      This is because _text is, unless --all-symbols is specified, now
      trimmed from the symbol table before record_relative_base() is called.
      
      Handle the offset signedness also for kallsyms_relative_base. Introduce
      a new helper, output_address(), to reduce the code duplication.
      
      Fixes: 5e5c4fa7 ("scripts/kallsyms: shrink table before sorting it")
      Reported-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      fd2ab2f6
    • M
      mkcompile_h: use printf for LINUX_COMPILE_BY · c8f3dea9
      Masahiro Yamada 提交于
      Commit 858805b3 ("kbuild: add $(BASH) to run scripts with
      bash-extension") shed light on portability issues. Here is another one.
      
      Since commit f0772604 ("Fix handling of backlash character in
      LINUX_COMPILE_BY name"), we must escape a backslash contained in
      LINUX_COMPILE_BY. This is not working on such distros as Ubuntu.
      
      As the POSIX spec [1] says, if any of the operands contain a backslash
      ( '\' ) character, the results are implementation-defined.
      
      The actual shell of /bin/sh could be bash, dash, etc. depending on
      distros, and the behavior of builtin echo command is different among
      them.
      
      The bash builtin echo, unless -e is given, copies the arguments to
      stdout without expanding escape sequences (BSD-like behavior).
      
      The dash builtin echo, in contrast, adopts System V behavior, which
      does expand escape sequences without any option given.
      
      Even non-builtin /bin/echo behaves differently depending on the system.
      Due to these variations, echo is considered as a non-portable command.
      Using printf is the common solution to avoid the portability issue.
      
      [1] https://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html
      
      Fixes: 858805b3 ("kbuild: add $(BASH) to run scripts with bash-extension")
      Reported-by: NXXing Wei <xxing.wei@unisoc.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      c8f3dea9
    • M
      mkcompile_h: git rid of UTS_TRUNCATE from LINUX_COMPILE_{BY,HOST} · e8193650
      Masahiro Yamada 提交于
      UTS_VERSION is set to struct uts_namespace, hence a too long string
      should be truncated so it fits in 64 characters.
      
      On the other hand, LINUX_COMPILE_BY/HOST are not set to uts_namespace.
      They are just used in the banners, which do not have specific length
      limitation.
      
      I dug into the git history, but I could not find the reason why
      these two strings must fit in 64 characters. Remove them.
      
      Now that UTS_VERSION is the only user of UTS_TRUNCATE, I squashed it.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      e8193650
  10. 13 12月, 2019 7 次提交
  11. 06 12月, 2019 1 次提交
  12. 05 12月, 2019 3 次提交
  13. 01 12月, 2019 1 次提交
  14. 29 11月, 2019 1 次提交
    • S
      bpf: Force .BTF section start to zero when dumping from vmlinux · df786c9b
      Stanislav Fomichev 提交于
      While trying to figure out why fentry_fexit selftest doesn't pass for me
      (old pahole, broken BTF), I found out that my latest patch can break vmlinux
      .BTF generation. objcopy preserves section start when doing --only-section,
      so there is a chance (depending on where pahole inserts .BTF section) to
      have leading empty zeroes. Let's explicitly force section offset to zero.
      
      Before:
      
      $ objcopy --set-section-flags .BTF=alloc -O binary \
      	--only-section=.BTF vmlinux .btf.vmlinux.bin
      $ xxd .btf.vmlinux.bin | head -n1
      00000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
      
      After:
      
      $ objcopy --change-section-address .BTF=0 \
      	--set-section-flags .BTF=alloc -O binary \
      	--only-section=.BTF vmlinux .btf.vmlinux.bin
      $ xxd .btf.vmlinux.bin | head -n1
      00000000: 9feb 0100 1800 0000 0000 0000 80e1 1c00  ................
                ^BTF magic
      
      As part of this change, I'm also dropping '2>/dev/null' from objcopy
      invocation to be able to catch possible other issues (objcopy doesn't
      produce any warnings for me anymore, it did before with --dump-section).
      
      Fixes: da5fb182 ("bpf: Support pre-2.25-binutils objcopy for vmlinux BTF")
      Signed-off-by: NStanislav Fomichev <sdf@google.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NJohn Fastabend <john.fastabend@gmail.com>
      Cc: Andrii Nakryiko <andriin@fb.com>
      Link: https://lore.kernel.org/bpf/20191127225759.39923-1-sdf@google.com
      df786c9b
  15. 28 11月, 2019 1 次提交
  16. 25 11月, 2019 12 次提交