1. 17 Mar, 2014 3 commits
    • Rusty Russell's avatar
      kallsyms: fix percpu vars on x86-64 with relocation. · c6bda7c9
      Rusty Russell authored
      x86-64 has a problem: per-cpu variables are actually represented by
      their absolute offsets within the per-cpu area, but the symbols are
      not emitted as absolute.  Thus kallsyms naively creates them as offsets
      from _text, meaning their values change if the kernel is relocated
      (especially noticeable with CONFIG_RANDOMIZE_BASE):
      
       $ egrep ' (gdt_|_(stext|_per_cpu_))' /root/kallsyms.nokaslr
       0000000000000000 D __per_cpu_start
       0000000000004000 D gdt_page
       0000000000014280 D __per_cpu_end
       ffffffff810001c8 T _stext
       ffffffff81ee53c0 D __per_cpu_offset
       $ egrep ' (gdt_|_(stext|_per_cpu_))' /root/kallsyms.kaslr1
       000000001f200000 D __per_cpu_start
       000000001f204000 D gdt_page
       000000001f214280 D __per_cpu_end
       ffffffffa02001c8 T _stext
       ffffffffa10e53c0 D __per_cpu_offset
      
      Making them absolute symbols is the Right Thing, but requires fixes to
      the relocs tool.  So for the moment, we add a --absolute-percpu option
      which makes them absolute from a kallsyms perspective:
      
       $ egrep ' (gdt_|_(stext|_per_cpu_))' /proc/kallsyms # no KASLR
       0000000000000000 A __per_cpu_start
       000000000000a000 A gdt_page
       0000000000013040 A __per_cpu_end
       ffffffff802001c8 T _stext
       ffffffff8099b180 D __per_cpu_offset
       ffffffff809a3000 D __per_cpu_load
       $ egrep ' (gdt_|_(stext|_per_cpu_))' /proc/kallsyms # With KASLR
       0000000000000000 A __per_cpu_start
       000000000000a000 A gdt_page
       0000000000013040 A __per_cpu_end
       ffffffff89c001c8 T _stext
       ffffffff8a39d180 D __per_cpu_offset
       ffffffff8a3a5000 D __per_cpu_load
      Based-on-the-original-screenplay-by: default avatarAndy Honig <ahonig@google.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      c6bda7c9
    • Kees Cook's avatar
      kallsyms: generalize address range checking · 78eb7159
      Kees Cook authored
      This refactors the address range checks to be generalized instead of
      specific to text range checks, in preparation for other range checks.
      Also extracts logic for "is the symbol absolute" into a function.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      78eb7159
    • Mark Charlebois's avatar
      module: LLVMLinux: Remove unused function warning from __param_check macro · 0283f9a5
      Mark Charlebois authored
      This code makes a compile time type check that is optimized away. Clang
      complains that it generates an unused function:
      
      linux/kernel/panic.c:471:1: warning: unused function '__check_panic'
            [-Wunused-function]
      core_param(panic, panic_timeout, int, 0644);
      ^
      linux/moduleparam.h:283:2: note: expanded from macro
            'core_param'
              param_check_##type(name, &(var));                               \
              ^
      <scratch space>:87:1: note: expanded from here
      param_check_int
      ^
      linux/moduleparam.h:369:34: note: expanded from macro
            'param_check_int'
      #define param_check_int(name, p) __param_check(name, p, int)
                                       ^
      linux/moduleparam.h:349:22: note: expanded from macro
            '__param_check'
              static inline type *__check_##name(void) { return(p); }
                                  ^
      <scratch space>:88:1: note: expanded from here
      __check_panic
      
      GCC won't complain for a static inline function but would if it was just
      a static function.
      
      Adding the unused attribute to the function declaration removes the warning.
      Per request from Rusty Russell it is marked as __always_unused as the code
      is meant to be optimized away.
      
      This code works for both GCC and clang.
      Signed-off-by: default avatarMark Charlebois <charlebm@gmail.com>
      Signed-off-by: default avatarBehan Webster <behanw@converseincode.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      0283f9a5
  2. 13 Mar, 2014 4 commits
    • Mathieu Desnoyers's avatar
      Fix: module signature vs tracepoints: add new TAINT_UNSIGNED_MODULE · 66cc69e3
      Mathieu Desnoyers authored
      Users have reported being unable to trace non-signed modules loaded
      within a kernel supporting module signature.
      
      This is caused by tracepoint.c:tracepoint_module_coming() refusing to
      take into account tracepoints sitting within force-loaded modules
      (TAINT_FORCED_MODULE). The reason for this check, in the first place, is
      that a force-loaded module may have a struct module incompatible with
      the layout expected by the kernel, and can thus cause a kernel crash
      upon forced load of that module on a kernel with CONFIG_TRACEPOINTS=y.
      
      Tracepoints, however, specifically accept TAINT_OOT_MODULE and
      TAINT_CRAP, since those modules do not lead to the "very likely system
      crash" issue cited above for force-loaded modules.
      
      With kernels having CONFIG_MODULE_SIG=y (signed modules), a non-signed
      module is tainted re-using the TAINT_FORCED_MODULE taint flag.
      Unfortunately, this means that Tracepoints treat that module as a
      force-loaded module, and thus silently refuse to consider any tracepoint
      within this module.
      
      Since an unsigned module does not fit within the "very likely system
      crash" category of tainting, add a new TAINT_UNSIGNED_MODULE taint flag
      to specifically address this taint behavior, and accept those modules
      within Tracepoints. We use the letter 'X' as a taint flag character for
      a module being loaded that doesn't know how to sign its name (proposed
      by Steven Rostedt).
      
      Also add the missing 'O' entry to trace event show_module_flags() list
      for the sake of completeness.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      NAKed-by: default avatarIngo Molnar <mingo@redhat.com>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: David Howells <dhowells@redhat.com>
      CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      66cc69e3
    • Rusty Russell's avatar
      module: remove MODULE_GENERIC_TABLE · cff26a51
      Rusty Russell authored
      MODULE_DEVICE_TABLE() calles MODULE_GENERIC_TABLE(); make it do the
      work directly.  This also removes a wart introduced in the last patch,
      where the alias is defined to be an unknown struct type "struct
      type##__##name##_device_id" instead of "struct type##_device_id" (it's
      an extern so GCC doesn't care, but it's wrong).
      
      The other user of MODULE_GENERIC_TABLE (ISAPNP_CARD_TABLE) is unused,
      so delete it.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      cff26a51
    • Tom Gundersen's avatar
      module: allow multiple calls to MODULE_DEVICE_TABLE() per module · 21bdd17b
      Tom Gundersen authored
      Commit 78551277: "Input: i8042 - add PNP modaliases" had a bug, where the
      second call to MODULE_DEVICE_TABLE() overrode the first resulting in not all
      the modaliases being exposed.
      
      This fixes the problem by including the name of the device_id table in the
      __mod_*_device_table alias, allowing us to export several device_id tables
      per module.
      Suggested-by: default avatarKay Sievers <kay@vrfy.org>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarTom Gundersen <teg@jklm.no>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      21bdd17b
    • Jiri Slaby's avatar
      module: use pr_cont · 27bba4d6
      Jiri Slaby authored
      When dumping loaded modules, we print them one by one in separate
      printks. Let's use pr_cont as they are continuation prints.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      27bba4d6
  3. 11 Mar, 2014 13 commits
  4. 10 Mar, 2014 13 commits
  5. 09 Mar, 2014 7 commits
    • Linus Torvalds's avatar
      Merge branch 'for-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · 1dc3217d
      Linus Torvalds authored
      Pull thermal fixes from Zhang Rui:
       "Specifics:
      
         - Update the help text of INT3403 Thermal driver, which was not
           friendly to users.  From Zhang Rui.
      
         - The "type" sysfs attribute of x86_pkg_temp_thermal registered
           thermal zones includes an instance number, which makes the
           thermal-to-hwmon bridge fails to group them all in a single hwmon
           device.  Fixed by Jean Delvare.
      
         - The hwmon device registered by x86_pkg_temp_thermal driver is
           redundant because the temperature value reported by
           x86_pkg_temp_thermal is already reported by the coretemp driver.
           Fixed by Jean Delvare.
      
         - Fix a problem that the cooling device can not be updated properly
           if it is initialized at max cooling state.  From Ni Wade.
      
         - Fix a problem that OF registered thermal zones are running without
           thermal governors.  From Zhang Rui.
      
         - Commit beeb5a1e ("thermal: rcar-thermal: Enable driver
           compilation with COMPILE_TEST") broke build on archs wihout io
           memory.  Thus make it depend on HAS_IOMEM to bypass build failures.
           Fixed by Richard Weinberger"
      
      * 'for-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
        Thermal: thermal zone governor fix
        Thermal: Allow first update of cooling device state
        thermal,rcar_thermal: Add dependency on HAS_IOMEM
        x86_pkg_temp_thermal: Fix the thermal zone type
        x86_pkg_temp_thermal: Do not expose as a hwmon device
        Thermal: update INT3404 thermal driver help text
      1dc3217d
    • Linus Torvalds's avatar
      Merge tag 'spi-v3.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 4aa41ba7
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A scattering of driver specific fixes here.
      
        The fixes from Axel cover bitrot in apparently unmaintained drivers,
        the at79 bug is fixing a glitch on /CS during initialisation of some
        devices which could break some slaves and the remainder are fixes for
        recently introduced bugs from the past release cycle or so"
      
      * tag 'spi-v3.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: atmel: add missing spi_master_{resume,suspend} calls to PM callbacks
        spi: coldfire-qspi: Fix getting correct address for *mcfqspi
        spi: fsl-dspi: Fix getting correct address for master
        spi: spi-ath79: fix initial GPIO CS line setup
        spi: spi-imx: spi_imx_remove: do not disable disabled clocks
        spi-topcliff-pch: Fix probing when DMA mode is used
        spi/topcliff-pch: Fix DMA channel
      4aa41ba7
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 66a523db
      Linus Torvalds authored
      Pull SCSI target fixes from Nicholas Bellinger:
       "This series addresses a number of outstanding issues wrt to active I/O
        shutdown using iser-target.  This includes:
      
         - Fix a long standing tpg_state bug where a tpg could be referenced
           during explicit shutdown (v3.1+ stable)
         - Use list_del_init for iscsi_cmd->i_conn_node so list_empty checks
           work as expected (v3.10+ stable)
         - Fix a isert_conn->state related hung task bug + ensure outstanding
           I/O completes during session shutdown.  (v3.10+ stable)
         - Fix isert_conn->post_send_buf_count accounting for RDMA READ/WRITEs
           (v3.10+ stable)
         - Ignore FRWR completions during active I/O shutdown (v3.12+ stable)
         - Fix command leakage for interrupt coalescing during active I/O
           shutdown (v3.13+ stable)
      
        Also included is another DIF emulation fix from Sagi specific to
        v3.14-rc code"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        Target/sbc: Fix sbc_copy_prot for offset scatters
        iser-target: Fix command leak for tx_desc->comp_llnode_batch
        iser-target: Ignore completions for FRWRs in isert_cq_tx_work
        iser-target: Fix post_send_buf_count for RDMA READ/WRITE
        iscsi/iser-target: Fix isert_conn->state hung shutdown issues
        iscsi/iser-target: Use list_del_init for ->i_conn_node
        iscsi-target: Fix iscsit_get_tpg_from_np tpg_state bug
      66a523db
    • Rafael J. Wysocki's avatar
      Revert "ACPI / sleep: pm_power_off needs more sanity checks to be installed" · 4c7b7040
      Rafael J. Wysocki authored
      Revert commit 3130497f ("ACPI / sleep: pm_power_off needs more
      sanity checks to be installed") that breaks power ACPI power off on a
      lot of systems, because it checks wrong registers.
      
      Fixes: 3130497f ("ACPI / sleep: pm_power_off needs more sanity checks to be installed")
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4c7b7040
    • Olof Johansson's avatar
      Merge tag 'omap-for-v3.14/fixes-dt-rc4' of... · 10554647
      Olof Johansson authored
      Merge tag 'omap-for-v3.14/fixes-dt-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
      
      From Tony Lindgren:
      
      Two omap3430 vs 3630 device tree regression fixes for
      issues booting 3430 based boards.
      
      * tag 'omap-for-v3.14/fixes-dt-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
        ARM: dts: omap3-gta04: Add ti,omap36xx to compatible property to avoid problems with booting
        ARM: dts: omap3-igep: fix boot fail due wrong compatible match
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      10554647
    • Olof Johansson's avatar
      Merge tag 'bcm-for-3.14-pinctrl-reduced-rename' of git://github.com/broadcom/bcm11351 into fixes · 4058f762
      Olof Johansson authored
      Merge 'bcm pinctrl rename' From Christin Daudt:
      
      Rename pinctrl dt binding to restore consistency with other bcm mobile
      bindings.
      
      * tag 'bcm-for-3.14-pinctrl-reduced-rename' of git://github.com/broadcom/bcm11351:
        pinctrl: Rename Broadcom Capri pinctrl binding
        pinctrl: refer to updated dt binding string.
        Update dtsi with new pinctrl compatible string
        + Linux 3.14-rc4
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      4058f762
    • Olof Johansson's avatar
      Merge tag 'sunxi-fixes-for-3.14' of https://github.com/mripard/linux into fixes · 614cd4a4
      Olof Johansson authored
      Allwinner fixes from Maxime Ripard:
      
      Two fixes for device trees additions that got added in 3.14. One fixes the
      interrupt types of some IPs, the other fixes up a compatible that got
      introduced during 3.14
      
      * tag 'sunxi-fixes-for-3.14' of https://github.com/mripard/linux:
        ARM: sunxi: dt: Change the touchscreen compatibles
        ARM: sun7i: dt: Fix interrupt trigger types
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      614cd4a4