1. 23 Apr, 2021 4 commits
  2. 24 Mar, 2021 4 commits
  3. 23 Mar, 2021 8 commits
  4. 22 Mar, 2021 1 commit
    • Linus Torvalds's avatar
      Merge tag 'selinux-pr-20210322' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux · 84196390
      Linus Torvalds authored
      Pull selinux fixes from Paul Moore:
       "Three SELinux patches:
      
         - Fix a problem where a local variable is used outside its associated
           function. Thankfully this can only be triggered by reloading the
           SELinux policy, which is a restricted operation for other obvious
           reasons.
      
         - Fix some incorrect, and inconsistent, audit and printk messages
           when loading the SELinux policy.
      
        All three patches are relatively minor and have been through our
        testing with no failures"
      
      * tag 'selinux-pr-20210322' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
        selinuxfs: unify policy load error reporting
        selinux: fix variable scope issue in live sidtab conversion
        selinux: don't log MAC_POLICY_LOAD record on failed policy load
      84196390
  5. 21 Mar, 2021 23 commits
    • Linus Torvalds's avatar
      Linux 5.12-rc4 · 0d02ec6b
      Linus Torvalds authored
      0d02ec6b
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · d7f5f1bd
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Miscellaneous ext4 bug fixes for v5.12"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: initialize ret to suppress smatch warning
        ext4: stop inode update before return
        ext4: fix rename whiteout with fast commit
        ext4: fix timer use-after-free on failed mount
        ext4: fix potential error in ext4_do_update_inode
        ext4: do not try to set xattr into ea_inode if value is empty
        ext4: do not iput inode under running transaction in ext4_rename()
        ext4: find old entry again if failed to rename whiteout
        ext4: fix error handling in ext4_end_enable_verity()
        ext4: fix bh ref count on error paths
        fs/ext4: fix integer overflow in s_log_groups_per_flex
        ext4: add reclaim checks to xattr code
        ext4: shrink race window in ext4_should_retry_alloc()
      d7f5f1bd
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.12-2021-03-21' of git://git.kernel.dk/linux-block · 2c41fab1
      Linus Torvalds authored
      Pull io_uring followup fixes from Jens Axboe:
      
       - The SIGSTOP change from Eric, so we properly ignore that for
         PF_IO_WORKER threads.
      
       - Disallow sending signals to PF_IO_WORKER threads in general, we're
         not interested in having them funnel back to the io_uring owning
         task.
      
       - Stable fix from Stefan, ensuring we properly break links for short
         send/sendmsg recv/recvmsg if MSG_WAITALL is set.
      
       - Catch and loop when needing to run task_work before a PF_IO_WORKER
         threads goes to sleep.
      
      * tag 'io_uring-5.12-2021-03-21' of git://git.kernel.dk/linux-block:
        io_uring: call req_set_fail_links() on short send[msg]()/recv[msg]() with MSG_WAITALL
        io-wq: ensure task is running before processing task_work
        signal: don't allow STOP on PF_IO_WORKER threads
        signal: don't allow sending any signals to PF_IO_WORKER threads
      2c41fab1
    • Linus Torvalds's avatar
      Merge tag 'staging-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 1d4345eb
      Linus Torvalds authored
      Pull staging and IIO driver fixes from Greg KH:
       "Some small staging and IIO driver fixes:
      
         - MAINTAINERS changes for the move of the staging mailing list
      
         - comedi driver fixes to get request_irq() to work correctly
      
         - counter driver fixes for reported issues with iio devices
      
         - tiny iio driver fixes for reported issues.
      
        All of these have been in linux-next with no reported problems"
      
      * tag 'staging-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vt665x: fix alignment constraints
        staging: comedi: cb_pcidas64: fix request_irq() warn
        staging: comedi: cb_pcidas: fix request_irq() warn
        MAINTAINERS: move the staging subsystem to lists.linux.dev
        MAINTAINERS: move some real subsystems off of the staging mailing list
        iio: gyro: mpu3050: Fix error handling in mpu3050_trigger_handler
        iio: hid-sensor-temperature: Fix issues of timestamp channel
        iio: hid-sensor-humidity: Fix alignment issue of timestamp channel
        counter: stm32-timer-cnt: fix ceiling miss-alignment with reload register
        counter: stm32-timer-cnt: fix ceiling write max value
        counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED
        iio: adc: ab8500-gpadc: Fix off by 10 to 3
        iio:adc:stm32-adc: Add HAS_IOMEM dependency
        iio: adis16400: Fix an error code in adis16400_initial_setup()
        iio: adc: adi-axi-adc: add proper Kconfig dependencies
        iio: adc: ad7949: fix wrong ADC result due to incorrect bit mask
        iio: hid-sensor-prox: Fix scale not correct issue
        iio:adc:qcom-spmi-vadc: add default scale to LR_MUX2_BAT_ID channel
      1d4345eb
    • Linus Torvalds's avatar
      Merge tag 'usb-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 3001c355
      Linus Torvalds authored
      Pull USB and Thunderbolt driver fixes from Greg KH:
       "Here are some small Thunderbolt and USB driver fixes for some reported
        issues:
      
         - thunderbolt fixes for minor problems
      
         - typec fixes for power issues
      
         - usb-storage quirk addition
      
         - usbip bugfix
      
         - dwc3 bugfix when stopping transfers
      
         - cdnsp bugfix for isoc transfers
      
         - gadget use-after-free fix
      
        All have been in linux-next this week with no reported issues"
      
      * tag 'usb-5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy
        usb: dwc3: gadget: Prevent EP queuing while stopping transfers
        usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy-
        usb: typec: Remove vdo[3] part of tps6598x_rx_identity_reg struct
        usb-storage: Add quirk to defeat Kindle's automatic unload
        usb: gadget: configfs: Fix KASAN use-after-free
        usbip: Fix incorrect double assignment to udc->ud.tcp_rx
        usb: cdnsp: Fixes incorrect value in ISOC TRB
        thunderbolt: Increase runtime PM reference count on DP tunnel discovery
        thunderbolt: Initialize HopID IDAs in tb_switch_alloc()
      3001c355
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5ee96fa9
      Linus Torvalds authored
      Pull irq fix from Ingo Molnar:
       "A change to robustify force-threaded IRQ handlers to always disable
        interrupts, plus a DocBook fix.
      
        The force-threaded IRQ handler change has been accelerated from the
        normal schedule of such a change to keep the bad pattern/workaround of
        spin_lock_irqsave() in handlers or IRQF_NOTHREAD as a kludge from
        spreading"
      
      * tag 'irq-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq: Disable interrupts for force threaded handlers
        genirq/irq_sim: Fix typos in kernel doc (fnode -> fwnode)
      5ee96fa9
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1c74516c
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Boundary condition fixes for bugs unearthed by the perf fuzzer"
      
      * tag 'perf-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel: Fix unchecked MSR access error caused by VLBR_EVENT
        perf/x86/intel: Fix a crash caused by zero PEBS status
      1c74516c
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5ba33b48
      Linus Torvalds authored
      Pull locking fixes from Ingo Molnar:
      
       - Get static calls & modules right. Hopefully.
      
       - WW mutex fixes
      
      * tag 'locking-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        static_call: Fix static_call_update() sanity check
        static_call: Align static_call_is_init() patching condition
        static_call: Fix static_call_set_init()
        locking/ww_mutex: Fix acquire/release imbalance in ww_acquire_init()/ww_acquire_fini()
        locking/ww_mutex: Simplify use_ww_ctx & ww_ctx handling
      5ba33b48
    • Linus Torvalds's avatar
      Merge tag 'efi-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 92ed88cb
      Linus Torvalds authored
      Pull EFI fixes from Ingo Molnar:
      
       - another missing RT_PROP table related fix, to ensure that the
         efivarfs pseudo filesystem fails gracefully if variable services
         are unsupported
      
       - use the correct alignment for literal EFI GUIDs
      
       - fix a use after unmap issue in the memreserve code
      
      * tag 'efi-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi: use 32-bit alignment for efi_guid_t literals
        firmware/efi: Fix a use after bug in efi_mem_reserve_persistent
        efivars: respect EFI_UNSUPPORTED return from firmware
      92ed88cb
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5e3ddf96
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
       "The freshest pile of shiny x86 fixes for 5.12:
      
         - Add the arch-specific mapping between physical and logical CPUs to
           fix devicetree-node lookups
      
         - Restore the IRQ2 ignore logic
      
         - Fix get_nr_restart_syscall() to return the correct restart syscall
           number. Split in a 4-patches set to avoid kABI breakage when
           backporting to dead kernels"
      
      * tag 'x86_urgent_for_v5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/apic/of: Fix CPU devicetree-node lookups
        x86/ioapic: Ignore IRQ2 again
        x86: Introduce restart_block->arch_data to remove TS_COMPAT_RESTART
        x86: Introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall()
        x86: Move TS_COMPAT back to asm/thread_info.h
        kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data()
      5e3ddf96
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · b35660a7
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix a possible stack corruption and subsequent DLPAR failure in the
         rpadlpar_io PCI hotplug driver
      
       - Two build fixes for uncommon configurations
      
      Thanks to Christophe Leroy and Tyrel Datwyler.
      
      * tag 'powerpc-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        PCI: rpadlpar: Fix potential drc_name corruption in store functions
        powerpc: Force inlining of cpu_has_feature() to avoid build failure
        powerpc/vdso32: Add missing _restgpr_31_x to fix build failure
      b35660a7
    • Hans de Goede's avatar
      platform/x86: intel-vbtn: Stop reporting SW_DOCK events · 538d2dd0
      Hans de Goede authored
      Stop reporting SW_DOCK events because this breaks suspend-on-lid-close.
      
      SW_DOCK should only be reported for docking stations, but all the DSDTs in
      my DSDT collection which use the intel-vbtn code, always seem to use this
      for 2-in-1s / convertibles and set SW_DOCK=1 when in laptop-mode (in tandem
      with setting SW_TABLET_MODE=0).
      
      This causes userspace to think the laptop is docked to a port-replicator
      and to disable suspend-on-lid-close, which is undesirable.
      
      Map the dock events to KEY_IGNORE to avoid this broken SW_DOCK reporting.
      
      Note this may theoretically cause us to stop reporting SW_DOCK on some
      device where the 0xCA and 0xCB intel-vbtn events are actually used for
      reporting docking to a classic docking-station / port-replicator but
      I'm not aware of any such devices.
      
      Also the most important thing is that we only report SW_DOCK when it
      reliably reports being docked to a classic docking-station without any
      false positives, which clearly is not the case here. If there is a
      chance of reporting false positives then it is better to not report
      SW_DOCK at all.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321163513.72328-1-hdegoede@redhat.com
      538d2dd0
    • Hans de Goede's avatar
      platform/x86: dell-wmi-sysman: Cleanup create_attributes_level_sysfs_files() · 35471138
      Hans de Goede authored
      Cleanup create_attributes_level_sysfs_files():
      
      1. There is no need to call sysfs_remove_file() on error, sysman_init()
      will already call release_attributes_data() on failure which already does
      this.
      
      2. There is no need for the pr_debug() calls sysfs_create_file() should
      never fail and if it does it will already complain about the problem
      itself.
      
      Fixes: e8a60aa7 ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
      Cc: Divya Bharathi <Divya_Bharathi@dell.com>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321115901.35072-8-hdegoede@redhat.com
      35471138
    • Hans de Goede's avatar
      platform/x86: dell-wmi-sysman: Make sysman_init() return -ENODEV of the interfaces are not found · 32418dd5
      Hans de Goede authored
      When either the attributes or the password interface is not found, then
      unregister the 2 wmi drivers again and return -ENODEV from sysman_init().
      
      Fixes: e8a60aa7 ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
      Cc: Divya Bharathi <Divya_Bharathi@dell.com>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Reported-by: default avatarAlexander Naumann <alexandernaumann@gmx.de>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321115901.35072-7-hdegoede@redhat.com
      32418dd5
    • Hans de Goede's avatar
      platform/x86: dell-wmi-sysman: Cleanup sysman_init() error-exit handling · 9c90cd86
      Hans de Goede authored
      Cleanup sysman_init() error-exit handling:
      
      1. There is no need for the fail_reset_bios and fail_authentication_kset
         eror-exit cases, these can be handled by release_attributes_data()
      
      2. Rename all the labels from fail_what_failed, to err_what_to_cleanup
         this is the usual way to name these and avoids the need to rename
         them when extra steps are added.
      
      Fixes: e8a60aa7 ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
      Cc: Divya Bharathi <Divya_Bharathi@dell.com>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321115901.35072-6-hdegoede@redhat.com
      9c90cd86
    • Hans de Goede's avatar
      platform/x86: dell-wmi-sysman: Fix release_attributes_data() getting called... · 59bbbeb9
      Hans de Goede authored
      platform/x86: dell-wmi-sysman: Fix release_attributes_data() getting called twice on init_bios_attributes() failure
      
      All calls of init_bios_attributes() will result in a
      goto fail_create_group if they fail, which calls
      release_attributes_data().
      
      So there is no need to call release_attributes_data() from
      init_bios_attributes() on failure itself.
      
      Fixes: e8a60aa7 ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
      Cc: Divya Bharathi <Divya_Bharathi@dell.com>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321115901.35072-5-hdegoede@redhat.com
      59bbbeb9
    • Hans de Goede's avatar
      platform/x86: dell-wmi-sysman: Make it safe to call exit_foo_attributes() multiple times · 2d0c418c
      Hans de Goede authored
      During some of the error-exit paths it is possible that
      release_attributes_data() will get called multiple times,
      which results in exit_foo_attributes() getting called multiple
      times.
      
      Make it safe to call exit_foo_attributes() multiple times,
      avoiding double-free()s in this case.
      
      Note that release_attributes_data() really should only be called
      once during error-exit paths. This will be fixed in a separate patch
      and it is good to have the exit_foo_attributes() functions modified
      this way regardless.
      
      Fixes: e8a60aa7 ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
      Cc: Divya Bharathi <Divya_Bharathi@dell.com>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321115901.35072-4-hdegoede@redhat.com
      2d0c418c
    • Hans de Goede's avatar
      platform/x86: dell-wmi-sysman: Fix possible NULL pointer deref on exit · c59ab4ce
      Hans de Goede authored
      It is possible for release_attributes_data() to get called when the
      main_dir_kset has not been created yet, move the removal of the bios-reset
      sysfs attr to under a if (main_dir_kset) check to avoid a NULL pointer
      deref.
      
      Fixes: e8a60aa7 ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
      Cc: Divya Bharathi <Divya_Bharathi@dell.com>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Reported-by: default avatarAlexander Naumann <alexandernaumann@gmx.de>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321115901.35072-3-hdegoede@redhat.com
      c59ab4ce
    • Hans de Goede's avatar
      platform/x86: dell-wmi-sysman: Fix crash caused by calling kset_unregister twice · d939cd96
      Hans de Goede authored
      On some system the WMI GUIDs used by dell-wmi-sysman are present but there
      are no enum type attributes, this causes init_bios_attributes() to return
      -ENODEV, after which sysman_init() does a "goto fail_create_group" and then
      calls release_attributes_data().
      
      release_attributes_data() calls kset_unregister(wmi_priv.main_dir_kset);
      but before this commit it was missing a "wmi_priv.main_dir_kset = NULL;"
      statement; and after calling release_attributes_data() the sysman_init()
      error handling does this:
      
              if (wmi_priv.main_dir_kset) {
                      kset_unregister(wmi_priv.main_dir_kset);
                      wmi_priv.main_dir_kset = NULL;
              }
      
      Which causes a second kset_unregister(wmi_priv.main_dir_kset), leading to
      a double-free, which causes a crash.
      
      Add the missing "wmi_priv.main_dir_kset = NULL;" statement to
      release_attributes_data() to fix this double-free crash.
      
      Fixes: e8a60aa7 ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
      Cc: Divya Bharathi <Divya_Bharathi@dell.com>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321115901.35072-2-hdegoede@redhat.com
      d939cd96
    • Hans de Goede's avatar
      platform/x86: thinkpad_acpi: Disable DYTC CQL mode around switching to balanced mode · ec0e8fc4
      Hans de Goede authored
      Testing has shown that setting /sys/firmware/acpi/platform_profile to
      "balanced" when /sys/bus/platform/devices/thinkpad_acpi/dytc_lapmode
      reports 1, causes dytc_lapmode to get reset to 0 and then it becomes
      stuck at 0 for aprox. 30 minutes even if the laptop is used on a lap.
      
      Disabling CQL (when enabled) before issuing the DYTC_CMD_RESET to get
      back to balanced mode and re-enabling it afterwards again, like the
      code already does when switching to low-power / performance mode fixes
      this.
      
      Fixes: c3bfcd4c ("platform/x86: thinkpad_acpi: Add platform profile support")
      Tested-by: default avatarMark Pearson <markpearson@lenovo.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20210321113108.7069-1-hdegoede@redhat.com
      ec0e8fc4
    • Esteve Varela Colominas's avatar
      platform/x86: thinkpad_acpi: Allow the FnLock LED to change state · 3d677f12
      Esteve Varela Colominas authored
      On many recent ThinkPad laptops, there's a new LED next to the ESC key,
      that indicates the FnLock status.
      When the Fn+ESC combo is pressed, FnLock is toggled, which causes the
      Media Key functionality to change, making it so that the media keys
      either perform their media key function, or function as an F-key by
      default. The Fn key can be used the access the alternate function at any
      time.
      
      With the current linux kernel, the LED doens't change state if you press
      the Fn+ESC key combo. However, the media key functionality *does*
      change. This is annoying, since the LED will stay on if it was on during
      bootup, and it makes it hard to keep track what the current state of the
      FnLock is.
      
      This patch calls an ACPI function, that gets the current media key
      state, when the Fn+ESC key combo is pressed. Through testing it was
      discovered that this function causes the LED to update correctly to
      reflect the current state when this function is called.
      
      The relevant ACPI calls are the following:
      \_SB_.PCI0.LPC0.EC0_.HKEY.GMKS: Get media key state, returns 0x603 if the FnLock mode is enabled, and 0x602 if it's disabled.
      \_SB_.PCI0.LPC0.EC0_.HKEY.SMKS: Set media key state, sending a 1 will enable FnLock mode, and a 0 will disable it.
      
      Relevant discussion:
      https://bugzilla.kernel.org/show_bug.cgi?id=207841
      https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1881015Signed-off-by: default avatarEsteve Varela Colominas <esteve.varela@gmail.com>
      Link: https://lore.kernel.org/r/20210315195823.23212-1-esteve.varela@gmail.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      3d677f12
    • Stefan Metzmacher's avatar
      io_uring: call req_set_fail_links() on short send[msg]()/recv[msg]() with MSG_WAITALL · 0031275d
      Stefan Metzmacher authored
      Without that it's not safe to use them in a linked combination with
      others.
      
      Now combinations like IORING_OP_SENDMSG followed by IORING_OP_SPLICE
      should be possible.
      
      We already handle short reads and writes for the following opcodes:
      
      - IORING_OP_READV
      - IORING_OP_READ_FIXED
      - IORING_OP_READ
      - IORING_OP_WRITEV
      - IORING_OP_WRITE_FIXED
      - IORING_OP_WRITE
      - IORING_OP_SPLICE
      - IORING_OP_TEE
      
      Now we have it for these as well:
      
      - IORING_OP_SENDMSG
      - IORING_OP_SEND
      - IORING_OP_RECVMSG
      - IORING_OP_RECV
      
      For IORING_OP_RECVMSG we also check for the MSG_TRUNC and MSG_CTRUNC
      flags in order to call req_set_fail_links().
      
      There might be applications arround depending on the behavior
      that even short send[msg]()/recv[msg]() retuns continue an
      IOSQE_IO_LINK chain.
      
      It's very unlikely that such applications pass in MSG_WAITALL,
      which is only defined in 'man 2 recvmsg', but not in 'man 2 sendmsg'.
      
      It's expected that the low level sock_sendmsg() call just ignores
      MSG_WAITALL, as MSG_ZEROCOPY is also ignored without explicitly set
      SO_ZEROCOPY.
      
      We also expect the caller to know about the implicit truncation to
      MAX_RW_COUNT, which we don't detect.
      
      cc: netdev@vger.kernel.org
      Link: https://lore.kernel.org/r/c4e1a4cc0d905314f4d5dc567e65a7b09621aab3.1615908477.git.metze@samba.orgSigned-off-by: default avatarStefan Metzmacher <metze@samba.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      0031275d
    • Jens Axboe's avatar
      io-wq: ensure task is running before processing task_work · 00ddff43
      Jens Axboe authored
      Mark the current task as running if we need to run task_work from the
      io-wq threads as part of work handling. If that is the case, then return
      as such so that the caller can appropriately loop back and reset if it
      was part of a going-to-sleep flush.
      
      Fixes: 3bfe6106 ("io-wq: fork worker threads from original task")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      00ddff43