1. 17 Apr, 2020 40 commits
    • Vasily Averin's avatar
      tpm: tpm2_bios_measurements_next should increase position index · 64157692
      Vasily Averin authored
      commit f9bf8adb upstream.
      
      If .next function does not change position index,
      following .show function will repeat output related
      to current position index.
      
      For /sys/kernel/security/tpm0/binary_bios_measurements:
      1) read after lseek beyound end of file generates whole last line.
      2) read after lseek to middle of last line generates
      expected end of last line and unexpected whole last line once again.
      
      Cc: stable@vger.kernel.org # 4.19.x
      Fixes: 1f4aace6 ("fs/seq_file.c: simplify seq_file iteration code ...")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64157692
    • Vasily Averin's avatar
      tpm: tpm1_bios_measurements_next should increase position index · 1da36bed
      Vasily Averin authored
      commit d7a47b96 upstream.
      
      If .next function does not change position index,
      following .show function will repeat output related
      to current position index.
      
      In case of /sys/kernel/security/tpm0/ascii_bios_measurements
      and binary_bios_measurements:
      1) read after lseek beyound end of file generates whole last line.
      2) read after lseek to middle of last line generates
      expected end of last line and unexpected whole last line once again.
      
      Cc: stable@vger.kernel.org # 4.19.x
      Fixes: 1f4aace6 ("fs/seq_file.c: simplify seq_file iteration code ...")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1da36bed
    • Matthew Garrett's avatar
      tpm: Don't make log failures fatal · 7c775e8e
      Matthew Garrett authored
      commit 805fa88e upstream.
      
      If a TPM is in disabled state, it's reasonable for it to have an empty
      log. Bailing out of probe in this case means that the PPI interface
      isn't available, so there's no way to then enable the TPM from the OS.
      In general it seems reasonable to ignore log errors - they shouldn't
      interfere with any other TPM functionality.
      Signed-off-by: default avatarMatthew Garrett <matthewgarrett@google.com>
      Cc: stable@vger.kernel.org # 4.19.x
      Reviewed-by: default avatarJerry Snitselaar <jsnitsel@redhat.com>
      Reviewed-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7c775e8e
    • Kishon Vijay Abraham I's avatar
      PCI: endpoint: Fix for concurrent memory allocation in OB address region · 9ffaeee7
      Kishon Vijay Abraham I authored
      commit 04e046ca upstream.
      
      pci-epc-mem uses a bitmap to manage the Endpoint outbound (OB) address
      region. This address region will be shared by multiple endpoint
      functions (in the case of multi function endpoint) and it has to be
      protected from concurrent access to avoid updating an inconsistent state.
      
      Use a mutex to protect bitmap updates to prevent the memory
      allocation API from returning incorrect addresses.
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: stable@vger.kernel.org # v4.14+
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9ffaeee7
    • Sean V Kelley's avatar
      PCI: Add boot interrupt quirk mechanism for Xeon chipsets · d2345d12
      Sean V Kelley authored
      commit b88bf6c3 upstream.
      
      The following was observed by Kar Hin Ong with RT patchset:
      
        Backtrace:
        irq 19: nobody cared (try booting with the "irqpoll" option)
        CPU: 0 PID: 3329 Comm: irq/34-nipalk Tainted:4.14.87-rt49 #1
        Hardware name: National Instruments NI PXIe-8880/NI PXIe-8880,
                 BIOS 2.1.5f1 01/09/2020
        Call Trace:
        <IRQ>
          ? dump_stack+0x46/0x5e
          ? __report_bad_irq+0x2e/0xb0
          ? note_interrupt+0x242/0x290
          ? nNIKAL100_memoryRead16+0x8/0x10 [nikal]
          ? handle_irq_event_percpu+0x55/0x70
          ? handle_irq_event+0x4f/0x80
          ? handle_fasteoi_irq+0x81/0x180
          ? handle_irq+0x1c/0x30
          ? do_IRQ+0x41/0xd0
          ? common_interrupt+0x84/0x84
        </IRQ>
        ...
        handlers:
        [<ffffffffb3297200>] irq_default_primary_handler threaded
        [<ffffffffb3669180>] usb_hcd_irq
        Disabling IRQ #19
      
      The problem being that this device is triggering boot interrupts
      due to threaded interrupt handling and masking of the IO-APIC. These
      boot interrupts are then forwarded on to the legacy PCH's PIRQ lines
      where there is no handler present for the device.
      
      Whenever a PCI device fires interrupt (INTx) to Pin 20 of IOAPIC 2
      (GSI 44), the kernel receives two interrupts:
      
         1. Interrupt from Pin 20 of IOAPIC 2  -> Expected
         2. Interrupt from Pin 19 of IOAPIC 1  -> UNEXPECTED
      
      Quirks for disabling boot interrupts (preferred) or rerouting the
      handler exist but do not address these Xeon chipsets' mechanism:
      https://lore.kernel.org/lkml/12131949181903-git-send-email-sassmann@suse.de/
      
      Add a new mechanism via PCI CFG for those chipsets supporting CIPINTRC
      register's dis_intx_rout2ich bit.
      
      Link: https://lore.kernel.org/r/20200220192930.64820-2-sean.v.kelley@linux.intel.comReported-by: default avatarKar Hin Ong <kar.hin.ong@ni.com>
      Tested-by: default avatarKar Hin Ong <kar.hin.ong@ni.com>
      Signed-off-by: default avatarSean V Kelley <sean.v.kelley@linux.intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d2345d12
    • Yicong Yang's avatar
      PCI/ASPM: Clear the correct bits when enabling L1 substates · a73afecb
      Yicong Yang authored
      commit 58a3862a upstream.
      
      In pcie_config_aspm_l1ss(), we cleared the wrong bits when enabling ASPM L1
      Substates.  Instead of the L1.x enable bits (PCI_L1SS_CTL1_L1SS_MASK, 0xf), we
      cleared the Link Activation Interrupt Enable bit (PCI_L1SS_CAP_L1_PM_SS,
      0x10).
      
      Clear the L1.x enable bits before writing the new L1.x configuration.
      
      [bhelgaas: changelog]
      Fixes: aeda9ade ("PCI/ASPM: Configure L1 substate settings")
      Link: https://lore.kernel.org/r/1584093227-1292-1-git-send-email-yangyicong@hisilicon.comSigned-off-by: default avatarYicong Yang <yangyicong@hisilicon.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      CC: stable@vger.kernel.org	# v4.11+
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a73afecb
    • Lukas Wunner's avatar
      PCI: pciehp: Fix indefinite wait on sysfs requests · 1ada617e
      Lukas Wunner authored
      commit 3e487d2e upstream.
      
      David Hoyer reports that powering pciehp slots up or down via sysfs may
      hang:  The call to wait_event() in pciehp_sysfs_enable_slot() and
      _disable_slot() does not return because ctrl->ist_running remains true.
      
      This flag, which was introduced by commit 157c1062 ("PCI: pciehp: Avoid
      returning prematurely from sysfs requests"), signifies that the IRQ thread
      pciehp_ist() is running.  It is set to true at the top of pciehp_ist() and
      reset to false at the end.  However there are two additional return
      statements in pciehp_ist() before which the commit neglected to reset the
      flag to false and wake up waiters for the flag.
      
      That omission opens up the following race when powering up the slot:
      
      * pciehp_ist() runs because a PCI_EXP_SLTSTA_PDC event was requested
        by pciehp_sysfs_enable_slot()
      
      * pciehp_ist() turns on slot power via the following call stack:
        pciehp_handle_presence_or_link_change() -> pciehp_enable_slot() ->
        __pciehp_enable_slot() -> board_added() -> pciehp_power_on_slot()
      
      * after slot power is turned on, the link comes up, resulting in a
        PCI_EXP_SLTSTA_DLLSC event
      
      * the IRQ handler pciehp_isr() stores the event in ctrl->pending_events
        and returns IRQ_WAKE_THREAD
      
      * the IRQ thread is already woken (it's bringing up the slot), but the
        genirq code remembers to re-run the IRQ thread after it has finished
        (such that it can deal with the new event) by setting IRQTF_RUNTHREAD
        via __handle_irq_event_percpu() -> __irq_wake_thread()
      
      * the IRQ thread removes PCI_EXP_SLTSTA_DLLSC from ctrl->pending_events
        via board_added() -> pciehp_check_link_status() in order to deal with
        presence and link flaps per commit 6c35a1ac ("PCI: pciehp:
        Tolerate initially unstable link")
      
      * after pciehp_ist() has successfully brought up the slot, it resets
        ctrl->ist_running to false and wakes up the sysfs requester
      
      * the genirq code re-runs pciehp_ist(), which sets ctrl->ist_running
        to true but then returns with IRQ_NONE because ctrl->pending_events
        is empty
      
      * pciehp_sysfs_enable_slot() is finally woken but notices that
        ctrl->ist_running is true, hence continues waiting
      
      The only way to get the hung task going again is to trigger a hotplug
      event which brings down the slot, e.g. by yanking out the card.
      
      The same race exists when powering down the slot because remove_board()
      likewise clears link or presence changes in ctrl->pending_events per commit
      3943af9d ("PCI: pciehp: Ignore Link State Changes after powering off a
      slot") and thereby may cause a re-run of pciehp_ist() which returns with
      IRQ_NONE without resetting ctrl->ist_running to false.
      
      Fix by adding a goto label before the teardown steps at the end of
      pciehp_ist() and jumping to that label from the two return statements which
      currently neglect to reset the ctrl->ist_running flag.
      
      Fixes: 157c1062 ("PCI: pciehp: Avoid returning prematurely from sysfs requests")
      Link: https://lore.kernel.org/r/cca1effa488065cb055120aa01b65719094bdcb5.1584530321.git.lukas@wunner.deReported-by: default avatarDavid Hoyer <David.Hoyer@netapp.com>
      Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarKeith Busch <kbusch@kernel.org>
      Cc: stable@vger.kernel.org	# v4.19+
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1ada617e
    • James Smart's avatar
      nvme: Treat discovery subsystems as unique subsystems · 011529b7
      James Smart authored
      commit c26aa572 upstream.
      
      Current code matches subnqn and collapses all controllers to the
      same subnqn to a single subsystem structure. This is good for
      recognizing multiple controllers for the same subsystem. But with
      the well-known discovery subnqn, the subsystems aren't truly the
      same subsystem. As such, subsystem specific rules, such as no
      overlap of controller id, do not apply. With today's behavior, the
      check for overlap of controller id can fail, preventing the new
      discovery controller from being created.
      
      When searching for like subsystem nqn, exclude the discovery nqn
      from matching. This will result in each discovery controller being
      attached to a unique subsystem structure.
      Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
      Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      011529b7
    • James Smart's avatar
      nvme-fc: Revert "add module to ops template to allow module references" · 287ea8b4
      James Smart authored
      commit 8c5c6605 upstream.
      
      The original patch was to resolve the lldd being able to be unloaded
      while being used to talk to the boot device of the system. However, the
      end result of the original patch is that any driver unload while a nvme
      controller is live via the lldd is now being prohibited. Given the module
      reference, the module teardown routine can't be called, thus there's no
      way, other than manual actions to terminate the controllers.
      
      Fixes: 863fbae9 ("nvme_fc: add module to ops template to allow module references")
      Cc: <stable@vger.kernel.org> # v5.4+
      Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
      Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      287ea8b4
    • Martin Blumenstingl's avatar
      thermal: devfreq_cooling: inline all stubs for CONFIG_DEVFREQ_THERMAL=n · 46cc8837
      Martin Blumenstingl authored
      commit 3f5b9959 upstream.
      
      When CONFIG_DEVFREQ_THERMAL is disabled all functions except
      of_devfreq_cooling_register_power() were already inlined. Also inline
      the last function to avoid compile errors when multiple drivers call
      of_devfreq_cooling_register_power() when CONFIG_DEVFREQ_THERMAL is not
      set. Compilation failed with the following message:
        multiple definition of `of_devfreq_cooling_register_power'
      (which then lists all usages of of_devfreq_cooling_register_power())
      
      Thomas Zimmermann reported this problem [0] on a kernel config with
      CONFIG_DRM_LIMA={m,y}, CONFIG_DRM_PANFROST={m,y} and
      CONFIG_DEVFREQ_THERMAL=n after both, the lima and panfrost drivers
      gained devfreq cooling support.
      
      [0] https://www.spinics.net/lists/dri-devel/msg252825.html
      
      Fixes: a76caf55 ("thermal: Add devfreq cooling")
      Cc: stable@vger.kernel.org
      Reported-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Tested-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Link: https://lore.kernel.org/r/20200403205133.1101808-1-martin.blumenstingl@googlemail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      46cc8837
    • Jan Engelhardt's avatar
      acpi/x86: ignore unspecified bit positions in the ACPI global lock field · d56a8ea4
      Jan Engelhardt authored
      commit ecb9c790 upstream.
      
      The value in "new" is constructed from "old" such that all bits defined
      as reserved by the ACPI spec[1] are left untouched. But if those bits
      do not happen to be all zero, "new < 3" will not evaluate to true.
      
      The firmware of the laptop(s) Medion MD63490 / Akoya P15648 comes with
      garbage inside the "FACS" ACPI table. The starting value is
      old=0x4944454d, therefore new=0x4944454e, which is >= 3. Mask off
      the reserved bits.
      
      [1] https://uefi.org/sites/default/files/resources/ACPI_6_2.pdf
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=206553
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: default avatarJan Engelhardt <jengelh@inai.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d56a8ea4
    • Benoit Parrot's avatar
      media: ti-vpe: cal: fix disable_irqs to only the intended target · 811a3f83
      Benoit Parrot authored
      commit 1db56284 upstream.
      
      disable_irqs() was mistakenly disabling all interrupts when called.
      This cause all port stream to stop even if only stopping one of them.
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarBenoit Parrot <bparrot@ti.com>
      Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      811a3f83
    • Takashi Iwai's avatar
      ALSA: hda/realtek - Add quirk for MSI GL63 · 2c3dab1b
      Takashi Iwai authored
      commit 1d3aa4a5 upstream.
      
      MSI GL63 laptop requires the similar quirk like other MSI models,
      ALC1220_FIXUP_CLEVO_P950.  The board BIOS doesn't provide a PCI SSID
      for the device, hence we need to take the codec SSID (1462:1275)
      instead.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207157
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200408135645.21896-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c3dab1b
    • Thomas Hebb's avatar
      ALSA: hda/realtek - Remove now-unnecessary XPS 13 headphone noise fixups · e71c369b
      Thomas Hebb authored
      commit f36938aa upstream.
      
      patch_realtek.c has historically failed to properly configure the PC
      Beep Hidden Register for the ALC256 codec (among others). Depending on
      your kernel version, symptoms of this misconfiguration can range from
      chassis noise, picked up by a poorly-shielded PCBEEP trace, getting
      amplified and played on your internal speaker and/or headphones to loud
      feedback, which responds to the "Headphone Mic Boost" ALSA control,
      getting played through your headphones. For details of the problem, see
      the patch in this series titled "ALSA: hda/realtek - Set principled PC
      Beep configuration for ALC256", which fixes the configuration.
      
      These symptoms have been most noticed on the Dell XPS 13 9350 and 9360,
      popular laptops that use the ALC256. As a result, several model-specific
      fixups have been introduced to try and fix the problem, the most
      egregious of which locks the "Headphone Mic Boost" control as a hack to
      minimize noise from a feedback loop that shouldn't have been there in
      the first place.
      
      Now that the underlying issue has been fixed, remove all these fixups.
      Remaining fixups needed by the XPS 13 are all picked up by existing pin
      quirks.
      
      This change should, for the XPS 13 9350/9360
      
       - Significantly increase volume and audio quality on headphones
       - Eliminate headphone popping on suspend/resume
       - Allow "Headphone Mic Boost" to be set again, making the headphone
         jack fully usable as a microphone jack too.
      
      Fixes: 8c69729b ("ALSA: hda - Fix headphone noise after Dell XPS 13 resume back from S3")
      Fixes: 423cd785 ("ALSA: hda - Fix headphone noise on Dell XPS 13 9360")
      Fixes: e4c9fd10 ("ALSA: hda - Apply headphone noise quirk for another Dell XPS 13 variant")
      Fixes: 1099f484 ("ALSA: hda/realtek: Reduce the Headphone static noise on XPS 9350/9360")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
      Link: https://lore.kernel.org/r/b649a00edfde150cf6eebbb4390e15e0c2deb39a.1585584498.git.tommyhebb@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e71c369b
    • Thomas Hebb's avatar
      ALSA: hda/realtek - Set principled PC Beep configuration for ALC256 · 92b27256
      Thomas Hebb authored
      commit c4473744 upstream.
      
      The Realtek PC Beep Hidden Register[1] is currently set by
      patch_realtek.c in two different places:
      
      In alc_fill_eapd_coef(), it's set to the value 0x5757, corresponding to
      non-beep input on 1Ah and no 1Ah loopback to either headphones or
      speakers. (Although, curiously, the loopback amp is still enabled.) This
      write was added fairly recently by commit e3743f431143 ("ALSA:
      hda/realtek - Dell headphone has noise on unmute for ALC236") and is a
      safe default. However, it happens in the wrong place:
      alc_fill_eapd_coef() runs on module load and cold boot but not on S3
      resume, meaning the register loses its value after suspend.
      
      Conversely, in alc256_init(), the register is updated to unset bit 13
      (disable speaker loopback) and set bit 5 (set non-beep input on 1Ah).
      Although this write does run on S3 resume, it's not quite enough to fix
      up the register's default value of 0x3717. What's missing is a set of
      bit 14 to disable headphone loopback. Without that, we end up with a
      feedback loop where the headphone jack is being driven by amplified
      samples of itself[2].
      
      This change eliminates the update in alc256_init() and replaces it with
      the 0x5757 write from alc_fill_eapd_coef(). Kailang says that 0x5757 is
      supposed to be the codec's default value, so using it will make
      debugging easier for Realtek.
      
      Affects the ALC255, ALC256, ALC257, ALC235, and ALC236 codecs.
      
      [1] Newly documented in Documentation/sound/hd-audio/realtek-pc-beep.rst
      
      [2] Setting the "Headphone Mic Boost" control from userspace changes
      this feedback loop and has been a widely-shared workaround for headphone
      noise on laptops like the Dell XPS 13 9350. This commit eliminates the
      feedback loop and makes the workaround unnecessary.
      
      Fixes: e1e8c1fd ("ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
      Link: https://lore.kernel.org/r/bf22b417d1f2474b12011c2a39ed6cf8b06d3bf5.1585584498.git.tommyhebb@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      92b27256
    • Thomas Hebb's avatar
      ALSA: doc: Document PC Beep Hidden Register on Realtek ALC256 · 7cb3c198
      Thomas Hebb authored
      commit f1280904 upstream.
      
      This codec (among others) has a hidden set of audio routes, apparently
      designed to allow PC Beep output without a mixer widget on the output
      path, which are controlled by an undocumented Realtek vendor register.
      The default configuration of these routes means that certain inputs
      aren't accessible, necessitating driver control of the register.
      However, Realtek has provided no documentation of the register, instead
      opting to fix issues by providing magic numbers, most of which have been
      at least somewhat erroneous. These magic numbers then get copied by
      others into model-specific fixups, leading to a fragmented and buggy set
      of configurations.
      
      To get out of this situation, I've reverse engineered the register by
      flipping bits and observing how the codec's behavior changes. This
      commit documents my findings. It does not change any code.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
      Link: https://lore.kernel.org/r/bd69dfdeaf40ff31c4b7b797c829bb320031739c.1585584498.git.tommyhebb@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7cb3c198
    • Takashi Iwai's avatar
      ALSA: pcm: oss: Fix regression by buffer overflow fix · 44cc7494
      Takashi Iwai authored
      commit ae769d35 upstream.
      
      The recent fix for the OOB access in PCM OSS plugins (commit
      f2ecf903: "ALSA: pcm: oss: Avoid plugin buffer overflow") caused a
      regression on OSS applications.  The patch introduced the size check
      in client and slave size calculations to limit to each plugin's buffer
      size, but I overlooked that some code paths call those without
      allocating the buffer but just for estimation.
      
      This patch fixes the bug by skipping the size check for those code
      paths while keeping checking in the actual transfer calls.
      
      Fixes: f2ecf903 ("ALSA: pcm: oss: Avoid plugin buffer overflow")
      Tested-and-reported-by: default avatarJari Ruusu <jari.ruusu@gmail.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200403072515.25539-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      44cc7494
    • Takashi Iwai's avatar
      ALSA: ice1724: Fix invalid access for enumerated ctl items · 8e682089
      Takashi Iwai authored
      commit c47914c0 upstream.
      
      The access to Analog Capture Source control value implemented in
      prodigy_hifi.c is wrong, as caught by the recently introduced sanity
      check; it should be accessing value.enumerated.item[] instead of
      value.integer.value[].  This patch corrects the wrong access pattern.
      
      Fixes: 6b8d6e55 ("[ALSA] ICE1724: Added support for Audiotrak Prodigy 7.1 HiFi & HD2, Hercules Fortissimo IV")
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207139Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200407084402.25589-3-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e682089
    • Takashi Iwai's avatar
      ALSA: hda: Fix potential access overflow in beep helper · b01126ec
      Takashi Iwai authored
      commit 0ad3f0b3 upstream.
      
      The beep control helper function blindly stores the values in two
      stereo channels no matter whether the actual control is mono or
      stereo.  This is practically harmless, but it annoys the recently
      introduced sanity check, resulting in an error when the checker is
      enabled.
      
      This patch corrects the behavior to store only on the defined array
      member.
      
      Fixes: 0401e854 ("ALSA: hda - Move beep helper functions to hda_beep.c")
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207139Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200407084402.25589-2-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b01126ec
    • Takashi Iwai's avatar
      ALSA: hda: Add driver blacklist · d1fea655
      Takashi Iwai authored
      commit 3c6fd1f0 upstream.
      
      The recent AMD platform exposes an HD-audio bus but without any actual
      codecs, which is internally tied with a USB-audio device, supposedly.
      It results in "no codecs" error of HD-audio bus driver, and it's
      nothing but a waste of resources.
      
      This patch introduces a static blacklist table for skipping such a
      known bogus PCI SSID entry.  As of writing this patch, the known SSIDs
      are:
      * 1043:874f - ASUS ROG Zenith II / Strix
      * 1462:cb59 - MSI TRX40 Creator
      * 1462:cb60 - MSI TRX40
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206543
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200408140449.22319-2-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d1fea655
    • Takashi Iwai's avatar
      ALSA: usb-audio: Add mixer workaround for TRX40 and co · 2754914b
      Takashi Iwai authored
      commit 2a48218f upstream.
      
      Some recent boards (supposedly with a new AMD platform) contain the
      USB audio class 2 device that is often tied with HD-audio.  The device
      exposes an Input Gain Pad control (id=19, control=12) but this node
      doesn't behave correctly, returning an error for each inquiry of
      GET_MIN and GET_MAX that should have been mandatory.
      
      As a workaround, simply ignore this node by adding a usbmix_name_map
      table entry.  The currently known devices are:
      * 0414:a002 - Gigabyte TRX40 Aorus Pro WiFi
      * 0b05:1916 - ASUS ROG Zenith II
      * 0b05:1917 - ASUS ROG Strix
      * 0db0:0d64 - MSI TRX40 Creator
      * 0db0:543d - MSI TRX40
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206543
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200408140449.22319-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2754914b
    • Thinh Nguyen's avatar
      usb: gadget: composite: Inform controller driver of self-powered · 62769157
      Thinh Nguyen authored
      commit 5e5caf4f upstream.
      
      Different configuration/condition may draw different power. Inform the
      controller driver of the change so it can respond properly (e.g.
      GET_STATUS request). This fixes an issue with setting MaxPower from
      configfs. The composite driver doesn't check this value when setting
      self-powered.
      
      Cc: stable@vger.kernel.org
      Fixes: 88af8bbe ("usb: gadget: the start of the configfs interface")
      Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      62769157
    • Sriharsha Allenki's avatar
      usb: gadget: f_fs: Fix use after free issue as part of queue failure · 2ad53606
      Sriharsha Allenki authored
      commit f63ec55f upstream.
      
      In AIO case, the request is freed up if ep_queue fails.
      However, io_data->req still has the reference to this freed
      request. In the case of this failure if there is aio_cancel
      call on this io_data it will lead to an invalid dequeue
      operation and a potential use after free issue.
      Fix this by setting the io_data->req to NULL when the request
      is freed as part of queue failure.
      
      Fixes: 2e4c7553 ("usb: gadget: f_fs: add aio support")
      Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
      CC: stable <stable@vger.kernel.org>
      Reviewed-by: default avatarPeter Chen <peter.chen@nxp.com>
      Link: https://lore.kernel.org/r/20200326115620.12571-1-sallenki@codeaurora.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ad53606
    • 이경택's avatar
      ASoC: topology: use name_prefix for new kcontrol · 10848d3c
      이경택 authored
      commit abca9e4a upstream.
      
      Current topology doesn't add prefix of component to new kcontrol.
      Signed-off-by: default avatarGyeongtaek Lee <gt82.lee@samsung.com>
      Link: https://lore.kernel.org/r/009b01d60804$ae25c2d0$0a714870$@samsung.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      10848d3c
    • 이경택's avatar
      ASoC: dpcm: allow start or stop during pause for backend · e1093a17
      이경택 authored
      commit 21fca8bd upstream.
      
      soc_compr_trigger_fe() allows start or stop after pause_push.
      In dpcm_be_dai_trigger(), however, only pause_release is allowed
      command after pause_push.
      So, start or stop after pause in compress offload is always
      returned as error if the compress offload is used with dpcm.
      To fix the problem, SND_SOC_DPCM_STATE_PAUSED should be allowed
      for start or stop command.
      Signed-off-by: default avatarGyeongtaek Lee <gt82.lee@samsung.com>
      Reviewed-by: default avatarVinod Koul <vkoul@kernel.org>
      Link: https://lore.kernel.org/r/004d01d607c1$7a3d5250$6eb7f6f0$@samsung.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e1093a17
    • 이경택's avatar
      ASoC: dapm: connect virtual mux with default value · 0185a432
      이경택 authored
      commit 3bbbb772 upstream.
      
      Since a virtual mixer has no backing registers
      to decide which path to connect,
      it will try to match with initial state.
      This is to ensure that the default mixer choice will be
      correctly powered up during initialization.
      Invert flag is used to select initial state of the virtual switch.
      Since actual hardware can't be disconnected by virtual switch,
      connected is better choice as initial state in many cases.
      Signed-off-by: default avatarGyeongtaek Lee <gt82.lee@samsung.com>
      Link: https://lore.kernel.org/r/01a301d60731$b724ea10$256ebe30$@samsung.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0185a432
    • 이경택's avatar
      ASoC: fix regwmask · 66f493d9
      이경택 authored
      commit 0ab07091 upstream.
      
      If regwshift is 32 and the selected architecture compiles '<<' operator
      for signed int literal into rotating shift, '1<<regwshift' became 1 and
      it makes regwmask to 0x0.
      The literal is set to unsigned long to get intended regwmask.
      Signed-off-by: default avatarGyeongtaek Lee <gt82.lee@samsung.com>
      Link: https://lore.kernel.org/r/001001d60665$db7af3e0$9270dba0$@samsung.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      66f493d9
    • Kees Cook's avatar
      slub: improve bit diffusion for freelist ptr obfuscation · 9ee0e501
      Kees Cook authored
      commit 1ad53d9f upstream.
      
      Under CONFIG_SLAB_FREELIST_HARDENED=y, the obfuscation was relatively weak
      in that the ptr and ptr address were usually so close that the first XOR
      would result in an almost entirely 0-byte value[1], leaving most of the
      "secret" number ultimately being stored after the third XOR.  A single
      blind memory content exposure of the freelist was generally sufficient to
      learn the secret.
      
      Add a swab() call to mix bits a little more.  This is a cheap way (1
      cycle) to make attacks need more than a single exposure to learn the
      secret (or to know _where_ the exposure is in memory).
      
      kmalloc-32 freelist walk, before:
      
      ptr              ptr_addr            stored value      secret
      ffff90c22e019020@ffff90c22e019000 is 86528eb656b3b5bd (86528eb656b3b59d)
      ffff90c22e019040@ffff90c22e019020 is 86528eb656b3b5fd (86528eb656b3b59d)
      ffff90c22e019060@ffff90c22e019040 is 86528eb656b3b5bd (86528eb656b3b59d)
      ffff90c22e019080@ffff90c22e019060 is 86528eb656b3b57d (86528eb656b3b59d)
      ffff90c22e0190a0@ffff90c22e019080 is 86528eb656b3b5bd (86528eb656b3b59d)
      ...
      
      after:
      
      ptr              ptr_addr            stored value      secret
      ffff9eed6e019020@ffff9eed6e019000 is 793d1135d52cda42 (86528eb656b3b59d)
      ffff9eed6e019040@ffff9eed6e019020 is 593d1135d52cda22 (86528eb656b3b59d)
      ffff9eed6e019060@ffff9eed6e019040 is 393d1135d52cda02 (86528eb656b3b59d)
      ffff9eed6e019080@ffff9eed6e019060 is 193d1135d52cdae2 (86528eb656b3b59d)
      ffff9eed6e0190a0@ffff9eed6e019080 is f93d1135d52cdac2 (86528eb656b3b59d)
      
      [1] https://blog.infosectcbr.com.au/2020/03/weaknesses-in-linux-kernel-heap.html
      
      Fixes: 2482ddec ("mm: add SLUB free list pointer obfuscation")
      Reported-by: default avatarSilvio Cesare <silvio.cesare@gmail.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/202003051623.AF4F8CB@keescookSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      [kees: Backport to v4.19 which doesn't call kasan_reset_untag()]
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9ee0e501
    • Yury Norov's avatar
      uapi: rename ext2_swab() to swab() and share globally in swab.h · 9af535dc
      Yury Norov authored
      [ Upstream commit d5767057 ]
      
      ext2_swab() is defined locally in lib/find_bit.c However it is not
      specific to ext2, neither to bitmaps.
      
      There are many potential users of it, so rename it to just swab() and
      move to include/uapi/linux/swab.h
      
      ABI guarantees that size of unsigned long corresponds to BITS_PER_LONG,
      therefore drop unneeded cast.
      
      Link: http://lkml.kernel.org/r/20200103202846.21616-1-yury.norov@gmail.comSigned-off-by: default avatarYury Norov <yury.norov@gmail.com>
      Cc: Allison Randal <allison@lohutok.net>
      Cc: Joe Perches <joe@perches.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: William Breathitt Gray <vilhelm.gray@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9af535dc
    • Alex Vesker's avatar
      IB/mlx5: Replace tunnel mpls capability bits for tunnel_offloads · dce1622d
      Alex Vesker authored
      [ Upstream commit 41e684ef ]
      
      Until now the flex parser capability was used in ib_query_device() to
      indicate tunnel_offloads_caps support for mpls_over_gre/mpls_over_udp.
      
      Newer devices and firmware will have configurations with the flexparser
      but without mpls support.
      
      Testing for the flex parser capability was a mistake, the tunnel_stateless
      capability was intended for detecting mpls and was introduced at the same
      time as the flex parser capability.
      
      Otherwise userspace will be incorrectly informed that a future device
      supports MPLS when it does not.
      
      Link: https://lore.kernel.org/r/20200305123841.196086-1-leon@kernel.org
      Cc: <stable@vger.kernel.org> # 4.17
      Fixes: e818e255 ("IB/mlx5: Expose MPLS related tunneling offloads")
      Signed-off-by: default avatarAlex Vesker <valex@mellanox.com>
      Reviewed-by: default avatarAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      dce1622d
    • Josef Bacik's avatar
      btrfs: track reloc roots based on their commit root bytenr · 32fb859e
      Josef Bacik authored
      [ Upstream commit ea287ab1 ]
      
      We always search the commit root of the extent tree for looking up back
      references, however we track the reloc roots based on their current
      bytenr.
      
      This is wrong, if we commit the transaction between relocating tree
      blocks we could end up in this code in build_backref_tree
      
        if (key.objectid == key.offset) {
      	  /*
      	   * Only root blocks of reloc trees use backref
      	   * pointing to itself.
      	   */
      	  root = find_reloc_root(rc, cur->bytenr);
      	  ASSERT(root);
      	  cur->root = root;
      	  break;
        }
      
      find_reloc_root() is looking based on the bytenr we had in the commit
      root, but if we've COWed this reloc root we will not find that bytenr,
      and we will trip over the ASSERT(root).
      
      Fix this by using the commit_root->start bytenr for indexing the commit
      root.  Then we change the __update_reloc_root() caller to be used when
      we switch the commit root for the reloc root during commit.
      
      This fixes the panic I was seeing when we started throttling relocation
      for delayed refs.
      Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      32fb859e
    • Josef Bacik's avatar
      btrfs: remove a BUG_ON() from merge_reloc_roots() · 7d0ef631
      Josef Bacik authored
      [ Upstream commit 7b7b7431 ]
      
      This was pretty subtle, we default to reloc roots having 0 root refs, so
      if we crash in the middle of the relocation they can just be deleted.
      If we successfully complete the relocation operations we'll set our root
      refs to 1 in prepare_to_merge() and then go on to merge_reloc_roots().
      
      At prepare_to_merge() time if any of the reloc roots have a 0 reference
      still, we will remove that reloc root from our reloc root rb tree, and
      then clean it up later.
      
      However this only happens if we successfully start a transaction.  If
      we've aborted previously we will skip this step completely, and only
      have reloc roots with a reference count of 0, but were never properly
      removed from the reloc control's rb tree.
      
      This isn't a problem per-se, our references are held by the list the
      reloc roots are on, and by the original root the reloc root belongs to.
      If we end up in this situation all the reloc roots will be added to the
      dirty_reloc_list, and then properly dropped at that point.  The reloc
      control will be free'd and the rb tree is no longer used.
      
      There were two options when fixing this, one was to remove the BUG_ON(),
      the other was to make prepare_to_merge() handle the case where we
      couldn't start a trans handle.
      
      IMO this is the cleaner solution.  I started with handling the error in
      prepare_to_merge(), but it turned out super ugly.  And in the end this
      BUG_ON() simply doesn't matter, the cleanup was happening properly, we
      were just panicing because this BUG_ON() only matters in the success
      case.  So I've opted to just remove it and add a comment where it was.
      Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
      Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      7d0ef631
    • Qu Wenruo's avatar
      btrfs: qgroup: ensure qgroup_rescan_running is only set when the worker is at least queued · b8ab26fd
      Qu Wenruo authored
      [ Upstream commit d61acbbf ]
      
      [BUG]
      There are some reports about btrfs wait forever to unmount itself, with
      the following call trace:
      
        INFO: task umount:4631 blocked for more than 491 seconds.
              Tainted: G               X  5.3.8-2-default #1
        "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
        umount          D    0  4631   3337 0x00000000
        Call Trace:
        ([<00000000174adf7a>] __schedule+0x342/0x748)
         [<00000000174ae3ca>] schedule+0x4a/0xd8
         [<00000000174b1f08>] schedule_timeout+0x218/0x420
         [<00000000174af10c>] wait_for_common+0x104/0x1d8
         [<000003ff804d6994>] btrfs_qgroup_wait_for_completion+0x84/0xb0 [btrfs]
         [<000003ff8044a616>] close_ctree+0x4e/0x380 [btrfs]
         [<0000000016fa3136>] generic_shutdown_super+0x8e/0x158
         [<0000000016fa34d6>] kill_anon_super+0x26/0x40
         [<000003ff8041ba88>] btrfs_kill_super+0x28/0xc8 [btrfs]
         [<0000000016fa39f8>] deactivate_locked_super+0x68/0x98
         [<0000000016fcb198>] cleanup_mnt+0xc0/0x140
         [<0000000016d6a846>] task_work_run+0xc6/0x110
         [<0000000016d04f76>] do_notify_resume+0xae/0xb8
         [<00000000174b30ae>] system_call+0xe2/0x2c8
      
      [CAUSE]
      The problem happens when we have called qgroup_rescan_init(), but
      not queued the worker. It can be caused mostly by error handling.
      
      	Qgroup ioctl thread		|	Unmount thread
      ----------------------------------------+-----------------------------------
      					|
      btrfs_qgroup_rescan()			|
      |- qgroup_rescan_init()			|
      |  |- qgroup_rescan_running = true;	|
      |					|
      |- trans = btrfs_join_transaction()	|
      |  Some error happened			|
      |					|
      |- btrfs_qgroup_rescan() returns error	|
         But qgroup_rescan_running == true;	|
      					| close_ctree()
      					| |- btrfs_qgroup_wait_for_completion()
      					|    |- running == true;
      					|    |- wait_for_completion();
      
      btrfs_qgroup_rescan_worker is never queued, thus no one is going to wake
      up close_ctree() and we get a deadlock.
      
      All involved qgroup_rescan_init() callers are:
      
      - btrfs_qgroup_rescan()
        The example above. It's possible to trigger the deadlock when error
        happened.
      
      - btrfs_quota_enable()
        Not possible. Just after qgroup_rescan_init() we queue the work.
      
      - btrfs_read_qgroup_config()
        It's possible to trigger the deadlock. It only init the work, the
        work queueing happens in btrfs_qgroup_rescan_resume().
        Thus if error happened in between, deadlock is possible.
      
      We shouldn't set fs_info->qgroup_rescan_running just in
      qgroup_rescan_init(), as at that stage we haven't yet queued qgroup
      rescan worker to run.
      
      [FIX]
      Set qgroup_rescan_running before queueing the work, so that we ensure
      the rescan work is queued when we wait for it.
      
      Fixes: 8d9eddad ("Btrfs: fix qgroup rescan worker initialization")
      Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
      [ Change subject and cause analyse, use a smaller fix ]
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b8ab26fd
    • Zhiqiang Liu's avatar
      block, bfq: fix use-after-free in bfq_idle_slice_timer_body · d999063b
      Zhiqiang Liu authored
      [ Upstream commit 2f95fa5c ]
      
      In bfq_idle_slice_timer func, bfqq = bfqd->in_service_queue is
      not in bfqd-lock critical section. The bfqq, which is not
      equal to NULL in bfq_idle_slice_timer, may be freed after passing
      to bfq_idle_slice_timer_body. So we will access the freed memory.
      
      In addition, considering the bfqq may be in race, we should
      firstly check whether bfqq is in service before doing something
      on it in bfq_idle_slice_timer_body func. If the bfqq in race is
      not in service, it means the bfqq has been expired through
      __bfq_bfqq_expire func, and wait_request flags has been cleared in
      __bfq_bfqd_reset_in_service func. So we do not need to re-clear the
      wait_request of bfqq which is not in service.
      
      KASAN log is given as follows:
      [13058.354613] ==================================================================
      [13058.354640] BUG: KASAN: use-after-free in bfq_idle_slice_timer+0xac/0x290
      [13058.354644] Read of size 8 at addr ffffa02cf3e63f78 by task fork13/19767
      [13058.354646]
      [13058.354655] CPU: 96 PID: 19767 Comm: fork13
      [13058.354661] Call trace:
      [13058.354667]  dump_backtrace+0x0/0x310
      [13058.354672]  show_stack+0x28/0x38
      [13058.354681]  dump_stack+0xd8/0x108
      [13058.354687]  print_address_description+0x68/0x2d0
      [13058.354690]  kasan_report+0x124/0x2e0
      [13058.354697]  __asan_load8+0x88/0xb0
      [13058.354702]  bfq_idle_slice_timer+0xac/0x290
      [13058.354707]  __hrtimer_run_queues+0x298/0x8b8
      [13058.354710]  hrtimer_interrupt+0x1b8/0x678
      [13058.354716]  arch_timer_handler_phys+0x4c/0x78
      [13058.354722]  handle_percpu_devid_irq+0xf0/0x558
      [13058.354731]  generic_handle_irq+0x50/0x70
      [13058.354735]  __handle_domain_irq+0x94/0x110
      [13058.354739]  gic_handle_irq+0x8c/0x1b0
      [13058.354742]  el1_irq+0xb8/0x140
      [13058.354748]  do_wp_page+0x260/0xe28
      [13058.354752]  __handle_mm_fault+0x8ec/0x9b0
      [13058.354756]  handle_mm_fault+0x280/0x460
      [13058.354762]  do_page_fault+0x3ec/0x890
      [13058.354765]  do_mem_abort+0xc0/0x1b0
      [13058.354768]  el0_da+0x24/0x28
      [13058.354770]
      [13058.354773] Allocated by task 19731:
      [13058.354780]  kasan_kmalloc+0xe0/0x190
      [13058.354784]  kasan_slab_alloc+0x14/0x20
      [13058.354788]  kmem_cache_alloc_node+0x130/0x440
      [13058.354793]  bfq_get_queue+0x138/0x858
      [13058.354797]  bfq_get_bfqq_handle_split+0xd4/0x328
      [13058.354801]  bfq_init_rq+0x1f4/0x1180
      [13058.354806]  bfq_insert_requests+0x264/0x1c98
      [13058.354811]  blk_mq_sched_insert_requests+0x1c4/0x488
      [13058.354818]  blk_mq_flush_plug_list+0x2d4/0x6e0
      [13058.354826]  blk_flush_plug_list+0x230/0x548
      [13058.354830]  blk_finish_plug+0x60/0x80
      [13058.354838]  read_pages+0xec/0x2c0
      [13058.354842]  __do_page_cache_readahead+0x374/0x438
      [13058.354846]  ondemand_readahead+0x24c/0x6b0
      [13058.354851]  page_cache_sync_readahead+0x17c/0x2f8
      [13058.354858]  generic_file_buffered_read+0x588/0xc58
      [13058.354862]  generic_file_read_iter+0x1b4/0x278
      [13058.354965]  ext4_file_read_iter+0xa8/0x1d8 [ext4]
      [13058.354972]  __vfs_read+0x238/0x320
      [13058.354976]  vfs_read+0xbc/0x1c0
      [13058.354980]  ksys_read+0xdc/0x1b8
      [13058.354984]  __arm64_sys_read+0x50/0x60
      [13058.354990]  el0_svc_common+0xb4/0x1d8
      [13058.354994]  el0_svc_handler+0x50/0xa8
      [13058.354998]  el0_svc+0x8/0xc
      [13058.354999]
      [13058.355001] Freed by task 19731:
      [13058.355007]  __kasan_slab_free+0x120/0x228
      [13058.355010]  kasan_slab_free+0x10/0x18
      [13058.355014]  kmem_cache_free+0x288/0x3f0
      [13058.355018]  bfq_put_queue+0x134/0x208
      [13058.355022]  bfq_exit_icq_bfqq+0x164/0x348
      [13058.355026]  bfq_exit_icq+0x28/0x40
      [13058.355030]  ioc_exit_icq+0xa0/0x150
      [13058.355035]  put_io_context_active+0x250/0x438
      [13058.355038]  exit_io_context+0xd0/0x138
      [13058.355045]  do_exit+0x734/0xc58
      [13058.355050]  do_group_exit+0x78/0x220
      [13058.355054]  __wake_up_parent+0x0/0x50
      [13058.355058]  el0_svc_common+0xb4/0x1d8
      [13058.355062]  el0_svc_handler+0x50/0xa8
      [13058.355066]  el0_svc+0x8/0xc
      [13058.355067]
      [13058.355071] The buggy address belongs to the object at ffffa02cf3e63e70#012 which belongs to the cache bfq_queue of size 464
      [13058.355075] The buggy address is located 264 bytes inside of#012 464-byte region [ffffa02cf3e63e70, ffffa02cf3e64040)
      [13058.355077] The buggy address belongs to the page:
      [13058.355083] page:ffff7e80b3cf9800 count:1 mapcount:0 mapping:ffff802db5c90780 index:0xffffa02cf3e606f0 compound_mapcount: 0
      [13058.366175] flags: 0x2ffffe0000008100(slab|head)
      [13058.370781] raw: 2ffffe0000008100 ffff7e80b53b1408 ffffa02d730c1c90 ffff802db5c90780
      [13058.370787] raw: ffffa02cf3e606f0 0000000000370023 00000001ffffffff 0000000000000000
      [13058.370789] page dumped because: kasan: bad access detected
      [13058.370791]
      [13058.370792] Memory state around the buggy address:
      [13058.370797]  ffffa02cf3e63e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fb fb
      [13058.370801]  ffffa02cf3e63e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [13058.370805] >ffffa02cf3e63f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [13058.370808]                                                                 ^
      [13058.370811]  ffffa02cf3e63f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [13058.370815]  ffffa02cf3e64000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
      [13058.370817] ==================================================================
      [13058.370820] Disabling lock debugging due to kernel taint
      
      Here, we directly pass the bfqd to bfq_idle_slice_timer_body func.
      --
      V2->V3: rewrite the comment as suggested by Paolo Valente
      V1->V2: add one comment, and add Fixes and Reported-by tag.
      
      Fixes: aee69d78 ("block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler")
      Acked-by: default avatarPaolo Valente <paolo.valente@linaro.org>
      Reported-by: default avatarWang Wang <wangwang2@huawei.com>
      Signed-off-by: default avatarZhiqiang Liu <liuzhiqiang26@huawei.com>
      Signed-off-by: default avatarFeilong Lin <linfeilong@huawei.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      d999063b
    • Boqun Feng's avatar
      locking/lockdep: Avoid recursion in lockdep_count_{for,back}ward_deps() · c6090fe7
      Boqun Feng authored
      [ Upstream commit 25016bd7 ]
      
      Qian Cai reported a bug when PROVE_RCU_LIST=y, and read on /proc/lockdep
      triggered a warning:
      
        [ ] DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled)
        ...
        [ ] Call Trace:
        [ ]  lock_is_held_type+0x5d/0x150
        [ ]  ? rcu_lockdep_current_cpu_online+0x64/0x80
        [ ]  rcu_read_lock_any_held+0xac/0x100
        [ ]  ? rcu_read_lock_held+0xc0/0xc0
        [ ]  ? __slab_free+0x421/0x540
        [ ]  ? kasan_kmalloc+0x9/0x10
        [ ]  ? __kmalloc_node+0x1d7/0x320
        [ ]  ? kvmalloc_node+0x6f/0x80
        [ ]  __bfs+0x28a/0x3c0
        [ ]  ? class_equal+0x30/0x30
        [ ]  lockdep_count_forward_deps+0x11a/0x1a0
      
      The warning got triggered because lockdep_count_forward_deps() call
      __bfs() without current->lockdep_recursion being set, as a result
      a lockdep internal function (__bfs()) is checked by lockdep, which is
      unexpected, and the inconsistency between the irq-off state and the
      state traced by lockdep caused the warning.
      
      Apart from this warning, lockdep internal functions like __bfs() should
      always be protected by current->lockdep_recursion to avoid potential
      deadlocks and data inconsistency, therefore add the
      current->lockdep_recursion on-and-off section to protect __bfs() in both
      lockdep_count_forward_deps() and lockdep_count_backward_deps()
      Reported-by: default avatarQian Cai <cai@lca.pw>
      Signed-off-by: default avatarBoqun Feng <boqun.feng@gmail.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: https://lkml.kernel.org/r/20200312151258.128036-1-boqun.feng@gmail.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      c6090fe7
    • Junyong Sun's avatar
      firmware: fix a double abort case with fw_load_sysfs_fallback · 1a5613b5
      Junyong Sun authored
      [ Upstream commit bcfbd352 ]
      
      fw_sysfs_wait_timeout may return err with -ENOENT
      at fw_load_sysfs_fallback and firmware is already
      in abort status, no need to abort again, so skip it.
      
      This issue is caused by concurrent situation like below:
      when thread 1# wait firmware loading, thread 2# may write
      -1 to abort loading and wakeup thread 1# before it timeout.
      so wait_for_completion_killable_timeout of thread 1# would
      return remaining time which is != 0 with fw_st->status
      FW_STATUS_ABORTED.And the results would be converted into
      err -ENOENT in __fw_state_wait_common and transfered to
      fw_load_sysfs_fallback in thread 1#.
      The -ENOENT means firmware status is already at ABORTED,
      so fw_load_sysfs_fallback no need to get mutex to abort again.
      -----------------------------
      thread 1#,wait for loading
      fw_load_sysfs_fallback
       ->fw_sysfs_wait_timeout
          ->__fw_state_wait_common
             ->wait_for_completion_killable_timeout
      
      in __fw_state_wait_common,
      ...
      93    ret = wait_for_completion_killable_timeout(&fw_st->completion, timeout);
      94    if (ret != 0 && fw_st->status == FW_STATUS_ABORTED)
      95       return -ENOENT;
      96    if (!ret)
      97	 return -ETIMEDOUT;
      98
      99    return ret < 0 ? ret : 0;
      -----------------------------
      thread 2#, write -1 to abort loading
      firmware_loading_store
       ->fw_load_abort
         ->__fw_load_abort
           ->fw_state_aborted
             ->__fw_state_set
               ->complete_all
      
      in __fw_state_set,
      ...
      111    if (status == FW_STATUS_DONE || status == FW_STATUS_ABORTED)
      112       complete_all(&fw_st->completion);
      -------------------------------------------
      BTW,the double abort issue would not cause kernel panic or create an issue,
      but slow down it sometimes.The change is just a minor optimization.
      Signed-off-by: default avatarJunyong Sun <sunjunyong@xiaomi.com>
      Acked-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Link: https://lore.kernel.org/r/1583202968-28792-1-git-send-email-sunjunyong@xiaomi.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      1a5613b5
    • Guoqing Jiang's avatar
      md: check arrays is suspended in mddev_detach before call quiesce operations · 41778458
      Guoqing Jiang authored
      [ Upstream commit 6b40bec3 ]
      
      Don't call quiesce(1) and quiesce(0) if array is already suspended,
      otherwise in level_store, the array is writable after mddev_detach
      in below part though the intention is to make array writable after
      resume.
      
      	mddev_suspend(mddev);
      	mddev_detach(mddev);
      	...
      	mddev_resume(mddev);
      
      And it also causes calltrace as follows in [1].
      
      [48005.653834] WARNING: CPU: 1 PID: 45380 at kernel/kthread.c:510 kthread_park+0x77/0x90
      [...]
      [48005.653976] CPU: 1 PID: 45380 Comm: mdadm Tainted: G           OE     5.4.10-arch1-1 #1
      [48005.653979] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4105-ITX, BIOS P1.40 08/06/2018
      [48005.653984] RIP: 0010:kthread_park+0x77/0x90
      [48005.654015] Call Trace:
      [48005.654039]  r5l_quiesce+0x3c/0x70 [raid456]
      [48005.654052]  raid5_quiesce+0x228/0x2e0 [raid456]
      [48005.654073]  mddev_detach+0x30/0x70 [md_mod]
      [48005.654090]  level_store+0x202/0x670 [md_mod]
      [48005.654099]  ? security_capable+0x40/0x60
      [48005.654114]  md_attr_store+0x7b/0xc0 [md_mod]
      [48005.654123]  kernfs_fop_write+0xce/0x1b0
      [48005.654132]  vfs_write+0xb6/0x1a0
      [48005.654138]  ksys_write+0x67/0xe0
      [48005.654146]  do_syscall_64+0x4e/0x140
      [48005.654155]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [48005.654161] RIP: 0033:0x7fa0c8737497
      
      [1]: https://bugzilla.kernel.org/show_bug.cgi?id=206161Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      41778458
    • Marc Zyngier's avatar
      irqchip/gic-v4: Provide irq_retrigger to avoid circular locking dependency · 702f64bc
      Marc Zyngier authored
      [ Upstream commit 7809f701 ]
      
      On a very heavily loaded D05 with GICv4, I managed to trigger the
      following lockdep splat:
      
      [ 6022.598864] ======================================================
      [ 6022.605031] WARNING: possible circular locking dependency detected
      [ 6022.611200] 5.6.0-rc4-00026-geee7c7b0f498 #680 Tainted: G            E
      [ 6022.618061] ------------------------------------------------------
      [ 6022.624227] qemu-system-aar/7569 is trying to acquire lock:
      [ 6022.629789] ffff042f97606808 (&p->pi_lock){-.-.}, at: try_to_wake_up+0x54/0x7a0
      [ 6022.637102]
      [ 6022.637102] but task is already holding lock:
      [ 6022.642921] ffff002fae424cf0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x5c/0x98
      [ 6022.651350]
      [ 6022.651350] which lock already depends on the new lock.
      [ 6022.651350]
      [ 6022.659512]
      [ 6022.659512] the existing dependency chain (in reverse order) is:
      [ 6022.666980]
      [ 6022.666980] -> #2 (&irq_desc_lock_class){-.-.}:
      [ 6022.672983]        _raw_spin_lock_irqsave+0x50/0x78
      [ 6022.677848]        __irq_get_desc_lock+0x5c/0x98
      [ 6022.682453]        irq_set_vcpu_affinity+0x40/0xc0
      [ 6022.687236]        its_make_vpe_non_resident+0x6c/0xb8
      [ 6022.692364]        vgic_v4_put+0x54/0x70
      [ 6022.696273]        vgic_v3_put+0x20/0xd8
      [ 6022.700183]        kvm_vgic_put+0x30/0x48
      [ 6022.704182]        kvm_arch_vcpu_put+0x34/0x50
      [ 6022.708614]        kvm_sched_out+0x34/0x50
      [ 6022.712700]        __schedule+0x4bc/0x7f8
      [ 6022.716697]        schedule+0x50/0xd8
      [ 6022.720347]        kvm_arch_vcpu_ioctl_run+0x5f0/0x978
      [ 6022.725473]        kvm_vcpu_ioctl+0x3d4/0x8f8
      [ 6022.729820]        ksys_ioctl+0x90/0xd0
      [ 6022.733642]        __arm64_sys_ioctl+0x24/0x30
      [ 6022.738074]        el0_svc_common.constprop.3+0xa8/0x1e8
      [ 6022.743373]        do_el0_svc+0x28/0x88
      [ 6022.747198]        el0_svc+0x14/0x40
      [ 6022.750761]        el0_sync_handler+0x124/0x2b8
      [ 6022.755278]        el0_sync+0x140/0x180
      [ 6022.759100]
      [ 6022.759100] -> #1 (&rq->lock){-.-.}:
      [ 6022.764143]        _raw_spin_lock+0x38/0x50
      [ 6022.768314]        task_fork_fair+0x40/0x128
      [ 6022.772572]        sched_fork+0xe0/0x210
      [ 6022.776484]        copy_process+0x8c4/0x18d8
      [ 6022.780742]        _do_fork+0x88/0x6d8
      [ 6022.784478]        kernel_thread+0x64/0x88
      [ 6022.788563]        rest_init+0x30/0x270
      [ 6022.792390]        arch_call_rest_init+0x14/0x1c
      [ 6022.796995]        start_kernel+0x498/0x4c4
      [ 6022.801164]
      [ 6022.801164] -> #0 (&p->pi_lock){-.-.}:
      [ 6022.806382]        __lock_acquire+0xdd8/0x15c8
      [ 6022.810813]        lock_acquire+0xd0/0x218
      [ 6022.814896]        _raw_spin_lock_irqsave+0x50/0x78
      [ 6022.819761]        try_to_wake_up+0x54/0x7a0
      [ 6022.824018]        wake_up_process+0x1c/0x28
      [ 6022.828276]        wakeup_softirqd+0x38/0x40
      [ 6022.832533]        __tasklet_schedule_common+0xc4/0xf0
      [ 6022.837658]        __tasklet_schedule+0x24/0x30
      [ 6022.842176]        check_irq_resend+0xc8/0x158
      [ 6022.846609]        irq_startup+0x74/0x128
      [ 6022.850606]        __enable_irq+0x6c/0x78
      [ 6022.854602]        enable_irq+0x54/0xa0
      [ 6022.858431]        its_make_vpe_non_resident+0xa4/0xb8
      [ 6022.863557]        vgic_v4_put+0x54/0x70
      [ 6022.867469]        kvm_arch_vcpu_blocking+0x28/0x38
      [ 6022.872336]        kvm_vcpu_block+0x48/0x490
      [ 6022.876594]        kvm_handle_wfx+0x18c/0x310
      [ 6022.880938]        handle_exit+0x138/0x198
      [ 6022.885022]        kvm_arch_vcpu_ioctl_run+0x4d4/0x978
      [ 6022.890148]        kvm_vcpu_ioctl+0x3d4/0x8f8
      [ 6022.894494]        ksys_ioctl+0x90/0xd0
      [ 6022.898317]        __arm64_sys_ioctl+0x24/0x30
      [ 6022.902748]        el0_svc_common.constprop.3+0xa8/0x1e8
      [ 6022.908046]        do_el0_svc+0x28/0x88
      [ 6022.911871]        el0_svc+0x14/0x40
      [ 6022.915434]        el0_sync_handler+0x124/0x2b8
      [ 6022.919951]        el0_sync+0x140/0x180
      [ 6022.923773]
      [ 6022.923773] other info that might help us debug this:
      [ 6022.923773]
      [ 6022.931762] Chain exists of:
      [ 6022.931762]   &p->pi_lock --> &rq->lock --> &irq_desc_lock_class
      [ 6022.931762]
      [ 6022.942101]  Possible unsafe locking scenario:
      [ 6022.942101]
      [ 6022.948007]        CPU0                    CPU1
      [ 6022.952523]        ----                    ----
      [ 6022.957039]   lock(&irq_desc_lock_class);
      [ 6022.961036]                                lock(&rq->lock);
      [ 6022.966595]                                lock(&irq_desc_lock_class);
      [ 6022.973109]   lock(&p->pi_lock);
      [ 6022.976324]
      [ 6022.976324]  *** DEADLOCK ***
      
      This is happening because we have a pending doorbell that requires
      retrigger. As SW retriggering is done in a tasklet, we trigger the
      circular dependency above.
      
      The easy cop-out is to provide a retrigger callback that doesn't
      require acquiring any extra lock.
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/20200310184921.23552-5-maz@kernel.orgSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
      702f64bc
    • Neil Armstrong's avatar
      usb: dwc3: core: add support for disabling SS instances in park mode · 831494cb
      Neil Armstrong authored
      [ Upstream commit 7ba6b09f ]
      
      In certain circumstances, the XHCI SuperSpeed instance in park mode
      can fail to recover, thus on Amlogic G12A/G12B/SM1 SoCs when there is high
      load on the single XHCI SuperSpeed instance, the controller can crash like:
       xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command.
       xhci-hcd xhci-hcd.0.auto: Host halt failed, -110
       xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assume dead
       xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command.
       hub 2-1.1:1.0: hub_ext_port_status failed (err = -22)
       xhci-hcd xhci-hcd.0.auto: HC died; cleaning up
       usb 2-1.1-port1: cannot reset (err = -22)
      
      Setting the PARKMODE_DISABLE_SS bit in the DWC3_USB3_GUCTL1 mitigates
      the issue. The bit is described as :
      "When this bit is set to '1' all SS bus instances in park mode are disabled"
      
      Synopsys explains:
      The GUCTL1.PARKMODE_DISABLE_SS is only available in
      dwc_usb3 controller running in host mode.
      This should not be set for other IPs.
      This can be disabled by default based on IP, but I recommend to have a
      property to enable this feature for devices that need this.
      
      CC: Dongjin Kim <tobetter@gmail.com>
      Cc: Jianxin Pan <jianxin.pan@amlogic.com>
      Cc: Thinh Nguyen <thinhn@synopsys.com>
      Cc: Jun Li <lijun.kernel@gmail.com>
      Reported-by: default avatarTim <elatllat@gmail.com>
      Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      831494cb
    • Dongchun Zhu's avatar
      media: i2c: ov5695: Fix power on and off sequences · 505e557c
      Dongchun Zhu authored
      [ Upstream commit f1a64f56 ]
      
      From the measured hardware signal, OV5695 reset pin goes high for a
      short period of time during boot-up. From the sensor specification, the
      reset pin is active low and the DT binding defines the pin as active
      low, which means that the values set by the driver are inverted and thus
      the value requested in probe ends up high.
      
      Fix it by changing probe to request the reset GPIO initialized to high,
      which makes the initial state of the physical signal low.
      
      In addition, DOVDD rising must occur before DVDD rising from spec., but
      regulator_bulk_enable() API enables all the regulators asynchronously.
      Use an explicit loops of regulator_enable() instead.
      
      For power off sequence, it is required that DVDD falls first. Given the
      bulk API does not give any guarantee about the order of regulators,
      change the driver to use regulator_disable() instead.
      
      The sensor also requires a delay between reset high and first I2C
      transaction, which was assumed to be 8192 XVCLK cycles, but 1ms is
      recommended by the vendor. Fix this as well.
      Signed-off-by: default avatarDongchun Zhu <dongchun.zhu@mediatek.com>
      Signed-off-by: default avatarTomasz Figa <tfiga@chromium.org>
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      505e557c