Skip to content
  1. Dec 29, 2021
    • Martin Blumenstingl's avatar
      ASoC: meson: aiu: Move AIU_I2S_MISC hold setting to aiu-fifo-i2s · 30140e25
      Martin Blumenstingl authored
      commit ee907afb upstream.
      
      The out-of-tree vendor driver uses the following approach to set the
      AIU_I2S_MISC register:
      1) write AIU_MEM_I2S_START_PTR and AIU_MEM_I2S_RD_PTR
      2) configure AIU_I2S_MUTE_SWAP[15:0]
      3) write AIU_MEM_I2S_END_PTR
      4) set AIU_I2S_MISC[2] to 1 (documented as: "put I2S interface in hold
         mode")
      5) set AIU_I2S_MISC[4] to 1 (depending on the driver revision it always
         stays at 1 while for older drivers this bit is unset in step 4)
      6) set AIU_I2S_MISC[2] to 0
      7) write AIU_MEM_I2S_MASKS
      8) toggle AIU_MEM_I2S_CONTROL[0]
      9) toggle AIU_MEM_I2S_BUF_CNTL[0]
      
      Move setting the AIU_I2S_MISC[2] bit to aiu_fifo_i2s_hw_params() so it
      resembles the flow in the vendor kernel more closely. While here also
      configure AIU_I2S_MISC[4] (documented as: "force each audio data to
      left or right according to the bit attached with the audio data")
      similar to how the vendor driver does this. This fixes the infamous and
      long-standing "machine gun noise" issue (a buffer underrun issue).
      
      Fixes: 6ae9ca9c
      
       ("ASoC: meson: aiu: add i2s and spdif support")
      Reported-by: default avatarChristian Hewitt <christianshewitt@gmail.com>
      Reported-by: default avatarGeraldo Nascimento <geraldogabriel@gmail.com>
      Tested-by: default avatarChristian Hewitt <christianshewitt@gmail.com>
      Tested-by: default avatarGeraldo Nascimento <geraldogabriel@gmail.com>
      Acked-by: default avatarJerome Brunet <jbrunet@baylibre.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Link: https://lore.kernel.org/r/20211206210804.2512999-3-martin.blumenstingl@googlemail.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      30140e25
    • Werner Sembach's avatar
      ALSA: hda/realtek: Fix quirk for Clevo NJ51CU · 2b4c020b
      Werner Sembach authored
      commit edca7cc4
      
       upstream.
      
      The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec, but uses
      the 0x8686 subproduct id in both cases. The ALC256 codec needs a different
      quirk for the headset microphone working and and edditional quirk for sound
      working after suspend and resume.
      
      When waking up from s3 suspend the Coef 0x10 is set to 0x0220 instead of
      0x0020 on  the ALC256 codec. Setting the value manually makes the sound
      work again. This patch does this automatically.
      
      [ minor coding style fix by tiwai ]
      
      Signed-off-by: default avatarWerner Sembach <wse@tuxedocomputers.com>
      Fixes: b5acfe15
      
       ("ALSA: hda/realtek: Add some Clove SSID in the ALC293(ALC1220)")
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20211215191646.844644-1-wse@tuxedocomputers.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2b4c020b
    • Bradley Scott's avatar
      ALSA: hda/realtek: Add new alc285-hp-amp-init model · 7470780f
      Bradley Scott authored
      commit aa723946
      
       upstream.
      
      Adds a new "alc285-hp-amp-init" model that can be used to apply the ALC285
      HP speaker amplifier initialization fixup to devices that are not already
      known by passing "hda_model=alc285-hp-amp-init" to the
      snd-sof-intel-hda-common module or "model=alc285-hp-amp-init" to the
      snd-hda-intel module, depending on which is being used.
      
      Signed-off-by: default avatarBradley Scott <bscott@teksavvy.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20211213162246.506838-1-bscott@teksavvy.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7470780f
    • Bradley Scott's avatar
      ALSA: hda/realtek: Amp init fixup for HP ZBook 15 G6 · 4cb7dc2e
      Bradley Scott authored
      commit d296a74b
      
       upstream.
      
      HP ZBook 15 G6 (SSID 103c:860f) needs the same speaker amplifier
      initialization as used on several other HP laptops using ALC285.
      
      Signed-off-by: default avatarBradley Scott <Bradley.Scott@zebra.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20211213154938.503201-1-Bradley.Scott@zebra.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4cb7dc2e
    • Colin Ian King's avatar
      ALSA: drivers: opl3: Fix incorrect use of vp->state · 69e49216
      Colin Ian King authored
      commit 2dee54b2
      
       upstream.
      
      Static analysis with scan-build has found an assignment to vp2 that is
      never used. It seems that the check on vp->state > 0 should be actually
      on vp2->state instead. Fix this.
      
      This dates back to 2002, I found the offending commit from the git
      history git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git,
      commit 91e39521bbf6 ("[PATCH] ALSA patch for 2.5.4")
      
      Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20211212172025.470367-1-colin.i.king@gmail.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      69e49216
    • Xiaoke Wang's avatar
      ALSA: jack: Check the return value of kstrdup() · a96c08e0
      Xiaoke Wang authored
      commit c01c1db1
      
       upstream.
      
      kstrdup() can return NULL, it is better to check the return value of it.
      
      Signed-off-by: default avatarXiaoke Wang <xkernel.wang@foxmail.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/tencent_094816F3522E0DC704056C789352EBBF0606@qq.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a96c08e0
    • Guenter Roeck's avatar
      hwmon: (lm90) Drop critical attribute support for MAX6654 · 51c7b2a7
      Guenter Roeck authored
      [ Upstream commit 16ba51b5 ]
      
      Tests with a real chip and a closer look into the datasheet show that
      MAX6654 does not support CRIT/THERM/OVERTEMP limits, so drop support
      of the respective attributes for this chip.
      
      Introduce LM90_HAVE_CRIT flag and use it to instantiate critical limit
      attributes to solve the problem.
      
      Cc: Josh Lehan <krellan@google.com>
      Fixes: 229d495d
      
       ("hwmon: (lm90) Add max6654 support to lm90 driver")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      51c7b2a7
    • Guenter Roeck's avatar
      hwmon: (lm90) Introduce flag indicating extended temperature support · 2464738d
      Guenter Roeck authored
      [ Upstream commit f347e249
      
       ]
      
      A flag indicating extended temperature support makes it easier
      to add support for additional chips with this functionality.
      
      Cc: David T. Wilson <david.wilson@nasa.gov>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      2464738d
    • Guenter Roeck's avatar
      hwmon: (lm90) Add basic support for TI TMP461 · 196df56c
      Guenter Roeck authored
      [ Upstream commit f8344f76 ]
      
      TMP461 is almost identical to TMP451 and was actually detected as TMP451
      with the existing lm90 driver if its I2C address is 0x4c. Add support
      for it to the lm90 driver. At the same time, improve the chip detection
      function to at least try to distinguish between TMP451 and TMP461.
      
      As a side effect, this fixes commit 24333ac2 ("hwmon: (tmp401) use
      smb word operations instead of 2 smb byte operations"). TMP461 does not
      support word operations on temperature registers, which causes bad
      temperature readings with the tmp401 driver. The lm90 driver does not
      perform word operations on temperature registers and thus does not have
      this problem.
      
      Support is listed as basic because TMP461 supports a sensor resolution
      of 0.0625 degrees C, while the lm90 driver assumes a resolution of 0.125
      degrees C. Also, the TMP461 supports negative temperatures with its
      default temperature range, which is not the case for similar chips
      supported by the lm90 and the tmp401 drivers. Those limitations will be
      addressed with follow-up patches.
      
      Fixes: 24333ac2
      
       ("hwmon: (tmp401) use smb word operations instead of 2 smb byte operations")
      Reported-by: default avatarDavid T. Wilson <david.wilson@nasa.gov>
      Cc: David T. Wilson <david.wilson@nasa.gov>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      196df56c
    • Guenter Roeck's avatar
      hwmon: (lm90) Fix usage of CONFIG2 register in detect function · fa2e1492
      Guenter Roeck authored
      [ Upstream commit fce15c45 ]
      
      The detect function had a comment "Make compiler happy" when id did not
      read the second configuration register. As it turns out, the code was
      checking the contents of this register for manufacturer ID 0xA1 (NXP
      Semiconductor/Philips), but never actually read the register. So it
      wasn't surprising that the compiler complained, and it indeed had a point.
      Fix the code to read the register contents for manufacturer ID 0xa1.
      
      At the same time, the code was reading the register for manufacturer ID
      0x41 (Analog Devices), but it was not using the results. In effect it was
      just checking if reading the register returned an error. That doesn't
      really add much if any value, so stop doing that.
      
      Fixes: f90be42f
      
       ("hwmon: (lm90) Refactor reading of config2 register")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      fa2e1492
    • Phil Elwell's avatar
      pinctrl: bcm2835: Change init order for gpio hogs · ba696b47
      Phil Elwell authored
      [ Upstream commit 266423e6 ]
      
      ...and gpio-ranges
      
      pinctrl-bcm2835 is a combined pinctrl/gpio driver. Currently the gpio
      side is registered first, but this breaks gpio hogs (which are
      configured during gpiochip_add_data). Part of the hog initialisation
      is a call to pinctrl_gpio_request, and since the pinctrl driver hasn't
      yet been registered this results in an -EPROBE_DEFER from which it can
      never recover.
      
      Change the initialisation sequence to register the pinctrl driver
      first.
      
      This also solves a similar problem with the gpio-ranges property, which
      is required in order for released pins to be returned to inputs.
      
      Fixes: 73345a18
      
       ("pinctrl: bcm2835: Pass irqchip when adding gpiochip")
      Signed-off-by: default avatarPhil Elwell <phil@raspberrypi.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20211206092237.4105895-2-phil@raspberrypi.com
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      ba696b47
    • Andrea Righi's avatar
      Input: elantech - fix stack out of bound access in elantech_change_report_id() · 676c5724
      Andrea Righi authored
      [ Upstream commit 1d72d9f9 ]
      
      The array param[] in elantech_change_report_id() must be at least 3
      bytes, because elantech_read_reg_params() is calling ps2_command() with
      PSMOUSE_CMD_GETINFO, that is going to access 3 bytes from param[], but
      it's defined in the stack as an array of 2 bytes, therefore we have a
      potential stack out-of-bounds access here, also confirmed by KASAN:
      
      [    6.512374] BUG: KASAN: stack-out-of-bounds in __ps2_command+0x372/0x7e0
      [    6.512397] Read of size 1 at addr ffff8881024d77c2 by task kworker/2:1/118
      
      [    6.512416] CPU: 2 PID: 118 Comm: kworker/2:1 Not tainted 5.13.0-22-generic #22+arighi20211110
      [    6.512428] Hardware name: LENOVO 20T8000QGE/20T8000QGE, BIOS R1AET32W (1.08 ) 08/14/2020
      [    6.512436] Workqueue: events_long serio_handle_event
      [    6.512453] Call Trace:
      [    6.512462]  show_stack+0x52/0x58
      [    6.512474]  dump_stack+0xa1/0xd3
      [    6.512487]  print_address_description.constprop.0+0x1d/0x140
      [    6.512502]  ? __ps2_command+0x372/0x7e0
      [    6.512516]  __kasan_report.cold+0x7d/0x112
      [    6.512527]  ? _raw_write_lock_irq+0x20/0xd0
      [    6.512539]  ? __ps2_command+0x372/0x7e0
      [    6.512552]  kasan_report+0x3c/0x50
      [    6.512564]  __asan_load1+0x6a/0x70
      [    6.512575]  __ps2_command+0x372/0x7e0
      [    6.512589]  ? ps2_drain+0x240/0x240
      [    6.512601]  ? dev_printk_emit+0xa2/0xd3
      [    6.512612]  ? dev_vprintk_emit+0xc5/0xc5
      [    6.512621]  ? __kasan_check_write+0x14/0x20
      [    6.512634]  ? mutex_lock+0x8f/0xe0
      [    6.512643]  ? __mutex_lock_slowpath+0x20/0x20
      [    6.512655]  ps2_command+0x52/0x90
      [    6.512670]  elantech_ps2_command+0x4f/0xc0 [psmouse]
      [    6.512734]  elantech_change_report_id+0x1e6/0x256 [psmouse]
      [    6.512799]  ? elantech_report_trackpoint.constprop.0.cold+0xd/0xd [psmouse]
      [    6.512863]  ? ps2_command+0x7f/0x90
      [    6.512877]  elantech_query_info.cold+0x6bd/0x9ed [psmouse]
      [    6.512943]  ? elantech_setup_ps2+0x460/0x460 [psmouse]
      [    6.513005]  ? psmouse_reset+0x69/0xb0 [psmouse]
      [    6.513064]  ? psmouse_attr_set_helper+0x2a0/0x2a0 [psmouse]
      [    6.513122]  ? phys_pmd_init+0x30e/0x521
      [    6.513137]  elantech_init+0x8a/0x200 [psmouse]
      [    6.513200]  ? elantech_init_ps2+0xf0/0xf0 [psmouse]
      [    6.513249]  ? elantech_query_info+0x440/0x440 [psmouse]
      [    6.513296]  ? synaptics_send_cmd+0x60/0x60 [psmouse]
      [    6.513342]  ? elantech_query_info+0x440/0x440 [psmouse]
      [    6.513388]  ? psmouse_try_protocol+0x11e/0x170 [psmouse]
      [    6.513432]  psmouse_extensions+0x65d/0x6e0 [psmouse]
      [    6.513476]  ? psmouse_try_protocol+0x170/0x170 [psmouse]
      [    6.513519]  ? mutex_unlock+0x22/0x40
      [    6.513526]  ? ps2_command+0x7f/0x90
      [    6.513536]  ? psmouse_probe+0xa3/0xf0 [psmouse]
      [    6.513580]  psmouse_switch_protocol+0x27d/0x2e0 [psmouse]
      [    6.513624]  psmouse_connect+0x272/0x530 [psmouse]
      [    6.513669]  serio_driver_probe+0x55/0x70
      [    6.513679]  really_probe+0x190/0x720
      [    6.513689]  driver_probe_device+0x160/0x1f0
      [    6.513697]  device_driver_attach+0x119/0x130
      [    6.513705]  ? device_driver_attach+0x130/0x130
      [    6.513713]  __driver_attach+0xe7/0x1a0
      [    6.513720]  ? device_driver_attach+0x130/0x130
      [    6.513728]  bus_for_each_dev+0xfb/0x150
      [    6.513738]  ? subsys_dev_iter_exit+0x10/0x10
      [    6.513748]  ? _raw_write_unlock_bh+0x30/0x30
      [    6.513757]  driver_attach+0x2d/0x40
      [    6.513764]  serio_handle_event+0x199/0x3d0
      [    6.513775]  process_one_work+0x471/0x740
      [    6.513785]  worker_thread+0x2d2/0x790
      [    6.513794]  ? process_one_work+0x740/0x740
      [    6.513802]  kthread+0x1b4/0x1e0
      [    6.513809]  ? set_kthread_struct+0x80/0x80
      [    6.513816]  ret_from_fork+0x22/0x30
      
      [    6.513832] The buggy address belongs to the page:
      [    6.513838] page:00000000bc35e189 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1024d7
      [    6.513847] flags: 0x17ffffc0000000(node=0|zone=2|lastcpupid=0x1fffff)
      [    6.513860] raw: 0017ffffc0000000 dead000000000100 dead000000000122 0000000000000000
      [    6.513867] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
      [    6.513872] page dumped because: kasan: bad access detected
      
      [    6.513879] addr ffff8881024d77c2 is located in stack of task kworker/2:1/118 at offset 34 in frame:
      [    6.513887]  elantech_change_report_id+0x0/0x256 [psmouse]
      
      [    6.513941] this frame has 1 object:
      [    6.513947]  [32, 34) 'param'
      
      [    6.513956] Memory state around the buggy address:
      [    6.513962]  ffff8881024d7680: f2 f2 f2 f2 f2 00 00 f3 f3 00 00 00 00 00 00 00
      [    6.513969]  ffff8881024d7700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [    6.513976] >ffff8881024d7780: 00 00 00 00 f1 f1 f1 f1 02 f3 f3 f3 00 00 00 00
      [    6.513982]                                            ^
      [    6.513988]  ffff8881024d7800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [    6.513995]  ffff8881024d7880: 00 f1 f1 f1 f1 03 f2 03 f2 03 f3 f3 f3 00 00 00
      [    6.514000] ==================================================================
      
      Define param[] in elantech_change_report_id() as an array of 3 bytes to
      prevent the out-of-bounds access in the stack.
      
      Fixes: e4c90627
      
       ("Input: elantech - fix protocol errors for some trackpoints in SMBus mode")
      BugLink: https://bugs.launchpad.net/bugs/1945590
      Signed-off-by: default avatarAndrea Righi <andrea.righi@canonical.com>
      Reviewed-by: default avatarWolfram Sang <wsa@kernel.org>
      Link: https://lore.kernel.org/r/20211116095559.24395-1-andrea.righi@canonical.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      676c5724
    • 蒋家盛's avatar
      sfc: falcon: Check null pointer of rx_queue->page_ring · 2792fde8
      蒋家盛 authored
      [ Upstream commit 9b8bdd1e ]
      
      Because of the possible failure of the kcalloc, it should be better to
      set rx_queue->page_ptr_mask to 0 when it happens in order to maintain
      the consistency.
      
      Fixes: 5a6681e2
      
       ("sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Acked-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
      Link: https://lore.kernel.org/r/20211220140344.978408-1-jiasheng@iscas.ac.cn
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      2792fde8
    • 蒋家盛's avatar
      sfc: Check null pointer of rx_queue->page_ring · d70b4001
      蒋家盛 authored
      [ Upstream commit bdf1b5c3 ]
      
      Because of the possible failure of the kcalloc, it should be better to
      set rx_queue->page_ptr_mask to 0 when it happens in order to maintain
      the consistency.
      
      Fixes: 5a6681e2
      
       ("sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Acked-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
      Link: https://lore.kernel.org/r/20211220135603.954944-1-jiasheng@iscas.ac.cn
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      d70b4001
    • 蒋家盛's avatar
      net: ks8851: Check for error irq · 75c962f0
      蒋家盛 authored
      [ Upstream commit 99d7fbb5 ]
      
      Because platform_get_irq() could fail and return error irq.
      Therefore, it might be better to check it if order to avoid the use of
      error irq.
      
      Fixes: 797047f8
      
       ("net: ks8851: Implement Parallel bus operations")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      75c962f0
    • 蒋家盛's avatar
      drivers: net: smc911x: Check for error irq · 9db0f8d3
      蒋家盛 authored
      [ Upstream commit cb93b3e1 ]
      
      Because platform_get_irq() could fail and return error irq.
      Therefore, it might be better to check it if order to avoid the use of
      error irq.
      
      Fixes: ae150435
      
       ("smsc: Move the SMC (SMSC) drivers")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      9db0f8d3
    • 蒋家盛's avatar
      fjes: Check for error irq · ca2a1505
      蒋家盛 authored
      [ Upstream commit db6d6afe ]
      
      I find that platform_get_irq() will not always succeed.
      It will return error irq in case of the failure.
      Therefore, it might be better to check it if order to avoid the use of
      error irq.
      
      Fixes: 658d439b
      
       ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      ca2a1505
    • Fernando Fernandez Mancera's avatar
      bonding: fix ad_actor_system option setting to default · c6d27540
      Fernando Fernandez Mancera authored
      [ Upstream commit 1c15b05b ]
      
      When 802.3ad bond mode is configured the ad_actor_system option is set to
      "00:00:00:00:00:00". But when trying to set the all-zeroes MAC as actors'
      system address it was failing with EINVAL.
      
      An all-zeroes ethernet address is valid, only multicast addresses are not
      valid values.
      
      Fixes: 171a42c3
      
       ("bonding: add netlink support for sys prio, actor sys mac, and port key")
      Signed-off-by: default avatarFernando Fernandez Mancera <ffmancera@riseup.net>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Link: https://lore.kernel.org/r/20211221111345.2462-1-ffmancera@riseup.net
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      c6d27540
    • Wu Bo's avatar
      ipmi: Fix UAF when uninstall ipmi_si and ipmi_msghandler module · 6809da51
      Wu Bo authored
      [ Upstream commit ffb76a86 ]
      
      Hi,
      
      When testing install and uninstall of ipmi_si.ko and ipmi_msghandler.ko,
      the system crashed.
      
      The log as follows:
      [  141.087026] BUG: unable to handle kernel paging request at ffffffffc09b3a5a
      [  141.087241] PGD 8fe4c0d067 P4D 8fe4c0d067 PUD 8fe4c0f067 PMD 103ad89067 PTE 0
      [  141.087464] Oops: 0010 [#1] SMP NOPTI
      [  141.087580] CPU: 67 PID: 668 Comm: kworker/67:1 Kdump: loaded Not tainted 4.18.0.x86_64 #47
      [  141.088009] Workqueue: events 0xffffffffc09b3a40
      [  141.088009] RIP: 0010:0xffffffffc09b3a5a
      [  141.088009] Code: Bad RIP value.
      [  141.088009] RSP: 0018:ffffb9094e2c3e88 EFLAGS: 00010246
      [  141.088009] RAX: 0000000000000000 RBX: ffff9abfdb1f04a0 RCX: 0000000000000000
      [  141.088009] RDX: 0000000000000000 RSI: 0000000000000246 RDI: 0000000000000246
      [  141.088009] RBP: 0000000000000000 R08: ffff9abfffee3cb8 R09: 00000000000002e1
      [  141.088009] R10: ffffb9094cb73d90 R11: 00000000000f4240 R12: ffff9abfffee8700
      [  141.088009] R13: 0000000000000000 R14: ffff9abfdb1f04a0 R15: ffff9abfdb1f04a8
      [  141.088009] FS:  0000000000000000(0000) GS:ffff9abfffec0000(0000) knlGS:0000000000000000
      [  141.088009] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  141.088009] CR2: ffffffffc09b3a30 CR3: 0000008fe4c0a001 CR4: 00000000007606e0
      [  141.088009] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  141.088009] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  141.088009] PKRU: 55555554
      [  141.088009] Call Trace:
      [  141.088009]  ? process_one_work+0x195/0x390
      [  141.088009]  ? worker_thread+0x30/0x390
      [  141.088009]  ? process_one_work+0x390/0x390
      [  141.088009]  ? kthread+0x10d/0x130
      [  141.088009]  ? kthread_flush_work_fn+0x10/0x10
      [  141.088009]  ? ret_from_fork+0x35/0x40] BUG: unable to handle kernel paging request at ffffffffc0b28a5a
      [  200.223240] PGD 97fe00d067 P4D 97fe00d067 PUD 97fe00f067 PMD a580cbf067 PTE 0
      [  200.223464] Oops: 0010 [#1] SMP NOPTI
      [  200.223579] CPU: 63 PID: 664 Comm: kworker/63:1 Kdump: loaded Not tainted 4.18.0.x86_64 #46
      [  200.224008] Workqueue: events 0xffffffffc0b28a40
      [  200.224008] RIP: 0010:0xffffffffc0b28a5a
      [  200.224008] Code: Bad RIP value.
      [  200.224008] RSP: 0018:ffffbf3c8e2a3e88 EFLAGS: 00010246
      [  200.224008] RAX: 0000000000000000 RBX: ffffa0799ad6bca0 RCX: 0000000000000000
      [  200.224008] RDX: 0000000000000000 RSI: 0000000000000246 RDI: 0000000000000246
      [  200.224008] RBP: 0000000000000000 R08: ffff9fe43fde3cb8 R09: 00000000000000d5
      [  200.224008] R10: ffffbf3c8cb53d90 R11: 00000000000f4240 R12: ffff9fe43fde8700
      [  200.224008] R13: 0000000000000000 R14: ffffa0799ad6bca0 R15: ffffa0799ad6bca8
      [  200.224008] FS:  0000000000000000(0000) GS:ffff9fe43fdc0000(0000) knlGS:0000000000000000
      [  200.224008] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  200.224008] CR2: ffffffffc0b28a30 CR3: 00000097fe00a002 CR4: 00000000007606e0
      [  200.224008] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  200.224008] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  200.224008] PKRU: 55555554
      [  200.224008] Call Trace:
      [  200.224008]  ? process_one_work+0x195/0x390
      [  200.224008]  ? worker_thread+0x30/0x390
      [  200.224008]  ? process_one_work+0x390/0x390
      [  200.224008]  ? kthread+0x10d/0x130
      [  200.224008]  ? kthread_flush_work_fn+0x10/0x10
      [  200.224008]  ? ret_from_fork+0x35/0x40
      [  200.224008] kernel fault(0x1) notification starting on CPU 63
      [  200.224008] kernel fault(0x1) notification finished on CPU 63
      [  200.224008] CR2: ffffffffc0b28a5a
      [  200.224008] ---[ end trace c82a412d93f57412 ]---
      
      The reason is as follows:
      T1: rmmod ipmi_si.
          ->ipmi_unregister_smi()
              -> ipmi_bmc_unregister()
                  -> __ipmi_bmc_unregister()
                      -> kref_put(&bmc->usecount, cleanup_bmc_device);
                          -> schedule_work(&bmc->remove_work);
      
      T2: rmmod ipmi_msghandler.
          ipmi_msghander module uninstalled, and the module space
          will be freed.
      
      T3: bmc->remove_work doing cleanup the bmc resource.
          -> cleanup_bmc_work()
              -> platform_device_unregister(&bmc->pdev);
                  -> platform_device_del(pdev);
                      -> device_del(&pdev->dev);
                          -> kobject_uevent(&dev->kobj, KOBJ_REMOVE);
                              -> kobject_uevent_env()
                                  -> dev_uevent()
                                      -> if (dev->type && dev->type->name)
      
         'dev->type'(bmc_device_type) pointer space has freed when uninstall
          ipmi_msghander module, 'dev->type->name' cause the system crash.
      
      drivers/char/ipmi/ipmi_msghandler.c:
      2820 static const struct device_type bmc_device_type = {
      2821         .groups         = bmc_dev_attr_groups,
      2822 };
      
      Steps to reproduce:
      Add a time delay in cleanup_bmc_work() function,
      and uninstall ipmi_si and ipmi_msghandler module.
      
      2910 static void cleanup_bmc_work(struct work_struct *work)
      2911 {
      2912         struct bmc_device *bmc = container_of(work, struct bmc_device,
      2913                                               remove_work);
      2914         int id = bmc->pdev.id; /* Unregister overwrites id */
      2915
      2916         msleep(3000);   <---
      2917         platform_device_unregister(&bmc->pdev);
      2918         ida_simple_remove(&ipmi_bmc_ida, id);
      2919 }
      
      Use 'remove_work_wq' instead of 'system_wq' to solve this issues.
      
      Fixes: b2cfd8ab
      
       ("ipmi: Rework device id and guid handling to catch changing BMCs")
      Signed-off-by: default avatarWu Bo <wubo40@huawei.com>
      Message-Id: <1640070034-56671-1-git-send-email-wubo40@huawei.com>
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      6809da51
    • Heiner Kallweit's avatar
      igb: fix deadlock caused by taking RTNL in RPM resume path · 61e6b82e
      Heiner Kallweit authored
      [ Upstream commit ac8c58f5 ]
      
      Recent net core changes caused an issue with few Intel drivers
      (reportedly igb), where taking RTNL in RPM resume path results in a
      deadlock. See [0] for a bug report. I don't think the core changes
      are wrong, but taking RTNL in RPM resume path isn't needed.
      The Intel drivers are the only ones doing this. See [1] for a
      discussion on the issue. Following patch changes the RPM resume path
      to not take RTNL.
      
      [0] https://bugzilla.kernel.org/show_bug.cgi?id=215129
      [1] https://lore.kernel.org/netdev/20211125074949.5f897431@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/t/
      
      Fixes: bd869245 ("net: core: try to runtime-resume detached device in __dev_open")
      Fixes: f32a2137
      
       ("ethtool: runtime-resume netdev parent before ethtool ioctl ops")
      Tested-by: default avatarMartin Stolpe <martin.stolpe@gmail.com>
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Link: https://lore.kernel.org/r/20211220201844.2714498-1-anthony.l.nguyen@intel.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      61e6b82e
    • Willem de Bruijn's avatar
      net: skip virtio_net_hdr_set_proto if protocol already set · e00eace2
      Willem de Bruijn authored
      [ Upstream commit 1ed1d592 ]
      
      virtio_net_hdr_set_proto infers skb->protocol from the virtio_net_hdr
      gso_type, to avoid packets getting dropped for lack of a proto type.
      
      Its protocol choice is a guess, especially in the case of UFO, where
      the single VIRTIO_NET_HDR_GSO_UDP label covers both UFOv4 and UFOv6.
      
      Skip this best effort if the field is already initialized. Whether
      explicitly from userspace, or implicitly based on an earlier call to
      dev_parse_header_protocol (which is more robust, but was introduced
      after this patch).
      
      Fixes: 9d2f67e4
      
       ("net/packet: fix packet drop as of virtio gso")
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20211220145027.2784293-1-willemdebruijn.kernel@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      e00eace2
    • Willem de Bruijn's avatar
      net: accept UFOv6 packages in virtio_net_hdr_to_skb · ed05e4dc
      Willem de Bruijn authored
      [ Upstream commit 7e5cced9 ]
      
      Skb with skb->protocol 0 at the time of virtio_net_hdr_to_skb may have
      a protocol inferred from virtio_net_hdr with virtio_net_hdr_set_proto.
      
      Unlike TCP, UDP does not have separate types for IPv4 and IPv6. Type
      VIRTIO_NET_HDR_GSO_UDP is guessed to be IPv4/UDP. As of the below
      commit, UFOv6 packets are dropped due to not matching the protocol as
      obtained from dev_parse_header_protocol.
      
      Invert the test to take that L2 protocol field as starting point and
      pass both UFOv4 and UFOv6 for VIRTIO_NET_HDR_GSO_UDP.
      
      Fixes: 924a9bc3
      
       ("net: check if protocol extracted by virtio_net_hdr_set_proto is correct")
      Link: https://lore.kernel.org/netdev/CABcq3pG9GRCYqFDBAJ48H1vpnnX=41u+MhQnayF1ztLH4WX0Fw@mail.gmail.com/
      Reported-by: default avatarAndrew Melnichenko <andrew@daynix.com>
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/20211220144901.2784030-1-willemdebruijn.kernel@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      ed05e4dc
    • 蒋家盛's avatar
      qlcnic: potential dereference null pointer of rx_queue->page_ring · 56b0bbba
      蒋家盛 authored
      [ Upstream commit 60ec7fcf ]
      
      The return value of kcalloc() needs to be checked.
      To avoid dereference of null pointer in case of the failure of alloc.
      Therefore, it might be better to change the return type of
      qlcnic_sriov_alloc_vlans() and return -ENOMEM when alloc fails and
      return 0 the others.
      Also, qlcnic_sriov_set_guest_vlan_mode() and __qlcnic_pci_sriov_enable()
      should deal with the return value of qlcnic_sriov_alloc_vlans().
      
      Fixes: 154d0c81
      
       ("qlcnic: VLAN enhancement for 84XX adapters")
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      56b0bbba
    • Yevhen Orlov's avatar
      net: marvell: prestera: fix incorrect return of port_find · 78e49d77
      Yevhen Orlov authored
      [ Upstream commit 8b681bd7 ]
      
      In case, when some ports is in list and we don't find requested - we
      return last iterator state and not return NULL as expected.
      
      Fixes: 501ef306
      
       ("net: marvell: prestera: Add driver for Prestera family ASIC devices")
      Signed-off-by: default avatarYevhen Orlov <yevhen.orlov@plvision.eu>
      Link: https://lore.kernel.org/r/20211216170736.8851-1-yevhen.orlov@plvision.eu
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      78e49d77
    • Martin Haaß's avatar
      ARM: dts: imx6qdl-wandboard: Fix Ethernet support · 861b4413
      Martin Haaß authored
      [ Upstream commit 39e66068 ]
      
      Currently, the imx6q-wandboard Ethernet does not transmit any
      data.
      
      This issue has been exposed by commit f5d9aa79 ("ARM: imx6q:
      remove clk-out fixup for the Atheros AR8031 and AR8035 PHYs").
      
      Fix it by describing the qca,clk-out-frequency property as suggested
      by the commit above.
      
      Fixes: 77591e42
      
       ("ARM: dts: imx6qdl-wandboard: add ethernet PHY description")
      Signed-off-by: default avatarMartin Haaß <vvvrrooomm@gmail.com>
      Tested-by: default avatarFabio Estevam <festevam@gmail.com>
      Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
      Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      861b4413
    • Ignacy Gawędzki's avatar
      netfilter: fix regression in looped (broad|multi)cast's MAC handling · d79f5e0d
      Ignacy Gawędzki authored
      [ Upstream commit ebb966d3 ]
      
      In commit 5648b5e1 ("netfilter: nfnetlink_queue: fix OOB when mac
      header was cleared"), the test for non-empty MAC header introduced in
      commit 2c38de4c ("netfilter: fix looped (broad|multi)cast's MAC
      handling") has been replaced with a test for a set MAC header.
      
      This breaks the case when the MAC header has been reset (using
      skb_reset_mac_header), as is the case with looped-back multicast
      packets.  As a result, the packets ending up in NFQUEUE get a bogus
      hwaddr interpreted from the first bytes of the IP header.
      
      This patch adds a test for a non-empty MAC header in addition to the
      test for a set MAC header.  The same two tests are also implemented in
      nfnetlink_log.c, where the initial code of commit 2c38de4c
      ("netfilter: fix looped (broad|multi)cast's MAC handling") has not been
      touched, but where supposedly the same situation may happen.
      
      Fixes: 5648b5e1
      
       ("netfilter: nfnetlink_queue: fix OOB when mac header was cleared")
      Signed-off-by: default avatarIgnacy Gawędzki <ignacy.gawedzki@green-communications.fr>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      d79f5e0d
    • Jiacheng Shi's avatar
      RDMA/hns: Replace kfree() with kvfree() · 579cefef
      Jiacheng Shi authored
      [ Upstream commit 12d3bbdd ]
      
      Variables allocated by kvmalloc_array() should not be freed by kfree.
      Because they may be allocated by vmalloc.  So we replace kfree() with
      kvfree() here.
      
      Fixes: 6fd610c5
      
       ("RDMA/hns: Support 0 hop addressing for SRQ buffer")
      Link: https://lore.kernel.org/r/20211210094234.5829-1-billsjc@sjtu.edu.cn
      Signed-off-by: default avatarJiacheng Shi <billsjc@sjtu.edu.cn>
      Acked-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      579cefef
    • José Expósito's avatar
      IB/qib: Fix memory leak in qib_user_sdma_queue_pkts() · 7cf6466e
      José Expósito authored
      [ Upstream commit bee90911 ]
      
      The wrong goto label was used for the error case and missed cleanup of the
      pkt allocation.
      
      Fixes: d39bf40e
      
       ("IB/qib: Protect from buffer overflow in struct qib_user_sdma_pkt fields")
      Link: https://lore.kernel.org/r/20211208175238.29983-1-jose.exposito89@gmail.com
      Addresses-Coverity-ID: 1493352 ("Resource leak")
      Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
      Acked-by: default avatarMike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      7cf6466e
    • Martin Blumenstingl's avatar
      ASoC: meson: aiu: fifo: Add missing dma_coerce_mask_and_coherent() · cd9c9068
      Martin Blumenstingl authored
      [ Upstream commit 1bcd3266 ]
      
      The FIFO registers which take an DMA-able address are only 32-bit wide
      on AIU. Add dma_coerce_mask_and_coherent() to make the DMA core aware of
      this limitation.
      
      Fixes: 6ae9ca9c
      
       ("ASoC: meson: aiu: add i2s and spdif support")
      Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Link: https://lore.kernel.org/r/20211206210804.2512999-2-martin.blumenstingl@googlemail.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      cd9c9068
    • Dongliang Mu's avatar
      spi: change clk_disable_unprepare to clk_unprepare · 580ecf86
      Dongliang Mu authored
      [ Upstream commit db6689b6 ]
      
      The corresponding API for clk_prepare is clk_unprepare, other than
      clk_disable_unprepare.
      
      Fix this by changing clk_disable_unprepare to clk_unprepare.
      
      Fixes: 5762ab71
      
       ("spi: Add support for Armada 3700 SPI Controller")
      Signed-off-by: default avatarDongliang Mu <mudongliangabcd@gmail.com>
      Link: https://lore.kernel.org/r/20211206101931.2816597-1-mudongliangabcd@gmail.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      580ecf86
    • Robert Marko's avatar
      arm64: dts: allwinner: orangepi-zero-plus: fix PHY mode · 93a957bb
      Robert Marko authored
      [ Upstream commit 08d2061f ]
      
      Orange Pi Zero Plus uses a Realtek RTL8211E RGMII Gigabit PHY, but its
      currently set to plain RGMII mode meaning that it doesn't introduce
      delays.
      
      With this setup, TX packets are completely lost and changing the mode to
      RGMII-ID so the PHY will add delays internally fixes the issue.
      
      Fixes: a7affb13
      
       ("arm64: allwinner: H5: Add Xunlong Orange Pi Zero Plus")
      Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
      Tested-by: default avatarRon Goossens <rgoossens@gmail.com>
      Tested-by: default avatarSamuel Holland <samuel@sholland.org>
      Signed-off-by: default avatarRobert Marko <robert.marko@sartura.hr>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20211117140222.43692-1-robert.marko@sartura.hr
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      93a957bb
    • 蒋家盛's avatar
      HID: potential dereference of null pointer · ef2dce43
      蒋家盛 authored
      commit 13251ce1 upstream.
      
      The return value of devm_kzalloc() needs to be checked.
      To avoid hdev->dev->driver_data to be null in case of the failure of
      alloc.
      
      Fixes: 14c9c014
      
       ("HID: add vivaldi HID driver")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Link: https://lore.kernel.org/r/20211215083605.117638-1-jiasheng@iscas.ac.cn
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ef2dce43
    • Benjamin Tissoires's avatar
      HID: holtek: fix mouse probing · 3110bc58
      Benjamin Tissoires authored
      commit 93a2207c upstream.
      
      An overlook from the previous commit: we don't even parse or start the
      device, meaning that the device is not presented to user space.
      
      Fixes: 93020953
      
       ("HID: check for valid USB device for many HID drivers")
      Cc: stable@vger.kernel.org
      Link: https://bugs.archlinux.org/task/73048
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215341
      Link: https://lore.kernel.org/r/e4efbf13-bd8d-0370-629b-6c80c0044b15@leemhuis.info/
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3110bc58
    • Zhang Yi's avatar
      ext4: check for inconsistent extents between index and leaf block · 0875873b
      Zhang Yi authored
      commit 9c6e0719
      
       upstream.
      
      Now that we can check out overlapping extents in leaf block and
      out-of-order index extents in index block. But the .ee_block in the
      first extent of one leaf block should equal to the .ei_block in it's
      parent index extent entry. This patch add a check to verify such
      inconsistent between the index and leaf block.
      
      Signed-off-by: default avatarZhang Yi <yi.zhang@huawei.com>
      Link: https://lore.kernel.org/r/20210908120850.4012324-3-yi.zhang@huawei.com
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0875873b
    • Zhang Yi's avatar
      ext4: check for out-of-order index extents in ext4_valid_extent_entries() · 76366c02
      Zhang Yi authored
      commit 8dd27fec upstream.
      
      After commit 5946d089
      
       ("ext4: check for overlapping extents in
      ext4_valid_extent_entries()"), we can check out the overlapping extent
      entry in leaf extent blocks. But the out-of-order extent entry in index
      extent blocks could also trigger bad things if the filesystem is
      inconsistent. So this patch add a check to figure out the out-of-order
      index extents and return error.
      
      Signed-off-by: default avatarZhang Yi <yi.zhang@huawei.com>
      Reviewed-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20210908120850.4012324-2-yi.zhang@huawei.com
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      76366c02
    • Zhang Yi's avatar
      ext4: prevent partial update of the extent blocks · 1d4b1c4e
      Zhang Yi authored
      commit 0f2f87d5
      
       upstream.
      
      In the most error path of current extents updating operations are not
      roll back partial updates properly when some bad things happens(.e.g in
      ext4_ext_insert_extent()). So we may get an inconsistent extents tree
      if journal has been aborted due to IO error, which may probability lead
      to BUGON later when we accessing these extent entries in errors=continue
      mode. This patch drop extent buffer's verify flag before updatng the
      contents in ext4_ext_get_access(), and reset it after updating in
      __ext4_ext_dirty(). After this patch we could force to check the extent
      buffer if extents tree updating was break off, make sure the extents are
      consistent.
      
      Signed-off-by: default avatarZhang Yi <yi.zhang@huawei.com>
      Reviewed-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Link: https://lore.kernel.org/r/20210908120850.4012324-4-yi.zhang@huawei.com
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1d4b1c4e
    • Greg Jesionowski's avatar
      net: usb: lan78xx: add Allied Telesis AT29M2-AF · f69a47fc
      Greg Jesionowski authored
      commit ef8a0f6e
      
       upstream.
      
      This adds the vendor and product IDs for the AT29M2-AF which is a
      lan7801-based device.
      
      Signed-off-by: default avatarGreg Jesionowski <jesionowskigreg@gmail.com>
      Link: https://lore.kernel.org/r/20211214221027.305784-1-jesionowskigreg@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f69a47fc
    • Nick Desaulniers's avatar
      arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd · 8c0059a2
      Nick Desaulniers authored
      commit 3e6f8d1f upstream.
      
      Similar to
      commit 231ad7f4 ("Makefile: infer --target from ARCH for CC=clang")
      There really is no point in setting --target based on
      $CROSS_COMPILE_COMPAT for clang when the integrated assembler is being
      used, since
      commit ef943405
      
       ("arm64: vdso32: drop -no-integrated-as flag").
      
      Allows COMPAT_VDSO to be selected without setting $CROSS_COMPILE_COMPAT
      when using clang and lld together.
      
      Before:
      $ ARCH=arm64 CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make -j72 LLVM=1 defconfig
      $ grep CONFIG_COMPAT_VDSO .config
      CONFIG_COMPAT_VDSO=y
      $ ARCH=arm64 make -j72 LLVM=1 defconfig
      $ grep CONFIG_COMPAT_VDSO .config
      $
      
      After:
      $ ARCH=arm64 CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make -j72 LLVM=1 defconfig
      $ grep CONFIG_COMPAT_VDSO .config
      CONFIG_COMPAT_VDSO=y
      $ ARCH=arm64 make -j72 LLVM=1 defconfig
      $ grep CONFIG_COMPAT_VDSO .config
      CONFIG_COMPAT_VDSO=y
      
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      Suggested-by: default avatarNathan Chancellor <nathan@kernel.org>
      Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Link: https://lore.kernel.org/r/20211019223646.1146945-5-ndesaulniers@google.com
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8c0059a2
    • Nick Desaulniers's avatar
      arm64: vdso32: drop -no-integrated-as flag · b16b124a
      Nick Desaulniers authored
      commit ef943405
      
       upstream.
      
      Clang can assemble these files just fine; this is a relic from the top
      level Makefile conditionally adding this. We no longer need --prefix,
      --gcc-toolchain, or -Qunused-arguments flags either with this change, so
      remove those too.
      
      To test building:
      $ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
        CROSS_COMPILE_COMPAT=arm-linux-gnueabi- make LLVM=1 LLVM_IAS=1 \
        defconfig arch/arm64/kernel/vdso32/
      
      Suggested-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
      Tested-by: default avatarStephen Boyd <swboyd@chromium.org>
      Acked-by: default avatarWill Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20210420174427.230228-1-ndesaulniers@google.com
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b16b124a
  2. Dec 22, 2021