1. 11 11月, 2017 5 次提交
  2. 10 11月, 2017 8 次提交
    • L
      Merge branch 'akpm' (patches from Andrew) · 1c9dbd46
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "2 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        MAINTAINERS: update TPM driver infrastructure changes
        sysctl: add register_sysctl() dummy helper
      1c9dbd46
    • J
      MAINTAINERS: update TPM driver infrastructure changes · 60fdb44a
      Jarkko Sakkinen 提交于
      [akpm@linux-foundation.org: alpha-sort CREDITS, per Randy]
      Link: http://lkml.kernel.org/r/20170915223811.21368-1-jarkko.sakkinen@linux.intel.comSigned-off-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Cc: Marcel Selhorst <tpmdd@selhorst.net>
      Cc: Ashley Lai <ashleydlai@gmail.com>
      Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Håvard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Martin Kepplinger <martink@posteo.de>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Gertjan van Wingerde <gwingerde@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      60fdb44a
    • A
      sysctl: add register_sysctl() dummy helper · e609a6b8
      Arnd Bergmann 提交于
      register_sysctl() has been around for five years with commit
      fea478d4 ("sysctl: Add register_sysctl for normal sysctl users") but
      now that arm64 started using it, I ran into a compile error:
      
        arch/arm64/kernel/armv8_deprecated.c: In function 'register_insn_emulation_sysctl':
        arch/arm64/kernel/armv8_deprecated.c:257:2: error: implicit declaration of function 'register_sysctl'
      
      This adds a inline function like we already have for
      register_sysctl_paths() and register_sysctl_table().
      
      Link: http://lkml.kernel.org/r/20171106133700.558647-1-arnd@arndb.de
      Fixes: 38b9aeb3 ("arm64: Port deprecated instruction emulation to new sysctl interface")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NDave Martin <Dave.Martin@arm.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>
      Cc: Alex Benne <alex.bennee@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e609a6b8
    • L
      Merge tag 'pci-v4.14-fixes-7' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 5cff3684
      Linus Torvalds 提交于
      Pull PCI maintainership updates from Bjorn Helgaas:
       "Update MAINTAINERS for HiSilicon, Microsemi Switchtec, and native host
        bridge drivers (Gabriele Paoloni, Sebastian Andrzej Siewior).
      
        Note that starting with changes intended for v4.16, Lorenzo Pieralisi
        will maintain the drivers/pci/{dwc,endpoint,host} directories. My
        intent is to continue to merge those changes via my tree, so this
        should be transparent to you"
      
      * tag 'pci-v4.14-fixes-7' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        MAINTAINERS: Add Lorenzo Pieralisi for PCI host bridge drivers
        MAINTAINERS: Remove Gabriele Paoloni as HiSilicon PCI maintainer
        MAINTAINERS: Remove Stephen Bates as Microsemi Switchtec maintainer
      5cff3684
    • L
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · e7a7912a
      Linus Torvalds 提交于
      Pull ARM fix from Russell King:
       "Last ARM fix for 4.14.
      
        This plugs a hole in dump_instr(), which, with certain conditions
        satisfied, can dump instructions from kernel space"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: 8720/1: ensure dump_instr() checks addr_limit
      e7a7912a
    • L
      Merge tag 'pm-final-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 3fefc318
      Linus Torvalds 提交于
      Pull final power management fixes from Rafael Wysocki:
       "These fix a regression in the schedutil cpufreq governor introduced by
        a recent change and blacklist Dell XPS13 9360 from using the Low Power
        S0 Idle _DSM interface which triggers serious problems on one of these
        machines.
      
        Specifics:
      
         - Prevent the schedutil cpufreq governor from using the utilization
           of a wrong CPU in some cases which started to happen after one of
           the recent changes in it (Chris Redpath).
      
         - Blacklist Dell XPS13 9360 from using the Low Power S0 Idle _DSM
           interface as that causes serious issue (related to NVMe) to appear
           on one of these machines, even though the other Dells XPS13 9360 in
           somewhat different HW configurations behave correctly (Rafael
           Wysocki)"
      
      * tag 'pm-final-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI / PM: Blacklist Low Power S0 Idle _DSM for Dell XPS13 9360
        cpufreq: schedutil: Examine the correct CPU when we update util
      3fefc318
    • L
      Merge tag 'sound-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · d93d4ce1
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "The amount of the changes isn't as quite small as wished, nevertheless
        they are straight fixes that deserve merging to 4.14 final.
      
        Most of fixes are about ALSA core bugs spotted by fuzzer: a follow-up
        fix for the previous nested rwsem patch, a fix to avoid the resource
        hogs due to too many concurrent ALSA timer invocations, and a fix for
        a crash with SYSEX MIDI transfer over OSS sequencer emulation that is
        used by none but fuzzer.
      
        The rest are usual HD-audio and USB-audio device-specific quirks,
        which are safe to apply"
      
      * tag 'sound-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - fix headset mic problem for Dell machines with alc274
        ALSA: seq: Fix OSS sysex delivery in OSS emulation
        ALSA: seq: Avoid invalid lockdep class warning
        ALSA: timer: Limit max instances per timer
        ALSA: usb-audio: support new Amanero Combo384 firmware version
      d93d4ce1
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · d1041cdc
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix use-after-free in IPSEC input parsing, desintation address
          pointer was loaded before pskb_may_pull() which can change the SKB
          data pointers. From Florian Westphal.
      
       2) Stack out-of-bounds read in xfrm_state_find(), from Steffen
          Klassert.
      
       3) IPVS state of SKB is not properly reset when moving between
          namespaces, from Ye Yin.
      
       4) Fix crash in asix driver suspend and resume, from Andrey Konovalov.
      
       5) Don't deliver ipv6 l2tp tunnel packets to ipv4 l2tp tunnels, and
          vice versa, from Guillaume Nault.
      
       6) Fix DSACK undo on non-dup ACKs, from Priyaranjan Jha.
      
       7) Fix regression in bond_xmit_hash()'s behavior after the TCP port
          selection changes back in 4.2, from Hangbin Liu.
      
       8) Two divide by zero bugs in USB networking drivers when parsing
          descriptors, from Bjorn Mork.
      
       9) Fix bonding slaves being stuck in BOND_LINK_FAIL state, from Jay
          Vosburgh.
      
      10) Missing skb_reset_mac_header() in qmi_wwan, from Kristian Evensen.
      
      11) Fix the destruction of tc action object races properly, from Cong
          Wang.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (31 commits)
        cls_u32: use tcf_exts_get_net() before call_rcu()
        cls_tcindex: use tcf_exts_get_net() before call_rcu()
        cls_rsvp: use tcf_exts_get_net() before call_rcu()
        cls_route: use tcf_exts_get_net() before call_rcu()
        cls_matchall: use tcf_exts_get_net() before call_rcu()
        cls_fw: use tcf_exts_get_net() before call_rcu()
        cls_flower: use tcf_exts_get_net() before call_rcu()
        cls_flow: use tcf_exts_get_net() before call_rcu()
        cls_cgroup: use tcf_exts_get_net() before call_rcu()
        cls_bpf: use tcf_exts_get_net() before call_rcu()
        cls_basic: use tcf_exts_get_net() before call_rcu()
        net_sched: introduce tcf_exts_get_net() and tcf_exts_put_net()
        Revert "net_sched: hold netns refcnt for each action"
        net: usb: asix: fill null-ptr-deref in asix_suspend
        Revert "net: usb: asix: fill null-ptr-deref in asix_suspend"
        qmi_wwan: Add missing skb_reset_mac_header-call
        bonding: fix slave stuck in BOND_LINK_FAIL state
        qrtr: Move to postcore_initcall
        net: qmi_wwan: fix divide by 0 on bad descriptors
        net: cdc_ether: fix divide by 0 on bad descriptors
        ...
      d1041cdc
  3. 09 11月, 2017 25 次提交
    • H
      ALSA: hda - fix headset mic problem for Dell machines with alc274 · 75ee94b2
      Hui Wang 提交于
      Confirmed with Kailang of Realtek, the pin 0x19 is for Headset Mic, and
      the pin 0x1a is for Headphone Mic, he suggested to apply
      ALC269_FIXUP_DELL1_MIC_NO_PRESENCE to fix this problem. And we
      verified applying this FIXUP can fix this problem.
      
      Cc: <stable@vger.kernel.org>
      Cc: Kailang Yang <kailang@realtek.com>
      Signed-off-by: NHui Wang <hui.wang@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      75ee94b2
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec · 6a172802
      David S. Miller 提交于
      Steffen Klassert says:
      
      ====================
      pull request (net): ipsec 2017-11-09
      
      1) Fix a use after free due to a reallocated skb head.
         From Florian Westphal.
      
      2) Fix sporadic lookup failures on labeled IPSEC.
         From Florian Westphal.
      
      3) Fix a stack out of bounds when a socket policy is applied
         to an IPv6 socket that sends IPv4 packets.
      
      Please pull or let me know if there are problems.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a172802
    • D
      Merge tag 'drm-intel-fixes-2017-11-08' of... · 60ccb31b
      Dave Airlie 提交于
      Merge tag 'drm-intel-fixes-2017-11-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - Fix possible NULL dereference (Chris).
      - Avoid miss usage of syncobj by rejecting unknown flags (Tvrtko).
      
      * tag 'drm-intel-fixes-2017-11-08' of git://anongit.freedesktop.org/drm/drm-intel:
        drm/i915: Deconstruct struct sgt_dma initialiser
        drm/i915: Reject unknown syncobj flags
      60ccb31b
    • D
      Merge branch 'net-sched-race-fix' · 623859ae
      David S. Miller 提交于
      Cong Wang says:
      
      ====================
      net_sched: close the race between call_rcu() and cleanup_net()
      
      This patchset tries to fix the race between call_rcu() and
      cleanup_net() again. Without holding the netns refcnt the
      tc_action_net_exit() in netns workqueue could be called before
      filter destroy works in tc filter workqueue. This patchset
      moves the netns refcnt from tc actions to tcf_exts, without
      breaking per-netns tc actions.
      
      Patch 1 reverts the previous fix, patch 2 introduces two new
      API's to help to address the bug and the rest patches switch
      to the new API's. Please see each patch for details.
      
      I was not able to reproduce this bug, but now after adding
      some delay in filter destroy work I manage to trigger the
      crash. After this patchset, the crash is not reproducible
      any more and the debugging printk's show the order is expected
      too.
      ====================
      
      Fixes: ddf97ccd ("net_sched: add network namespace support for tc actions")
      Reported-by: NLucas Bates <lucasb@mojatatu.com>
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      623859ae
    • C
      cls_u32: use tcf_exts_get_net() before call_rcu() · 35c55fc1
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      35c55fc1
    • C
      cls_tcindex: use tcf_exts_get_net() before call_rcu() · f2b75105
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f2b75105
    • C
      cls_rsvp: use tcf_exts_get_net() before call_rcu() · 96585063
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96585063
    • C
      cls_route: use tcf_exts_get_net() before call_rcu() · 3fd51de5
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3fd51de5
    • C
      cls_matchall: use tcf_exts_get_net() before call_rcu() · 57767e78
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      57767e78
    • C
      cls_fw: use tcf_exts_get_net() before call_rcu() · d5f984f5
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d5f984f5
    • C
      cls_flower: use tcf_exts_get_net() before call_rcu() · 0dadc117
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0dadc117
    • C
      cls_flow: use tcf_exts_get_net() before call_rcu() · 22f7cec9
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22f7cec9
    • C
      cls_cgroup: use tcf_exts_get_net() before call_rcu() · ed148168
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed148168
    • C
      cls_bpf: use tcf_exts_get_net() before call_rcu() · aae2c35e
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aae2c35e
    • C
      cls_basic: use tcf_exts_get_net() before call_rcu() · 0b2a5989
      Cong Wang 提交于
      Hold netns refcnt before call_rcu() and release it after
      the tcf_exts_destroy() is done.
      
      Note, on ->destroy() path we have to respect the return value
      of tcf_exts_get_net(), on other paths it should always return
      true, so we don't need to care.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0b2a5989
    • C
      net_sched: introduce tcf_exts_get_net() and tcf_exts_put_net() · e4b95c41
      Cong Wang 提交于
      Instead of holding netns refcnt in tc actions, we can minimize
      the holding time by saving it in struct tcf_exts instead. This
      means we can just hold netns refcnt right before call_rcu() and
      release it after tcf_exts_destroy() is done.
      
      However, because on netns cleanup path we call tcf_proto_destroy()
      too, obviously we can not hold netns for a zero refcnt, in this
      case we have to do cleanup synchronously. It is fine for RCU too,
      the caller cleanup_net() already waits for a grace period.
      
      For other cases, refcnt is non-zero and we can safely grab it as
      normal and release it after we are done.
      
      This patch provides two new API for each filter to use:
      tcf_exts_get_net() and tcf_exts_put_net(). And all filters now can
      use the following pattern:
      
      void __destroy_filter() {
        tcf_exts_destroy();
        tcf_exts_put_net();  // <== release netns refcnt
        kfree();
      }
      void some_work() {
        rtnl_lock();
        __destroy_filter();
        rtnl_unlock();
      }
      void some_rcu_callback() {
        tcf_queue_work(some_work);
      }
      
      if (tcf_exts_get_net())  // <== hold netns refcnt
        call_rcu(some_rcu_callback);
      else
        __destroy_filter();
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4b95c41
    • C
      Revert "net_sched: hold netns refcnt for each action" · c7e460ce
      Cong Wang 提交于
      This reverts commit ceffcc5e.
      If we hold that refcnt, the netns can never be destroyed until
      all actions are destroyed by user, this breaks our netns design
      which we expect all actions are destroyed when we destroy the
      whole netns.
      
      Cc: Lucas Bates <lucasb@mojatatu.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7e460ce
    • A
      net: usb: asix: fill null-ptr-deref in asix_suspend · 8f562462
      Andrey Konovalov 提交于
      When asix_suspend() is called dev->driver_priv might not have been
      assigned a value, so we need to check that it's not NULL.
      
      Similar issue is present in asix_resume(), this patch fixes it as well.
      
      Found by syzkaller.
      
      kasan: CONFIG_KASAN_INLINE enabled
      kasan: GPF could be caused by NULL-ptr deref or user memory access
      general protection fault: 0000 [#1] PREEMPT SMP KASAN
      Modules linked in:
      CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.14.0-rc4-43422-geccacdd69a8c #400
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      Workqueue: usb_hub_wq hub_event
      task: ffff88006bb36300 task.stack: ffff88006bba8000
      RIP: 0010:asix_suspend+0x76/0xc0 drivers/net/usb/asix_devices.c:629
      RSP: 0018:ffff88006bbae718 EFLAGS: 00010202
      RAX: dffffc0000000000 RBX: ffff880061ba3b80 RCX: 1ffff1000c34d644
      RDX: 0000000000000001 RSI: 0000000000000402 RDI: 0000000000000008
      RBP: ffff88006bbae738 R08: 1ffff1000d775cad R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: ffff8800630a8b40
      R13: 0000000000000000 R14: 0000000000000402 R15: ffff880061ba3b80
      FS:  0000000000000000(0000) GS:ffff88006c600000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007ff33cf89000 CR3: 0000000061c0a000 CR4: 00000000000006f0
      Call Trace:
       usb_suspend_interface drivers/usb/core/driver.c:1209
       usb_suspend_both+0x27f/0x7e0 drivers/usb/core/driver.c:1314
       usb_runtime_suspend+0x41/0x120 drivers/usb/core/driver.c:1852
       __rpm_callback+0x339/0xb60 drivers/base/power/runtime.c:334
       rpm_callback+0x106/0x220 drivers/base/power/runtime.c:461
       rpm_suspend+0x465/0x1980 drivers/base/power/runtime.c:596
       __pm_runtime_suspend+0x11e/0x230 drivers/base/power/runtime.c:1009
       pm_runtime_put_sync_autosuspend ./include/linux/pm_runtime.h:251
       usb_new_device+0xa37/0x1020 drivers/usb/core/hub.c:2487
       hub_port_connect drivers/usb/core/hub.c:4903
       hub_port_connect_change drivers/usb/core/hub.c:5009
       port_event drivers/usb/core/hub.c:5115
       hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195
       process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119
       worker_thread+0x221/0x1850 kernel/workqueue.c:2253
       kthread+0x3a1/0x470 kernel/kthread.c:231
       ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431
      Code: 8d 7c 24 20 48 89 fa 48 c1 ea 03 80 3c 02 00 75 5b 48 b8 00 00
      00 00 00 fc ff df 4d 8b 6c 24 20 49 8d 7d 08 48 89 fa 48 c1 ea 03 <80>
      3c 02 00 75 34 4d 8b 6d 08 4d 85 ed 74 0b e8 26 2b 51 fd 4c
      RIP: asix_suspend+0x76/0xc0 RSP: ffff88006bbae718
      ---[ end trace dfc4f5649284342c ]---
      Signed-off-by: NAndrey Konovalov <andreyknvl@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f562462
    • D
      Revert "net: usb: asix: fill null-ptr-deref in asix_suspend" · 1a8e6b48
      David S. Miller 提交于
      This reverts commit baedf68a.
      
      There is an updated version of this fix which covers
      the problem more thoroughly.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a8e6b48
    • R
      Merge branch 'pm-cpufreq-sched' · e029b9bf
      Rafael J. Wysocki 提交于
      * pm-cpufreq-sched:
        cpufreq: schedutil: Examine the correct CPU when we update util
      e029b9bf
    • J
      x86/mm: Unbreak modules that rely on external PAGE_KERNEL availability · 87df2617
      Jiri Kosina 提交于
      Commit 7744ccdb ("x86/mm: Add Secure Memory Encryption (SME)
      support") as a side-effect made PAGE_KERNEL all of a sudden unavailable
      to modules which can't make use of EXPORT_SYMBOL_GPL() symbols.
      
      This is because once SME is enabled, sme_me_mask (which is introduced as
      EXPORT_SYMBOL_GPL) makes its way to PAGE_KERNEL through _PAGE_ENC,
      causing imminent build failure for all the modules which make use of all
      the EXPORT-SYMBOL()-exported API (such as vmap(), __vmalloc(),
      remap_pfn_range(), ...).
      
      Exporting (as EXPORT_SYMBOL()) interfaces (and having done so for ages)
      that take pgprot_t argument, while making it impossible to -- all of a
      sudden -- pass PAGE_KERNEL to it, feels rather incosistent.
      
      Restore the original behavior and make it possible to pass PAGE_KERNEL
      to all its EXPORT_SYMBOL() consumers.
      
      [ This is all so not wonderful. We shouldn't need that "sme_me_mask"
        access at all in all those places that really don't care about that
        level of detail, and just want _PAGE_KERNEL or whatever.
      
        We have some similar issues with _PAGE_CACHE_WP and _PAGE_NOCACHE,
        both of which hide a "cachemode2protval()" call, and which also ends
        up using another EXPORT_SYMBOL(), but at least that only triggers for
        the much more rare cases.
      
        Maybe we could move these dynamic page table bits to be generated much
        deeper down in the VM layer, instead of hiding them in the macros that
        everybody uses.
      
        So this all would merit some cleanup. But not today.   - Linus ]
      
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Despised-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      87df2617
    • L
      Merge branch 'fixes-v4.14-rc8' of... · d6a2cf07
      Linus Torvalds 提交于
      Merge branch 'fixes-v4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
      
      Pull key handling fix from James Morris:
       "Fix by Eric Biggers for the keys subsystem"
      
      * 'fixes-v4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        KEYS: fix NULL pointer dereference during ASN.1 parsing [ver #2]
      d6a2cf07
    • J
      apparmor: fix off-by-one comparison on MAXMAPPED_SIG · f7dc4c9a
      John Johansen 提交于
      This came in yesterday, and I have verified our regression tests
      were missing this and it can cause an oops. Please apply.
      
      There is a an off-by-one comparision on sig against MAXMAPPED_SIG
      that can lead to a read outside the sig_map array if sig
      is MAXMAPPED_SIG. Fix this.
      
      Verified that the check is an out of bounds case that can cause an oops.
      
      Revised: add comparison fix to second case
      Fixes: cd1dbf76 ("apparmor: add the ability to mediate signals")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f7dc4c9a
    • C
      drm/i915: Deconstruct struct sgt_dma initialiser · 423a8a94
      Chris Wilson 提交于
      gcc-4.4 complains about:
      
      	struct sgt_dma iter = {
      		.sg = vma->pages->sgl,
      		.dma = sg_dma_address(iter.sg),
      		.max = iter.dma + iter.sg->length,
      	};
      
      drivers/gpu/drm/i915/i915_gem_gtt.c: In function ‘gen8_ppgtt_insert_4lvl’:
      drivers/gpu/drm/i915/i915_gem_gtt.c:938: error: ‘iter.sg’ is used uninitialized in this function
      drivers/gpu/drm/i915/i915_gem_gtt.c:939: error: ‘iter.dma’ is used uninitialized in this function
      
      and worse generates invalid code that triggers a GPF:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
      IP: gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915]
      PGD 0
      Oops: 0000 [#1] SMP
      Modules linked in: snd_aloop nf_conntrack_ipv6 nf_defrag_ipv6 nf_log_ipv6 ip6table_filter ip6_tables ctr ccm xt_state nf_log_ipv4
      nf_log_common xt_LOG xt_limit xt_recent xt_owner xt_addrtype iptable_filter ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat
      nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c ip_tables dm_mod vhost_net macvtap macvlan vhost tun kvm_intel kvm
      irqbypass uas usb_storage hid_multitouch btusb btrtl uvcvideo videobuf2_v4l2 videobuf2_core videodev media videobuf2_vmalloc videobuf2_memops
      sg ppdev dell_wmi sparse_keymap mei_wdt sd_mod iTCO_wdt iTCO_vendor_support rtsx_pci_ms memstick rtsx_pci_sdmmc mmc_core dell_smm_hwmon hwmon
      dell_laptop dell_smbios dcdbas joydev input_leds hci_uart btintel btqca btbcm bluetooth parport_pc parport i2c_hid
        intel_lpss_acpi intel_lpss pcspkr wmi int3400_thermal acpi_thermal_rel dell_rbtn mei_me mei snd_hda_codec_hdmi snd_hda_codec_realtek
      snd_hda_codec_generic ahci libahci acpi_pad xhci_pci xhci_hcd snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device
      snd_pcm snd_timer snd soundcore int3403_thermal arc4 e1000e ptp pps_core i2c_i801 iwlmvm mac80211 rtsx_pci iwlwifi cfg80211 rfkill
      intel_pch_thermal processor_thermal_device int340x_thermal_zone intel_soc_dts_iosf i915 video fjes
      CPU: 2 PID: 2408 Comm: X Not tainted 4.10.0-rc5+ #1
      Hardware name: Dell Inc. Latitude E7470/0T6HHJ, BIOS 1.11.3 11/09/2016
      task: ffff880219fe4740 task.stack: ffffc90005f98000
      RIP: 0010:gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915]
      RSP: 0018:ffffc90005f9b8c8 EFLAGS: 00010246
      RAX: 0000000000000000 RBX: ffff8802167d8000 RCX: 0000000000000001
      RDX: 00000000ffff7000 RSI: ffff880219f94140 RDI: ffff880228444000
      RBP: ffffc90005f9b948 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000080
      R13: 0000000000000001 R14: ffffc90005f9bcd7 R15: ffff88020c9a83c0
      FS:  00007fb53e1ee920(0000) GS:ffff88024dd00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000010 CR3: 000000022ef95000 CR4: 00000000003406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
        ppgtt_bind_vma+0x40/0x50 [i915]
        i915_vma_bind+0xcb/0x1c0 [i915]
        __i915_vma_do_pin+0x6e/0xd0 [i915]
        i915_gem_execbuffer_reserve_vma+0x162/0x1d0 [i915]
        i915_gem_execbuffer_reserve+0x4fc/0x510 [i915]
        ? __kmalloc+0x134/0x250
        ? i915_gem_wait_for_error+0x25/0x100 [i915]
        ? i915_gem_wait_for_error+0x25/0x100 [i915]
        i915_gem_do_execbuffer+0x2df/0xa00 [i915]
        ? drm_malloc_gfp.clone.0+0x42/0x80 [i915]
        ? path_put+0x22/0x30
        ? __check_object_size+0x62/0x1f0
        ? terminate_walk+0x44/0x90
        i915_gem_execbuffer2+0x95/0x1e0 [i915]
        drm_ioctl+0x243/0x490
        ? handle_pte_fault+0x1d7/0x220
        ? i915_gem_do_execbuffer+0xa00/0xa00 [i915]
        ? handle_mm_fault+0x10d/0x2a0
        vfs_ioctl+0x18/0x30
        do_vfs_ioctl+0x14b/0x3f0
        SyS_ioctl+0x92/0xa0
        entry_SYSCALL_64_fastpath+0x1a/0xa9
      RIP: 0033:0x7fb53b4fcb77
      RSP: 002b:00007ffe0c572898 EFLAGS: 00003246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 00007fb53e17c038 RCX: 00007fb53b4fcb77
      RDX: 00007ffe0c572900 RSI: 0000000040406469 RDI: 000000000000000b
      RBP: 00007fb5376d67e0 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000028 R11: 0000000000003246 R12: 0000000000000000
      R13: 0000000000000000 R14: 000055eecb314d00 R15: 000055eecb315460
      Code: 0f 84 5d ff ff ff eb a2 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 ec 58 0f 1f 44 00 00 31 c0 89 4d b0 <4c>
      8b 60 10 44 8b 70 0c 48 89 d0 4c 8b 2e 48 c1 e8 27 25 ff 01
      RIP: gen8_ppgtt_insert_4lvl+0x1b/0x1e0 [i915] RSP: ffffc90005f9b8c8
      CR2: 0000000000000010
      
      Recent gccs, such as 4.9, 6.3 or 7.2, do not generate the warning nor do
      they explode on use. If we manually create the struct using locals from
      the stack, this should eliminate this issue, and does not alter code
      generation with gcc-7.2.
      
      Fixes: 894ccebe ("drm/i915: Micro-optimise gen8_ppgtt_insert_entries()")
      Reported-by: NKelly French <kfrench@federalhill.net>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Kelly French <kfrench@federalhill.net>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171106211128.12538-1-chris@chris-wilson.co.ukTested-by: NKelly French <kfrench@federalhill.net>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      (cherry picked from commit 5684514b)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      423a8a94
    • T
      drm/i915: Reject unknown syncobj flags · 40a48845
      Tvrtko Ursulin 提交于
      We have to reject unknown flags for uAPI considerations, and also
      because the curent implementation limits their i915 storage space
      to two bits.
      
      v2: (Chris Wilson)
       * Fix fail in ABI check.
       * Added unknown flags and BUILD_BUG_ON.
      
      v3:
       * Use ARCH_KMALLOC_MINALIGN instead of alignof. (Chris Wilson)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Fixes: cf6e7bac ("drm/i915: Add support for drm syncobjs")
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: intel-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171031102326.9738-1-tvrtko.ursulin@linux.intel.com
      (cherry picked from commit ebcaa1ff)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      40a48845
  4. 08 11月, 2017 2 次提交