1. 21 Jun, 2018 7 commits
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · acdf3f93
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Some fallout in the pin control subsystem in the first week after the
        merge window, some minor fixes so I'd like to get it to you ASAP.
      
         - fix a serious kernel panic on the Mediatek driver with the external
           interrupt controller.
      
         - fix an uninitialized compiler warning in the owl (actions) driver.
      
         - allocation failure in the pinctrl-single driver.
      
         - pointer overwrite problem in the i.MX driver.
      
         - fix a small compiler warning"
      
      * tag 'pinctrl-v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: mt7622: fix a kernel panic when pio don't work as EINT controller
        pinctrl: actions: Fix uninitialized error in owl_pin_config_set()
        pinctrl: single: Add allocation failure checking of saved_vals
        pinctrl: devicetree: Fix pctldev pointer overwrite
        pinctrl: mediatek: remove redundant return value check of platform_get_resource()
      acdf3f93
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus-v4.18-rc2' of... · 303f311e
      Linus Torvalds authored
      Merge tag 'hwmon-for-linus-v4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - fix a loop limit in nct6775 driver
      
       - disable fan support for Dell XPS13 9333
      
      * tag 'hwmon-for-linus-v4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (nct6775) Fix loop limit
        hwmon: (dell-smm) Disable fan support for Dell XPS13 9333
      303f311e
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · f43fc5a0
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix a suspend/resume regression in the ACPI driver for Intel
        SoCs (LPSS), add a new system wakeup quirk to the ACPI EC driver and
        fix an inline stub of a function in the ACPI processor driver that
        diverged from the original.
      
        Specifics:
      
         - Fix a suspend/resume regression in the ACPI driver for Intel SoCs
           (LPSS) to make it work on systems where some power management
           quirks should only be applied for runtime PM and suspend-to-idle
           and not for suspend-to-RAM (Rafael Wysocki).
      
         - Add a system wakeup quirk for Thinkpad X1 Carbon 6th to the ACPI EC
           driver to avoid drainig battery too fast while suspended to idle on
           those systems (Mika Westerberg).
      
         - Fix an inline stub of acpi_processor_ppc_has_changed() to match the
           original function definition (Brian Norris)"
      
      * tag 'acpi-4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI / processor: Finish making acpi_processor_ppc_has_changed() void
        ACPI / EC: Use ec_no_wakeup on Thinkpad X1 Carbon 6th
        ACPI / LPSS: Avoid PM quirks on suspend and resume from S3
      f43fc5a0
    • Linus Torvalds's avatar
      Merge tag 'pm-4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 26c92a38
      Linus Torvalds authored
      Pull power management updates from Rafael Wysocki:
       "These are mostly fixes, including some fixes for changes made during
        the recent merge window and some "stable" material, plus some minor
        extensions of the turbostat utility.
      
        Specifics:
      
         - Fix the PM core to avoid introducing a runtime PM usage counter
           imbalance when adding device links during driver probe (Rafael
           Wysocki).
      
         - Fix the operating performance points (OPP) framework to ensure that
           the regulator voltage is always updated as appropriate when
           updating clock rates (Waldemar Rymarkiewicz).
      
         - Fix the intel_pstate driver to use correct max/min limits for cores
           with differing maximum frequences (Srinivas Pandruvada).
      
         - Fix a typo in the intel_pstate driver documentation (Rafael
           Wysocki).
      
         - Fix two issues with the recently added Kryo cpufreq driver (Ilia
           Lin).
      
         - Fix two recent regressions and some other minor issues in the
           turbostat utility and extend it to provide some more diagnostic
           information (Len Brown, Nathan Ciobanu)"
      
      * tag 'pm-4.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Documentation: intel_pstate: Fix typo
        tools/power turbostat: version 18.06.20
        tools/power turbostat: add the missing command line switches
        tools/power turbostat: add single character tokens to help
        tools/power turbostat: alphabetize the help output
        tools/power turbostat: fix segfault on 'no node' machines
        tools/power turbostat: add optional APIC X2APIC columns
        tools/power turbostat: decode cpuid.1.HT
        tools/power turbostat: fix show/hide issues resulting from mis-merge
        PM / OPP: Update voltage in case freq == old_freq
        cpufreq: intel_pstate: Fix scaling max/min limits with Turbo 3.0
        cpufreq: kryo: Add module remove and exit
        cpufreq: kryo: Fix possible error code dereference
        PM / core: Fix supplier device runtime PM usage counter imbalance
      26c92a38
    • Rafael J. Wysocki's avatar
      Merge branches 'acpi-soc' and 'acpi-processor' · e50f182c
      Rafael J. Wysocki authored
      These are a stable-candidate suspend/resume fix of the ACPI driver for
      Intel SoCs (LPSS) and an inline stub fix for the ACPI processor driver.
      
      * acpi-soc:
        ACPI / LPSS: Avoid PM quirks on suspend and resume from S3
      
      * acpi-processor:
        ACPI / processor: Finish making acpi_processor_ppc_has_changed() void
      e50f182c
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-tools' · b51e0013
      Rafael J. Wysocki authored
      These are turbostat utility updates for 4.18-rc2 including two fixes
      for recent regressions and some minor extensions.
      
      * pm-tools:
        tools/power turbostat: version 18.06.20
        tools/power turbostat: add the missing command line switches
        tools/power turbostat: add single character tokens to help
        tools/power turbostat: alphabetize the help output
        tools/power turbostat: fix segfault on 'no node' machines
        tools/power turbostat: add optional APIC X2APIC columns
        tools/power turbostat: decode cpuid.1.HT
        tools/power turbostat: fix show/hide issues resulting from mis-merge
      b51e0013
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-core' and 'pm-opp' · 7553a72b
      Rafael J. Wysocki authored
      These are a PM core fix and an OPP framework fix for 4.18-rc2,
      both "stable" material.
      
      * pm-core:
        PM / core: Fix supplier device runtime PM usage counter imbalance
      
      * pm-opp:
        PM / OPP: Update voltage in case freq == old_freq
      7553a72b
  2. 20 Jun, 2018 28 commits
    • Rafael J. Wysocki's avatar
      Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux · 3af20c95
      Rafael J. Wysocki authored
      Pull turbostat utility changes for 4.18-rc2 from Len Brown.
      
      "This includes two regression fixes, plus a couple more random, but
       worthy, patches."
      
      * 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
        tools/power turbostat: version 18.06.20
        tools/power turbostat: add the missing command line switches
        tools/power turbostat: add single character tokens to help
        tools/power turbostat: alphabetize the help output
        tools/power turbostat: fix segfault on 'no node' machines
        tools/power turbostat: add optional APIC X2APIC columns
        tools/power turbostat: decode cpuid.1.HT
        tools/power turbostat: fix show/hide issues resulting from mis-merge
      3af20c95
    • Rafael J. Wysocki's avatar
      Documentation: intel_pstate: Fix typo · 7a0f9d1e
      Rafael J. Wysocki authored
      Fix a typo in the intel_pstate admin-guide documentation.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7a0f9d1e
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 1abd8a8f
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "Here are eight fairly small fixes collected over the last two weeks.
      
        Regression and crashing bug fixes:
      
         - mlx4/5: Fixes for issues found from various checkers
      
         - A resource tracking and uverbs regression in the core code
      
         - qedr: NULL pointer regression found during testing
      
         - rxe: Various small bugs"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        IB/rxe: Fix missing completion for mem_reg work requests
        RDMA/core: Save kernel caller name when creating CQ using ib_create_cq()
        IB/uverbs: Fix ordering of ucontext check in ib_uverbs_write
        IB/mlx4: Fix an error handling path in 'mlx4_ib_rereg_user_mr()'
        RDMA/qedr: Fix NULL pointer dereference when running over iWARP without RDMA-CM
        IB/mlx5: Fix return value check in flow_counters_set_data()
        IB/mlx5: Fix memory leak in mlx5_ib_create_flow
        IB/rxe: avoid double kfree skb
      1abd8a8f
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · d8894a08
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix crash on bpf_prog_load() errors, from Daniel Borkmann.
      
       2) Fix ATM VCC memory accounting, from David Woodhouse.
      
       3) fib6_info objects need RCU freeing, from Eric Dumazet.
      
       4) Fix SO_BINDTODEVICE handling for TCP sockets, from David Ahern.
      
       5) Fix clobbered error code in enic_open() failure path, from
          Govindarajulu Varadarajan.
      
       6) Propagate dev_get_valid_name() error returns properly, from Li
          RongQing.
      
       7) Fix suspend/resume in davinci_emac driver, from Bartosz Golaszewski.
      
       8) Various act_ife fixes (recursive locking, IDR leaks, etc.) from
          Davide Caratti.
      
       9) Fix buggy checksum handling in sungem driver, from Eric Dumazet.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (40 commits)
        ip: limit use of gso_size to udp
        stmmac: fix DMA channel hang in half-duplex mode
        net: stmmac: socfpga: add additional ocp reset line for Stratix10
        net: sungem: fix rx checksum support
        bpfilter: ignore binary files
        bpfilter: fix build error
        net/usb/drivers: Remove useless hrtimer_active check
        net/sched: act_ife: preserve the action control in case of error
        net/sched: act_ife: fix recursive lock and idr leak
        net: ethernet: fix suspend/resume in davinci_emac
        net: propagate dev_get_valid_name return code
        enic: do not overwrite error code
        net/tcp: Fix socket lookups with SO_BINDTODEVICE
        ptp: replace getnstimeofday64() with ktime_get_real_ts64()
        net/ipv6: respect rcu grace period before freeing fib6_info
        net: net_failover: fix typo in net_failover_slave_register()
        ipvlan: use ETH_MAX_MTU as max mtu
        net: hamradio: use eth_broadcast_addr
        enic: initialize enic->rfs_h.lock in enic_probe
        MAINTAINERS: Add Sam as the maintainer for NCSI
        ...
      d8894a08
    • Len Brown's avatar
      tools/power turbostat: version 18.06.20 · 73780cd8
      Len Brown authored
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      73780cd8
    • Nathan Ciobanu's avatar
      tools/power turbostat: add the missing command line switches · 9ce80578
      Nathan Ciobanu authored
      Document the missing command line tokens in the help() function.
      Signed-off-by: default avatarNathan Ciobanu <nathan.d.ciobanu@linux.intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      9ce80578
    • Nathan Ciobanu's avatar
      tools/power turbostat: add single character tokens to help · cc481650
      Nathan Ciobanu authored
      Improve the help() output by adding the single character
      tokens (e.g -a).
      Signed-off-by: default avatarNathan Ciobanu <nathan.d.ciobanu@linux.intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      cc481650
    • Nathan Ciobanu's avatar
      tools/power turbostat: alphabetize the help output · 2ee19bde
      Nathan Ciobanu authored
      Sort the command line arguments output of help() in
      alphabetical order in line with other linux tools.
      Signed-off-by: default avatarNathan Ciobanu <nathan.d.ciobanu@linux.intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      2ee19bde
    • Nathan Ciobanu's avatar
      tools/power turbostat: fix segfault on 'no node' machines · 42dd4520
      Nathan Ciobanu authored
      Running turbostat on machines that don't expose nodes
      in sysfs (no /sys/bus/node) causes a segfault or a -nan
      value diesplayed in the log. This is caused by
      physical_node_id being reported as -1 and logical_node_id
      being calculated as a negative number resulting in the new
      GET_THREAD/GET_CORE returning an incorrect address.
      Signed-off-by: default avatarNathan Ciobanu <nathan.d.ciobanu@linux.intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      42dd4520
    • Len Brown's avatar
      tools/power turbostat: add optional APIC X2APIC columns · 4c2122d4
      Len Brown authored
      Add APIC and X2APIC columns to the topology section.
      
      They are disabled-by-default -- enable like so:
      --debug
      or
      --enable APIC,X2APIC
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      4c2122d4
    • Len Brown's avatar
      tools/power turbostat: decode cpuid.1.HT · d9d226ff
      Len Brown authored
      eg. the "HT" here:
      CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      d9d226ff
    • Len Brown's avatar
      tools/power turbostat: fix show/hide issues resulting from mis-merge · bdd5ae3a
      Len Brown authored
      The --show and --hide options failed on "Node", which was listed as "Node%".
      The --show and --hide options were generally fouled-up do due to come
      content merges that scrambled the list of column name indexes.
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      bdd5ae3a
    • Brian Norris's avatar
      ACPI / processor: Finish making acpi_processor_ppc_has_changed() void · a507a306
      Brian Norris authored
      Commit bca5f557 "ACPI / processor: Make acpi_processor_ppc_has_changed()
      void" changed one of the declarations of acpi_processor_ppc_has_changed()
      to return void, but the !CPU_FREQ version still returns int. Let's return
      void to be consistent.
      
      Fixes: bca5f557 "ACPI / processor: Make acpi_processor_ppc_has_changed() void"
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a507a306
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · 81e97f01
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - Wacom 2nd-gen Intuos Pro large Y axis handling fix from Jason Gerecke
      
       - fix for hibernation in Intel ISH driver, from Even Xu
      
       - crash fix for hid-steam driver, from Rodrigo Rivas Costa
      
       - new device ID addition to google-hammer driver
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        HID: wacom: Correct logical maximum Y for 2nd-gen Intuos Pro large
        HID: intel_ish-hid: ipc: register more pm callbacks to support hibernation
        HID: steam: use hid_device.driver_data instead of hid_set_drvdata()
        HID: google: Add support for whiskers
      81e97f01
    • Linus Torvalds's avatar
      Merge tag 'dma-rename-4.18' of git://git.infradead.org/users/hch/dma-mapping · 6d90eb7b
      Linus Torvalds authored
      Pull dma-mapping rename from Christoph Hellwig:
       "Move all the dma-mapping code to kernel/dma and lose their dma-*
        prefixes"
      
      * tag 'dma-rename-4.18' of git://git.infradead.org/users/hch/dma-mapping:
        dma-mapping: move all DMA mapping code to kernel/dma
        dma-mapping: use obj-y instead of lib-y for generic dma ops
      6d90eb7b
    • Jason Gerecke's avatar
      HID: wacom: Correct logical maximum Y for 2nd-gen Intuos Pro large · d471b6b2
      Jason Gerecke authored
      The HID descriptor for the 2nd-gen Intuos Pro large (PTH-860) contains
      a typo which defines an incorrect logical maximum Y value. This causes
      a small portion of the bottom of the tablet to become unusable (both
      because the area is below the "bottom" of the tablet and because
      'wacom_wac_event' ignores out-of-range values). It also results in a
      skewed aspect ratio.
      
      To fix this, we add a quirk to 'wacom_usage_mapping' which overwrites
      the data with the correct value.
      Signed-off-by: default avatarJason Gerecke <jason.gerecke@wacom.com>
      CC: stable@vger.kernel.org # v4.10+
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      d471b6b2
    • Even Xu's avatar
      HID: intel_ish-hid: ipc: register more pm callbacks to support hibernation · ebeaa367
      Even Xu authored
      Current ISH driver only registers suspend/resume PM callbacks which don't
      support hibernation (suspend to disk). Basically after hiberation, the ISH
      can't resume properly and user may not see sensor events (for example: screen
      		rotation may not work).
      
      User will not see a crash or panic or anything except the following message
      in log:
      
      	hid-sensor-hub 001F:8086:22D8.0001: timeout waiting for response from ISHTP device
      
      So this patch adds support for S4/hiberbation to ISH by using the
      SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly. The suspend
      and resume functions will now be used for both suspend to RAM and hibernation.
      
      If power management is disabled, SIMPLE_DEV_PM_OPS will do nothing, the suspend
      and resume related functions won't be used, so mark them as __maybe_unused to
      clarify that this is the intended behavior, and remove #ifdefs for power
      management.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarEven Xu <even.xu@intel.com>
      Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      ebeaa367
    • Rodrigo Rivas Costa's avatar
      HID: steam: use hid_device.driver_data instead of hid_set_drvdata() · 4bff980f
      Rodrigo Rivas Costa authored
      When creating the low-level hidraw device, the reference to steam_device
      was stored using hid_set_drvdata(). But this value is not guaranteed to
      be kept when set before calling probe. If this pointer is reset, it
      crashes when opening the emulated hidraw device.
      
      It looks like hid_set_drvdata() is for users "avobe" this hid_device,
      while hid_device.driver_data it for users "below" this one.
      
      In this case, we are creating a virtual hidraw device, so we must use
      hid_device.driver_data.
      Signed-off-by: default avatarRodrigo Rivas Costa <rodrigorivascosta@gmail.com>
      Tested-by: default avatarMariusz Ceier <mceier+kernel@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4bff980f
    • Linus Torvalds's avatar
      proc: fix missing final NUL in get_mm_cmdline() rewrite · f5b65348
      Linus Torvalds authored
      The rewrite of the cmdline fetching missed the fact that we used to also
      return the final terminating NUL character of the last argument.  I
      hadn't noticed, and none of the tools I tested cared, but something
      obviously must care, because Michal Kubecek noticed the change in
      behavior.
      
      Tweak the "find the end" logic to actually include the NUL character,
      and once past the eend of argv, always start the strnlen() at the
      expected (original) argument end.
      
      This whole "allow people to rewrite their arguments in place" is a nasty
      hack and requires that odd slop handling at the end of the argv array,
      but it's our traditional model, so we continue to support it.
      Repored-and-bisected-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-and-tested-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f5b65348
    • Willem de Bruijn's avatar
      ip: limit use of gso_size to udp · 9887cba1
      Willem de Bruijn authored
      The ipcm(6)_cookie field gso_size is set only in the udp path. The ip
      layer copies this to cork only if sk_type is SOCK_DGRAM. This check
      proved too permissive. Ping and l2tp sockets have the same type.
      
      Limit to sockets of type SOCK_DGRAM and protocol IPPROTO_UDP to
      exclude ping sockets.
      
      v1 -> v2
      - remove irrelevant whitespace changes
      
      Fixes: bec1f6f6 ("udp: generate gso with UDP_SEGMENT")
      Reported-by: default avatarMaciej Żenczykowski <maze@google.com>
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9887cba1
    • Bhadram Varka's avatar
      stmmac: fix DMA channel hang in half-duplex mode · b6cfffa7
      Bhadram Varka authored
      HW does not support Half-duplex mode in multi-queue
      scenario. Fix it by not advertising the Half-Duplex
      mode if multi-queue enabled.
      Signed-off-by: default avatarBhadram Varka <vbhadram@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6cfffa7
    • Dinh Nguyen's avatar
      net: stmmac: socfpga: add additional ocp reset line for Stratix10 · bc8a2d9b
      Dinh Nguyen authored
      The Stratix10 platform has an additional reset line, OCP(Open Core Protocol),
      that also needs to get deasserted for the stmmac ethernet controller to work.
      Thus we need to update the Kconfig to include ARCH_STRATIX10 in order to build
      dwmac-socfpga.
      
      Also, remove the redundant check for the reset controller pointer. The
      reset driver already checks for the pointer and returns 0 if the pointer
      is NULL.
      Signed-off-by: default avatarDinh Nguyen <dinguyen@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc8a2d9b
    • Eric Dumazet's avatar
      net: sungem: fix rx checksum support · 12b03558
      Eric Dumazet authored
      After commit 88078d98 ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE
      are friends"), sungem owners reported the infamous "eth0: hw csum failure"
      message.
      
      CHECKSUM_COMPLETE has in fact never worked for this driver, but this
      was masked by the fact that upper stacks had to strip the FCS, and
      therefore skb->ip_summed was set back to CHECKSUM_NONE before
      my recent change.
      
      Driver configures a number of bytes to skip when the chip computes
      the checksum, and for some reason only half of the Ethernet header
      was skipped.
      
      Then a second problem is that we should strip the FCS by default,
      unless the driver is updated to eventually support NETIF_F_RXFCS in
      the future.
      
      Finally, a driver should check if NETIF_F_RXCSUM feature is enabled
      or not, so that the admin can turn off rx checksum if wanted.
      
      Many thanks to Andreas Schwab and Mathieu Malaterre for their
      help in debugging this issue.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Reported-by: default avatarMathieu Malaterre <malat@debian.org>
      Reported-by: default avatarAndreas Schwab <schwab@linux-m68k.org>
      Tested-by: default avatarAndreas Schwab <schwab@linux-m68k.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12b03558
    • Matteo Croce's avatar
      bpfilter: ignore binary files · 8b26a06a
      Matteo Croce authored
      net/bpfilter/bpfilter_umh is a binary file generated when bpfilter is
      enabled, add it to .gitignore to avoid committing it.
      
      Fixes: d2ba09c1 ("net: add skeleton of bpfilter kernel module")
      Signed-off-by: default avatarMatteo Croce <mcroce@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b26a06a
    • Matteo Croce's avatar
      bpfilter: fix build error · 421780fd
      Matteo Croce authored
      bpfilter Makefile assumes that the system locale is en_US, and the
      parsing of objdump output fails.
      Set LC_ALL=C and, while at it, rewrite the objdump parsing so it spawns
      only 2 processes instead of 7.
      
      Fixes: d2ba09c1 ("net: add skeleton of bpfilter kernel module")
      Signed-off-by: default avatarMatteo Croce <mcroce@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      421780fd
    • Daniel Lezcano's avatar
      net/usb/drivers: Remove useless hrtimer_active check · 2aee167c
      Daniel Lezcano authored
      The code does:
      
       if (hrtimer_active(&t))
          hrtimer_cancel(&t);
      
      However, hrtimer_cancel() checks if the timer is active, so the
      test above is pointless.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2aee167c
    • Davide Caratti's avatar
      net/sched: act_ife: preserve the action control in case of error · cbf56c29
      Davide Caratti authored
      in the following script
      
       # tc actions add action ife encode allow prio pass index 42
       # tc actions replace action ife encode allow tcindex drop index 42
      
      the action control should remain equal to 'pass', if the kernel failed
      to replace the TC action. Pospone the assignment of the action control,
      to ensure it is not overwritten in the error path of tcf_ife_init().
      
      Fixes: ef6980b6 ("introduce IFE action")
      Signed-off-by: default avatarDavide Caratti <dcaratti@redhat.com>
      Acked-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cbf56c29
    • Davide Caratti's avatar
      net/sched: act_ife: fix recursive lock and idr leak · 0a889b94
      Davide Caratti authored
      a recursive lock warning [1] can be observed with the following script,
      
       # $TC actions add action ife encode allow prio pass index 42
       IFE type 0xED3E
       # $TC actions replace action ife encode allow tcindex pass index 42
      
      in case the kernel was unable to run the last command (e.g. because of
      the impossibility to load 'act_meta_skbtcindex'). For a similar reason,
      the kernel can leak idr in the error path of tcf_ife_init(), because
      tcf_idr_release() is not called after successful idr reservation:
      
       # $TC actions add action ife encode allow tcindex index 47
       IFE type 0xED3E
       RTNETLINK answers: No such file or directory
       We have an error talking to the kernel
       # $TC actions add action ife encode allow tcindex index 47
       IFE type 0xED3E
       RTNETLINK answers: No space left on device
       We have an error talking to the kernel
       # $TC actions add action ife encode use mark 7 type 0xfefe pass index 47
       IFE type 0xFEFE
       RTNETLINK answers: No space left on device
       We have an error talking to the kernel
      
      Since tcfa_lock is already taken when the action is being edited, a call
      to tcf_idr_release() wrongly makes tcf_idr_cleanup() take the same lock
      again. On the other hand, tcf_idr_release() needs to be called in the
      error path of tcf_ife_init(), to undo the last tcf_idr_create() invocation.
      Fix both problems in tcf_ife_init().
      Since the cleanup() routine can now be called when ife->params is NULL,
      also add a NULL pointer check to avoid calling kfree_rcu(NULL, rcu).
      
       [1]
       ============================================
       WARNING: possible recursive locking detected
       4.17.0-rc4.kasan+ #417 Tainted: G            E
       --------------------------------------------
       tc/3932 is trying to acquire lock:
       000000005097c9a6 (&(&p->tcfa_lock)->rlock){+...}, at: tcf_ife_cleanup+0x19/0x80 [act_ife]
      
       but task is already holding lock:
       000000005097c9a6 (&(&p->tcfa_lock)->rlock){+...}, at: tcf_ife_init+0xf6d/0x13c0 [act_ife]
      
       other info that might help us debug this:
        Possible unsafe locking scenario:
      
              CPU0
              ----
         lock(&(&p->tcfa_lock)->rlock);
         lock(&(&p->tcfa_lock)->rlock);
      
        *** DEADLOCK ***
      
        May be due to missing lock nesting notation
      
       2 locks held by tc/3932:
        #0: 000000007ca8e990 (rtnl_mutex){+.+.}, at: tcf_ife_init+0xf61/0x13c0 [act_ife]
        #1: 000000005097c9a6 (&(&p->tcfa_lock)->rlock){+...}, at: tcf_ife_init+0xf6d/0x13c0 [act_ife]
      
       stack backtrace:
       CPU: 3 PID: 3932 Comm: tc Tainted: G            E     4.17.0-rc4.kasan+ #417
       Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
       Call Trace:
        dump_stack+0x9a/0xeb
        __lock_acquire+0xf43/0x34a0
        ? debug_check_no_locks_freed+0x2b0/0x2b0
        ? debug_check_no_locks_freed+0x2b0/0x2b0
        ? debug_check_no_locks_freed+0x2b0/0x2b0
        ? __mutex_lock+0x62f/0x1240
        ? kvm_sched_clock_read+0x1a/0x30
        ? sched_clock+0x5/0x10
        ? sched_clock_cpu+0x18/0x170
        ? find_held_lock+0x39/0x1d0
        ? lock_acquire+0x10b/0x330
        lock_acquire+0x10b/0x330
        ? tcf_ife_cleanup+0x19/0x80 [act_ife]
        _raw_spin_lock_bh+0x38/0x70
        ? tcf_ife_cleanup+0x19/0x80 [act_ife]
        tcf_ife_cleanup+0x19/0x80 [act_ife]
        __tcf_idr_release+0xff/0x350
        tcf_ife_init+0xdde/0x13c0 [act_ife]
        ? ife_exit_net+0x290/0x290 [act_ife]
        ? __lock_is_held+0xb4/0x140
        tcf_action_init_1+0x67b/0xad0
        ? tcf_action_dump_old+0xa0/0xa0
        ? sched_clock+0x5/0x10
        ? sched_clock_cpu+0x18/0x170
        ? kvm_sched_clock_read+0x1a/0x30
        ? sched_clock+0x5/0x10
        ? sched_clock_cpu+0x18/0x170
        ? memset+0x1f/0x40
        tcf_action_init+0x30f/0x590
        ? tcf_action_init_1+0xad0/0xad0
        ? memset+0x1f/0x40
        tc_ctl_action+0x48e/0x5e0
        ? mutex_lock_io_nested+0x1160/0x1160
        ? tca_action_gd+0x990/0x990
        ? sched_clock+0x5/0x10
        ? find_held_lock+0x39/0x1d0
        rtnetlink_rcv_msg+0x4da/0x990
        ? validate_linkmsg+0x680/0x680
        ? sched_clock_cpu+0x18/0x170
        ? find_held_lock+0x39/0x1d0
        netlink_rcv_skb+0x127/0x350
        ? validate_linkmsg+0x680/0x680
        ? netlink_ack+0x970/0x970
        ? __kmalloc_node_track_caller+0x304/0x3a0
        netlink_unicast+0x40f/0x5d0
        ? netlink_attachskb+0x580/0x580
        ? _copy_from_iter_full+0x187/0x760
        ? import_iovec+0x90/0x390
        netlink_sendmsg+0x67f/0xb50
        ? netlink_unicast+0x5d0/0x5d0
        ? copy_msghdr_from_user+0x206/0x340
        ? netlink_unicast+0x5d0/0x5d0
        sock_sendmsg+0xb3/0xf0
        ___sys_sendmsg+0x60a/0x8b0
        ? copy_msghdr_from_user+0x340/0x340
        ? lock_downgrade+0x5e0/0x5e0
        ? tty_write_lock+0x18/0x50
        ? kvm_sched_clock_read+0x1a/0x30
        ? sched_clock+0x5/0x10
        ? sched_clock_cpu+0x18/0x170
        ? find_held_lock+0x39/0x1d0
        ? lock_downgrade+0x5e0/0x5e0
        ? lock_acquire+0x10b/0x330
        ? __audit_syscall_entry+0x316/0x690
        ? current_kernel_time64+0x6b/0xd0
        ? __fget_light+0x55/0x1f0
        ? __sys_sendmsg+0xd2/0x170
        __sys_sendmsg+0xd2/0x170
        ? __ia32_sys_shutdown+0x70/0x70
        ? syscall_trace_enter+0x57a/0xd60
        ? rcu_read_lock_sched_held+0xdc/0x110
        ? __bpf_trace_sys_enter+0x10/0x10
        ? do_syscall_64+0x22/0x480
        do_syscall_64+0xa5/0x480
        entry_SYSCALL_64_after_hwframe+0x49/0xbe
       RIP: 0033:0x7fd646988ba0
       RSP: 002b:00007fffc9fab3c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
       RAX: ffffffffffffffda RBX: 00007fffc9fab4f0 RCX: 00007fd646988ba0
       RDX: 0000000000000000 RSI: 00007fffc9fab440 RDI: 0000000000000003
       RBP: 000000005b28c8b3 R08: 0000000000000002 R09: 0000000000000000
       R10: 00007fffc9faae20 R11: 0000000000000246 R12: 0000000000000000
       R13: 00007fffc9fab504 R14: 0000000000000001 R15: 000000000066c100
      
      Fixes: 4e8c8615 ("net sched: net sched: ife action fix late binding")
      Fixes: ef6980b6 ("introduce IFE action")
      Signed-off-by: default avatarDavide Caratti <dcaratti@redhat.com>
      Acked-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0a889b94
  3. 19 Jun, 2018 5 commits