diff --git a/linux-lts/config b/linux-lts/config index e89760c..effdaf6 100644 --- a/linux-lts/config +++ b/linux-lts/config @@ -3416,7 +3416,7 @@ CONFIG_SLIP=m CONFIG_SLHC=m CONFIG_SLIP_COMPRESSED=y CONFIG_SLIP_SMART=y -CONFIG_SLIP_MODE_SLIP6=y +CONFIG_SLIP_MODE_SLIP6=n CONFIG_USB_NET_DRIVERS=m CONFIG_USB_CATC=m CONFIG_USB_KAWETH=m @@ -8059,12 +8059,12 @@ CONFIG_XEN_UNPOPULATED_ALLOC=y CONFIG_STAGING=y CONFIG_PRISM2_USB=m # CONFIG_COMEDI is not set -CONFIG_RTL8192U=y +CONFIG_RTL8192U=m CONFIG_RTLLIB=m CONFIG_RTLLIB_CRYPTO_CCMP=m CONFIG_RTLLIB_CRYPTO_TKIP=m CONFIG_RTLLIB_CRYPTO_WEP=m -CONFIG_RTL8192E=y +CONFIG_RTL8192E=m CONFIG_RTL8723BS=m CONFIG_R8712U=m CONFIG_R8188EU=m @@ -9717,6 +9717,7 @@ CONFIG_CRYPTO_RSA=y CONFIG_CRYPTO_DH=y CONFIG_CRYPTO_ECC=y CONFIG_CRYPTO_ECDH=m +CONFIG_CRYPTO_ECDSA=y CONFIG_CRYPTO_ECRDSA=m CONFIG_CRYPTO_SM2=m CONFIG_CRYPTO_CURVE25519=m diff --git a/linux/PKGBUILD b/linux/PKGBUILD index 7680245..86737ce 100644 --- a/linux/PKGBUILD +++ b/linux/PKGBUILD @@ -6,11 +6,10 @@ #-----------------------------------------| DESCRIPTION |--------------------------------------- pkgbase=linux -pkgver=5.15.104 +pkgver=5.15.106 pkgrel=01 pkgdesc='Linux LTS 5.15 w/o zstd ipv6' url="https://www.kernel.org/" -arch=(x86_64) makedepends=( bc libelf pahole cpio perl tar xz kmod xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick) @@ -24,7 +23,6 @@ source=( 0003-iommu-intel-do-deep-dma-unmapping-to-avoid-kernel-fl.patch 0004-Bluetooth-btintel-Fix-bdaddress-comparison-with-garb.patch 0005-lg-laptop-Recognize-more-models.patch -# 0006-Fix-NFSv4-mount-regression.patch sha256sums::https://cdn.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc) export KBUILD_BUILD_HOST=joborun @@ -215,18 +213,17 @@ validpgpkeys=(ABAF11C65A2970B130ABE3C479BE3E4300411886 # Linus Torvalds A2FF3A36AAA56654109064AB19802F8B0D70FC30) # Jan Alexander Steffens (heftig) # https://cdn.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc --> sha256sums -# 71c532ce09992e470f3259ffeb38d2b5bba990c243a559e4726a57412bd36b54 linux-5.15.104.tar.xz +# 84e6934f828033570966e2a56fe8b72dc6e1409be296c66f4bf3c8ca6e3c8fe4 linux-5.15.106.tar.xz -sha256sums=(71c532ce09992e470f3259ffeb38d2b5bba990c243a559e4726a57412bd36b54 # linux-5.15.104.tar.xz - b9d1812d8a1cd0982794153bd9fe929d2b080179cb064791e3b17fc910e3a873 # linux-5.15.104.tar.sign - 8c4a1dd0c39541f2f4cb0ebae0c3a168928a2bd036467efacad5302d3e394dfe # config +sha256sums=(84e6934f828033570966e2a56fe8b72dc6e1409be296c66f4bf3c8ca6e3c8fe4 # linux-5.15.106.tar.xz + 9687c22e00c141703b98c59402058e250b0238af92b59b21693267e1bf820951 # linux-5.15.106.tar.sign + f77d1639fdf0315b590aa6783baf91695c40fc8127a44163a84bf97908768230 # config 3b5cfc9ca9cf778ea2c4b619b933cda26519969df2d764b5a687f63cf59974cd # 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch c175fbb141c3cec013c799f694d88310375ac5456042f6a4a1adc7667836d786 # 0002-PCI-Add-more-NVIDIA-controllers-to-the-MSI-masking-q.patch 8357f000b2b622e73dcfd41c2bad42b5e99fffe8f7ee64f774aa771f86cef43c # 0003-iommu-intel-do-deep-dma-unmapping-to-avoid-kernel-fl.patch 5c1ee81fdd5818442af6081de987f9c1a9ce3c8d183566b3dfc19a8433aa3dde # 0004-Bluetooth-btintel-Fix-bdaddress-comparison-with-garb.patch 067e8995fcd6f6ed25e0253e9374c0e179a000c154da3e59ce62634945ac5be9 # 0005-lg-laptop-Recognize-more-models.patch - ce55714ecfde10c881f219a379945bff6a666d1777af96ca96b32d8e1a2f1d1f) # sha256sums - -## 676cd2e5c209f7ccf81b97e14e90348be3eaa24eb51163a36dd7df7e71d6ea13 linux-5.15.104-01-x86_64.pkg.tar.lz -## 4d168b633e37c0fab1d9408e03de9aae669784018ce92acd14b5a22f3754bcb3 linux-headers-5.15.104-01-x86_64.pkg.tar.lz + 85176af2c453d0eef080581b5b19e39b1f2de879f5f400da244fabd7a4014729) # sha256sums +## a4dc6387baf4a20533b7f1878cea887f61fbdef6e5901482dd72af3c9c76c9ea linux-5.15.106-01-x86_64.pkg.tar.lz +## d78abb64cbca8fabc1754195ccc43fe90cb0d4c48a4d971ab9c533ecc23c695f linux-headers-5.15.106-01-x86_64.pkg.tar.lz diff --git a/linux/PKGBUILD-aur.105 b/linux/PKGBUILD-aur.105 new file mode 100644 index 0000000..c594169 --- /dev/null +++ b/linux/PKGBUILD-aur.105 @@ -0,0 +1,272 @@ +# Maintainer: Andreas Baumann +# Contributor: Andreas Radke + +pkgbase=linux-lts515 +pkgver=5.15.105 +pkgrel=3 +pkgdesc='LTS Linux 5.15.x' +url="https://www.kernel.org/" +arch=(x86_64 pentium4 i686 i486) +license=(GPL2) +makedepends=( + bc libelf pahole cpio perl tar xz + xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick texlive-latexextra +) +options=('!strip') +_srcname=linux-$pkgver +source=( + https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.{xz,sign} + config # the main kernel config file + 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + 0002-PCI-Add-more-NVIDIA-controllers-to-the-MSI-masking-q.patch + 0003-iommu-intel-do-deep-dma-unmapping-to-avoid-kernel-fl.patch + 0004-Bluetooth-btintel-Fix-bdaddress-comparison-with-garb.patch + 0005-lg-laptop-Recognize-more-models.patch +) +validpgpkeys=( + 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds + '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman +) +# https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc +sha256sums=('01b537650332d2852722a626169cf7e5e798d11f9b578171b477868555f5e44f' + 'SKIP' + '7b80ea3c8cd2cd4bbb079b565770eaac31c13c64fe3ce519c3ed2aa6c85af547' + '3b5cfc9ca9cf778ea2c4b619b933cda26519969df2d764b5a687f63cf59974cd' + 'c175fbb141c3cec013c799f694d88310375ac5456042f6a4a1adc7667836d786' + '8357f000b2b622e73dcfd41c2bad42b5e99fffe8f7ee64f774aa771f86cef43c' + '5c1ee81fdd5818442af6081de987f9c1a9ce3c8d183566b3dfc19a8433aa3dde' + '067e8995fcd6f6ed25e0253e9374c0e179a000c154da3e59ce62634945ac5be9') + +export KBUILD_BUILD_HOST=archlinux +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" + +prepare() { + cd $_srcname + + echo "Setting version..." + scripts/setlocalversion --save-scmversion + echo "-$pkgrel" > localversion.10-pkgrel + echo "${pkgbase#linux}" > localversion.20-pkgname + + local src + for src in "${source[@]}"; do + src="${src%%::*}" + src="${src##*/}" + [[ $src = *.patch ]] || continue + echo "Applying patch $src..." + patch -Np1 < "../$src" + done + + echo "Setting config..." + cp ../config .config + make olddefconfig + diff -u ../config .config || : + + make -s kernelrelease > version + echo "Prepared $pkgbase version $( $@ + + quiet_cmd_zstd22 = ZSTD22 $@ +- cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@ ++ cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@ + + # ASM offsets + # --------------------------------------------------------------------------- diff --git a/linux/reference-material/0002-PCI_Add_more_NVIDIA_controllers_to_the_MSI_masking_quirk.patch b/linux/reference-material/0002-PCI_Add_more_NVIDIA_controllers_to_the_MSI_masking_quirk.patch new file mode 100644 index 0000000..fa304d6 --- /dev/null +++ b/linux/reference-material/0002-PCI_Add_more_NVIDIA_controllers_to_the_MSI_masking_quirk.patch @@ -0,0 +1,21 @@ +From 0bb6e4f104167b1e283269b46f3bbd30b2d979a7 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Thu, 18 Nov 2021 22:53:31 +0100 +Subject: [PATCH] PCI: Add more NVIDIA controllers to the MSI masking quirk + +For: https://bugs.archlinux.org/task/72734 +For: https://bugs.archlinux.org/task/72777 +--- + drivers/pci/quirks.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c +index 208fa03acdda0..7fdb7e9c2e12c 100644 +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -5802,3 +5802,5 @@ static void nvidia_ion_ahci_fixup(struct pci_dev *pdev) + pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING; + } + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab8, nvidia_ion_ahci_fixup); ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab9, nvidia_ion_ahci_fixup); ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0d88, nvidia_ion_ahci_fixup); diff --git a/linux/reference-material/0003-iommu_intel_do_deep_dma-unmapping_to_avoid_kernel-flooding.patch b/linux/reference-material/0003-iommu_intel_do_deep_dma-unmapping_to_avoid_kernel-flooding.patch new file mode 100644 index 0000000..13aa5a0 --- /dev/null +++ b/linux/reference-material/0003-iommu_intel_do_deep_dma-unmapping_to_avoid_kernel-flooding.patch @@ -0,0 +1,85 @@ +From 32803dc7c2ffc29db15a46034d818f6e6c5775ef Mon Sep 17 00:00:00 2001 +From: Ajay Garg +Date: Tue, 12 Oct 2021 19:26:53 +0530 +Subject: [PATCH] iommu: intel: do deep dma-unmapping, to avoid + kernel-flooding. + +Origins at : +https://lists.linuxfoundation.org/pipermail/iommu/2021-October/thread.html + +=== Changes from v1 => v2 === + +a) +Improved patch-description. + +b) +A more root-level fix, as suggested by + + 1. + Alex Williamson + + 2. + Lu Baolu + +=== Issue === + +Kernel-flooding is seen, when an x86_64 L1 guest (Ubuntu-21) is booted in qemu/kvm +on a x86_64 host (Ubuntu-21), with a host-pci-device attached. + +Following kind of logs, along with the stacktraces, cause the flood : + +...... + DMAR: ERROR: DMA PTE for vPFN 0x428ec already set (to 3f6ec003 not 3f6ec003) + DMAR: ERROR: DMA PTE for vPFN 0x428ed already set (to 3f6ed003 not 3f6ed003) + DMAR: ERROR: DMA PTE for vPFN 0x428ee already set (to 3f6ee003 not 3f6ee003) + DMAR: ERROR: DMA PTE for vPFN 0x428ef already set (to 3f6ef003 not 3f6ef003) + DMAR: ERROR: DMA PTE for vPFN 0x428f0 already set (to 3f6f0003 not 3f6f0003) +...... + +=== Current Behaviour, leading to the issue === + +Currently, when we do a dma-unmapping, we unmap/unlink the mappings, but +the pte-entries are not cleared. + +Thus, following sequencing would flood the kernel-logs : + +i) +A dma-unmapping makes the real/leaf-level pte-slot invalid, but the +pte-content itself is not cleared. + +ii) +Now, during some later dma-mapping procedure, as the pte-slot is about +to hold a new pte-value, the intel-iommu checks if a prior +pte-entry exists in the pte-slot. If it exists, it logs a kernel-error, +along with a corresponding stacktrace. + +iii) +Step ii) runs in abundance, and the kernel-logs run insane. + +=== Fix === + +We ensure that as part of a dma-unmapping, each (unmapped) pte-slot +is also cleared of its value/content (at the leaf-level, where the +real mapping from a iova => pfn mapping is stored). + +This completes a "deep" dma-unmapping. + +Signed-off-by: Ajay Garg +Link: https://lore.kernel.org/linux-iommu/20211012135653.3852-1-ajaygargnsit@gmail.com/ +--- + drivers/iommu/intel/iommu.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c +index 78f8c8e6803e9..d8da48a91ba3b 100644 +--- a/drivers/iommu/intel/iommu.c ++++ b/drivers/iommu/intel/iommu.c +@@ -5092,6 +5092,8 @@ static size_t intel_iommu_unmap(struct iommu_domain *domain, + gather->freelist = domain_unmap(dmar_domain, start_pfn, + last_pfn, gather->freelist); + ++ dma_pte_clear_range(dmar_domain, start_pfn, last_pfn); ++ + if (dmar_domain->max_addr == iova + size) + dmar_domain->max_addr = iova; + diff --git a/linux/reference-material/0004-Bluetooth_btintel_Fix_bdaddress_comparison_with_garbage_value.patch b/linux/reference-material/0004-Bluetooth_btintel_Fix_bdaddress_comparison_with_garbage_value.patch new file mode 100644 index 0000000..3697425 --- /dev/null +++ b/linux/reference-material/0004-Bluetooth_btintel_Fix_bdaddress_comparison_with_garbage_value.patch @@ -0,0 +1,57 @@ +From a6d4fb4f5e7fe795d9e3b28b261a0f86f1026d03 Mon Sep 17 00:00:00 2001 +From: Kiran K +Date: Wed, 13 Oct 2021 13:35:11 +0530 +Subject: [PATCH] Bluetooth: btintel: Fix bdaddress comparison with garbage + value + +Intel Read Verision(TLV) data is parsed into a local structure variable +and it contains a field for bd address. Bd address is returned only in +bootloader mode and hence bd address in TLV structure needs to be validated +only if controller is present in boot loader mode. + +Signed-off-by: Kiran K +Reviewed-by: Tedd Ho-Jeong An +--- + drivers/bluetooth/btintel.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c +index f1705b46fc889..b9055a3e61ed7 100644 +--- a/drivers/bluetooth/btintel.c ++++ b/drivers/bluetooth/btintel.c +@@ -2006,14 +2006,16 @@ static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev, + if (ver->img_type == 0x03) { + btintel_clear_flag(hdev, INTEL_BOOTLOADER); + btintel_check_bdaddr(hdev); +- } +- +- /* If the OTP has no valid Bluetooth device address, then there will +- * also be no valid address for the operational firmware. +- */ +- if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) { +- bt_dev_info(hdev, "No device address configured"); +- set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); ++ } else { ++ /* ++ * Check for valid bd address in boot loader mode. Device ++ * will be marked as unconfigured if empty bd address is ++ * found. ++ */ ++ if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) { ++ bt_dev_info(hdev, "No device address configured"); ++ set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); ++ } + } + + btintel_get_fw_name_tlv(ver, fwname, sizeof(fwname), "sfi"); +@@ -2303,6 +2305,10 @@ static int btintel_setup_combined(struct hci_dev *hdev) + goto exit_error; + } + ++ /* memset ver_tlv to start with clean state as few fields are exclusive ++ * to bootloader mode and are not populated in operational mode ++ */ ++ memset(&ver_tlv, 0, sizeof(ver_tlv)); + /* For TLV type device, parse the tlv data */ + err = btintel_parse_version_tlv(hdev, &ver_tlv, skb); + if (err) { diff --git a/linux/reference-material/0004-cpufreq_intel_pstate_ITMT_support_for_overclocked_system.patch b/linux/reference-material/0004-cpufreq_intel_pstate_ITMT_support_for_overclocked_system.patch new file mode 100644 index 0000000..4c0a62d --- /dev/null +++ b/linux/reference-material/0004-cpufreq_intel_pstate_ITMT_support_for_overclocked_system.patch @@ -0,0 +1,51 @@ +From aa7300919d0656a001fe0d526508b8c5958e7630 Mon Sep 17 00:00:00 2001 +From: Srinivas Pandruvada +Date: Thu, 18 Nov 2021 21:18:01 -0800 +Subject: [PATCH] cpufreq: intel_pstate: ITMT support for overclocked system + +On systems with overclocking enabled, CPPC Highest Performance can be +hard coded to 0xff. In this case even if we have cores with different +highest performance, ITMT can't be enabled as the current implementation +depends on CPPC Highest Performance. + +On such systems we can use MSR_HWP_CAPABILITIES maximum performance field +when CPPC.Highest Performance is 0xff. + +Due to legacy reasons, we can't solely depend on MSR_HWP_CAPABILITIES as +in some older systems CPPC Highest Performance is the only way to identify +different performing cores. + +Reported-by: Michael Larabel +Signed-off-by: Srinivas Pandruvada +--- + drivers/cpufreq/intel_pstate.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c +index e15c3bc17a55c..8a2c6b58b6524 100644 +--- a/drivers/cpufreq/intel_pstate.c ++++ b/drivers/cpufreq/intel_pstate.c +@@ -335,6 +335,8 @@ static void intel_pstste_sched_itmt_work_fn(struct work_struct *work) + + static DECLARE_WORK(sched_itmt_work, intel_pstste_sched_itmt_work_fn); + ++#define CPPC_MAX_PERF U8_MAX ++ + static void intel_pstate_set_itmt_prio(int cpu) + { + struct cppc_perf_caps cppc_perf; +@@ -345,6 +347,14 @@ static void intel_pstate_set_itmt_prio(int cpu) + if (ret) + return; + ++ /* ++ * On some systems with overclocking enabled, CPPC.highest_perf is hardcoded to 0xff. ++ * In this case we can't use CPPC.highest_perf to enable ITMT. ++ * In this case we can look at MSR_HWP_CAPABILITIES bits [8:0] to decide. ++ */ ++ if (cppc_perf.highest_perf == CPPC_MAX_PERF) ++ cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached)); ++ + /* + * The priorities can be set regardless of whether or not + * sched_set_itmt_support(true) has been called and it is valid to diff --git a/linux/reference-material/0005-Bluetooth_btintel_Fix_bdaddress_comparison_with_garbage_value.patch b/linux/reference-material/0005-Bluetooth_btintel_Fix_bdaddress_comparison_with_garbage_value.patch new file mode 100644 index 0000000..3697425 --- /dev/null +++ b/linux/reference-material/0005-Bluetooth_btintel_Fix_bdaddress_comparison_with_garbage_value.patch @@ -0,0 +1,57 @@ +From a6d4fb4f5e7fe795d9e3b28b261a0f86f1026d03 Mon Sep 17 00:00:00 2001 +From: Kiran K +Date: Wed, 13 Oct 2021 13:35:11 +0530 +Subject: [PATCH] Bluetooth: btintel: Fix bdaddress comparison with garbage + value + +Intel Read Verision(TLV) data is parsed into a local structure variable +and it contains a field for bd address. Bd address is returned only in +bootloader mode and hence bd address in TLV structure needs to be validated +only if controller is present in boot loader mode. + +Signed-off-by: Kiran K +Reviewed-by: Tedd Ho-Jeong An +--- + drivers/bluetooth/btintel.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c +index f1705b46fc889..b9055a3e61ed7 100644 +--- a/drivers/bluetooth/btintel.c ++++ b/drivers/bluetooth/btintel.c +@@ -2006,14 +2006,16 @@ static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev, + if (ver->img_type == 0x03) { + btintel_clear_flag(hdev, INTEL_BOOTLOADER); + btintel_check_bdaddr(hdev); +- } +- +- /* If the OTP has no valid Bluetooth device address, then there will +- * also be no valid address for the operational firmware. +- */ +- if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) { +- bt_dev_info(hdev, "No device address configured"); +- set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); ++ } else { ++ /* ++ * Check for valid bd address in boot loader mode. Device ++ * will be marked as unconfigured if empty bd address is ++ * found. ++ */ ++ if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) { ++ bt_dev_info(hdev, "No device address configured"); ++ set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); ++ } + } + + btintel_get_fw_name_tlv(ver, fwname, sizeof(fwname), "sfi"); +@@ -2303,6 +2305,10 @@ static int btintel_setup_combined(struct hci_dev *hdev) + goto exit_error; + } + ++ /* memset ver_tlv to start with clean state as few fields are exclusive ++ * to bootloader mode and are not populated in operational mode ++ */ ++ memset(&ver_tlv, 0, sizeof(ver_tlv)); + /* For TLV type device, parse the tlv data */ + err = btintel_parse_version_tlv(hdev, &ver_tlv, skb); + if (err) { diff --git a/linux/reference-material/0005-lg-laptop_Recognize_more_models.patch b/linux/reference-material/0005-lg-laptop_Recognize_more_models.patch new file mode 100644 index 0000000..9031085 --- /dev/null +++ b/linux/reference-material/0005-lg-laptop_Recognize_more_models.patch @@ -0,0 +1,36 @@ +From 72edf8c167268bb68d701f46006ccfdfa5490db8 Mon Sep 17 00:00:00 2001 +From: Matan Ziv-Av +Date: Tue, 23 Nov 2021 22:14:55 +0200 +Subject: [PATCH] lg-laptop: Recognize more models + +LG uses 5 instead of 0 in the third digit (second digit after 2019) of the year string to indicate newer models in the same year. Handle this case as well. + +Signed-off-by: Matan Ziv-Av +For: https://bugs.archlinux.org/task/71772 +--- + drivers/platform/x86/lg-laptop.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c +index 88b551caeaaf4..d6f74d3a7605e 100644 +--- a/drivers/platform/x86/lg-laptop.c ++++ b/drivers/platform/x86/lg-laptop.c +@@ -658,6 +658,18 @@ static int acpi_add(struct acpi_device *device) + if (product && strlen(product) > 4) + switch (product[4]) { + case '5': ++ if (strlen(product) > 5) ++ switch (product[5]) { ++ case 'N': ++ year = 2021; ++ break; ++ case '0': ++ year = 2016; ++ break; ++ default: ++ year = 2022; ++ } ++ break; + case '6': + year = 2016; + break; diff --git a/linux/reference-material/0006-Fix-NFSv4-mount-regression.patch b/linux/reference-material/0006-Fix-NFSv4-mount-regression.patch new file mode 100644 index 0000000..2fda928 --- /dev/null +++ b/linux/reference-material/0006-Fix-NFSv4-mount-regression.patch @@ -0,0 +1,238 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Sat, 6 Aug 2022 22:54:33 +0200 +Subject: [PATCH] Fix NFSv4 mount regression + +This reverts commit 6f2836341d8a (NFSv4.1 query for fs_location attr on +a new file system, 2022-01-12). + +For: https://bugs.archlinux.org/task/73838 +For: https://bugs.archlinux.org/task/73860 +--- + fs/nfs/client.c | 7 ---- + fs/nfs/nfs4_fs.h | 9 +++-- + fs/nfs/nfs4proc.c | 76 ++++++----------------------------------- + fs/nfs/nfs4state.c | 3 +- + include/linux/nfs_xdr.h | 1 - + 5 files changed, 15 insertions(+), 81 deletions(-) + +diff --git a/fs/nfs/client.c b/fs/nfs/client.c +index 090b16890e3d..551833862171 100644 +--- a/fs/nfs/client.c ++++ b/fs/nfs/client.c +@@ -860,13 +860,6 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs + server->namelen = pathinfo.max_namelen; + } + +- if (clp->rpc_ops->discover_trunking != NULL && +- (server->caps & NFS_CAP_FS_LOCATIONS)) { +- error = clp->rpc_ops->discover_trunking(server, mntfh); +- if (error < 0) +- return error; +- } +- + return 0; + } + EXPORT_SYMBOL_GPL(nfs_probe_fsinfo); +diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h +index f8672a34fd63..36471dd0e82b 100644 +--- a/fs/nfs/nfs4_fs.h ++++ b/fs/nfs/nfs4_fs.h +@@ -261,8 +261,8 @@ struct nfs4_state_maintenance_ops { + }; + + struct nfs4_mig_recovery_ops { +- int (*get_locations)(struct nfs_server *, struct nfs_fh *, +- struct nfs4_fs_locations *, struct page *, const struct cred *); ++ int (*get_locations)(struct inode *, struct nfs4_fs_locations *, ++ struct page *, const struct cred *); + int (*fsid_present)(struct inode *, const struct cred *); + }; + +@@ -304,9 +304,8 @@ extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait); + extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); + extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *, + struct nfs4_fs_locations *, struct page *); +-extern int nfs4_proc_get_locations(struct nfs_server *, struct nfs_fh *, +- struct nfs4_fs_locations *, +- struct page *page, const struct cred *); ++extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *, ++ struct page *page, const struct cred *); + extern int nfs4_proc_fsid_present(struct inode *, const struct cred *); + extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, + struct dentry *, +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c +index a808763c52c1..7c05dbe595ac 100644 +--- a/fs/nfs/nfs4proc.c ++++ b/fs/nfs/nfs4proc.c +@@ -3962,60 +3962,6 @@ int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle) + return err; + } + +-static int _nfs4_discover_trunking(struct nfs_server *server, +- struct nfs_fh *fhandle) +-{ +- struct nfs4_fs_locations *locations = NULL; +- struct page *page; +- const struct cred *cred; +- struct nfs_client *clp = server->nfs_client; +- const struct nfs4_state_maintenance_ops *ops = +- clp->cl_mvops->state_renewal_ops; +- int status = -ENOMEM; +- +- cred = ops->get_state_renewal_cred(clp); +- if (cred == NULL) { +- cred = nfs4_get_clid_cred(clp); +- if (cred == NULL) +- return -ENOKEY; +- } +- +- page = alloc_page(GFP_KERNEL); +- locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL); +- if (page == NULL || locations == NULL) +- goto out; +- +- status = nfs4_proc_get_locations(server, fhandle, locations, page, +- cred); +- if (status) +- goto out; +-out: +- if (page) +- __free_page(page); +- kfree(locations); +- return status; +-} +- +-static int nfs4_discover_trunking(struct nfs_server *server, +- struct nfs_fh *fhandle) +-{ +- struct nfs4_exception exception = { +- .interruptible = true, +- }; +- struct nfs_client *clp = server->nfs_client; +- int err = 0; +- +- if (!nfs4_has_session(clp)) +- goto out; +- do { +- err = nfs4_handle_exception(server, +- _nfs4_discover_trunking(server, fhandle), +- &exception); +- } while (exception.retry); +-out: +- return err; +-} +- + static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, + struct nfs_fsinfo *info) + { +@@ -7951,18 +7897,18 @@ int nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir, + * appended to this compound to identify the client ID which is + * performing recovery. + */ +-static int _nfs40_proc_get_locations(struct nfs_server *server, +- struct nfs_fh *fhandle, ++static int _nfs40_proc_get_locations(struct inode *inode, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { ++ struct nfs_server *server = NFS_SERVER(inode); + struct rpc_clnt *clnt = server->client; + u32 bitmask[2] = { + [0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS, + }; + struct nfs4_fs_locations_arg args = { + .clientid = server->nfs_client->cl_clientid, +- .fh = fhandle, ++ .fh = NFS_FH(inode), + .page = page, + .bitmask = bitmask, + .migration = 1, /* skip LOOKUP */ +@@ -8008,17 +7954,17 @@ static int _nfs40_proc_get_locations(struct nfs_server *server, + * When the client supports GETATTR(fs_locations_info), it can + * be plumbed in here. + */ +-static int _nfs41_proc_get_locations(struct nfs_server *server, +- struct nfs_fh *fhandle, ++static int _nfs41_proc_get_locations(struct inode *inode, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { ++ struct nfs_server *server = NFS_SERVER(inode); + struct rpc_clnt *clnt = server->client; + u32 bitmask[2] = { + [0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS, + }; + struct nfs4_fs_locations_arg args = { +- .fh = fhandle, ++ .fh = NFS_FH(inode), + .page = page, + .bitmask = bitmask, + .migration = 1, /* skip LOOKUP */ +@@ -8067,28 +8013,27 @@ static int _nfs41_proc_get_locations(struct nfs_server *server, + * -NFS4ERR_LEASE_MOVED is returned if the server still has leases + * from this client that require migration recovery. + */ +-int nfs4_proc_get_locations(struct nfs_server *server, +- struct nfs_fh *fhandle, ++int nfs4_proc_get_locations(struct inode *inode, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { ++ struct nfs_server *server = NFS_SERVER(inode); + struct nfs_client *clp = server->nfs_client; + const struct nfs4_mig_recovery_ops *ops = + clp->cl_mvops->mig_recovery_ops; + struct nfs4_exception exception = { + .interruptible = true, + }; + int status; + + dprintk("%s: FSID %llx:%llx on \"%s\"\n", __func__, + (unsigned long long)server->fsid.major, + (unsigned long long)server->fsid.minor, + clp->cl_hostname); +- nfs_display_fhandle(fhandle, __func__); ++ nfs_display_fhandle(NFS_FH(inode), __func__); + + do { +- status = ops->get_locations(server, fhandle, locations, page, +- cred); ++ status = ops->get_locations(inode, locations, page, cred); + if (status != -NFS4ERR_DELAY) + break; + nfs4_handle_exception(server, status, &exception); +@@ -10588,7 +10533,6 @@ const struct nfs_rpc_ops nfs_v4_clientops = { + .free_client = nfs4_free_client, + .create_server = nfs4_create_server, + .clone_server = nfs_clone_server, +- .discover_trunking = nfs4_discover_trunking, + }; + + static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = { +diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c +index 83c88b54d712..42707e12d35c 100644 +--- a/fs/nfs/nfs4state.c ++++ b/fs/nfs/nfs4state.c +@@ -2098,8 +2098,7 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred + } + + inode = d_inode(server->super->s_root); +- result = nfs4_proc_get_locations(server, NFS_FH(inode), locations, +- page, cred); ++ result = nfs4_proc_get_locations(inode, locations, page, cred); + if (result) { + dprintk("<-- %s: failed to retrieve fs_locations: %d\n", + __func__, result); +diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h +index ecd74cc34797..e9698b6278a5 100644 +--- a/include/linux/nfs_xdr.h ++++ b/include/linux/nfs_xdr.h +@@ -1805,7 +1805,6 @@ struct nfs_rpc_ops { + struct nfs_server *(*create_server)(struct fs_context *); + struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *, + struct nfs_fattr *, rpc_authflavor_t); +- int (*discover_trunking)(struct nfs_server *, struct nfs_fh *); + }; + + /* diff --git a/linux/reference-material/0006-lg-laptop_Recognize_more_models.patch b/linux/reference-material/0006-lg-laptop_Recognize_more_models.patch new file mode 100644 index 0000000..9031085 --- /dev/null +++ b/linux/reference-material/0006-lg-laptop_Recognize_more_models.patch @@ -0,0 +1,36 @@ +From 72edf8c167268bb68d701f46006ccfdfa5490db8 Mon Sep 17 00:00:00 2001 +From: Matan Ziv-Av +Date: Tue, 23 Nov 2021 22:14:55 +0200 +Subject: [PATCH] lg-laptop: Recognize more models + +LG uses 5 instead of 0 in the third digit (second digit after 2019) of the year string to indicate newer models in the same year. Handle this case as well. + +Signed-off-by: Matan Ziv-Av +For: https://bugs.archlinux.org/task/71772 +--- + drivers/platform/x86/lg-laptop.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c +index 88b551caeaaf4..d6f74d3a7605e 100644 +--- a/drivers/platform/x86/lg-laptop.c ++++ b/drivers/platform/x86/lg-laptop.c +@@ -658,6 +658,18 @@ static int acpi_add(struct acpi_device *device) + if (product && strlen(product) > 4) + switch (product[4]) { + case '5': ++ if (strlen(product) > 5) ++ switch (product[5]) { ++ case 'N': ++ year = 2021; ++ break; ++ case '0': ++ year = 2016; ++ break; ++ default: ++ year = 2022; ++ } ++ break; + case '6': + year = 2016; + break; diff --git a/linux/reference-material/0006_fix_NFSv4_mount_regression.diff b/linux/reference-material/0006_fix_NFSv4_mount_regression.diff new file mode 100644 index 0000000..c2f1260 --- /dev/null +++ b/linux/reference-material/0006_fix_NFSv4_mount_regression.diff @@ -0,0 +1,243 @@ +From 6f2836341d8a39e1e000572b10959347d7e61fd9 Mon Sep 17 00:00:00 2001 +From: Olga Kornievskaia +Date: Wed, 12 Jan 2022 10:27:38 -0500 +Subject: NFSv4.1 query for fs_location attr on a new file system + +[ Upstream commit 1976b2b31462151403c9fc110204fcc2a77bdfd1 ] + +Query the server for other possible trunkable locations for a given +file system on a 4.1+ mount. + +v2: +-- added missing static to nfs4_discover_trunking, +reported by the kernel test robot + +Signed-off-by: Olga Kornievskaia +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + fs/nfs/client.c | 7 +++++ + fs/nfs/nfs4_fs.h | 9 +++--- + fs/nfs/nfs4proc.c | 76 ++++++++++++++++++++++++++++++++++++++++++------- + fs/nfs/nfs4state.c | 3 +- + include/linux/nfs_xdr.h | 1 + + 5 files changed, 81 insertions(+), 15 deletions(-) + +diff --git a/fs/nfs/client.c b/fs/nfs/client.c +index 551833862171f..090b16890e3d6 100644 +--- a/fs/nfs/client.c ++++ b/fs/nfs/client.c +@@ -860,6 +860,13 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs + server->namelen = pathinfo.max_namelen; + } + ++ if (clp->rpc_ops->discover_trunking != NULL && ++ (server->caps & NFS_CAP_FS_LOCATIONS)) { ++ error = clp->rpc_ops->discover_trunking(server, mntfh); ++ if (error < 0) ++ return error; ++ } ++ + return 0; + } + EXPORT_SYMBOL_GPL(nfs_probe_fsinfo); +diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h +index ba78df4b13d94..1a048ee653a11 100644 +--- a/fs/nfs/nfs4_fs.h ++++ b/fs/nfs/nfs4_fs.h +@@ -261,8 +261,8 @@ struct nfs4_state_maintenance_ops { + }; + + struct nfs4_mig_recovery_ops { +- int (*get_locations)(struct inode *, struct nfs4_fs_locations *, +- struct page *, const struct cred *); ++ int (*get_locations)(struct nfs_server *, struct nfs_fh *, ++ struct nfs4_fs_locations *, struct page *, const struct cred *); + int (*fsid_present)(struct inode *, const struct cred *); + }; + +@@ -303,8 +303,9 @@ extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait); + extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); + extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *, + struct nfs4_fs_locations *, struct page *); +-extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *, +- struct page *page, const struct cred *); ++extern int nfs4_proc_get_locations(struct nfs_server *, struct nfs_fh *, ++ struct nfs4_fs_locations *, ++ struct page *page, const struct cred *); + extern int nfs4_proc_fsid_present(struct inode *, const struct cred *); + extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, + struct dentry *, +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c +index 367a1b99b7550..389fa72d4ca98 100644 +--- a/fs/nfs/nfs4proc.c ++++ b/fs/nfs/nfs4proc.c +@@ -3952,6 +3952,60 @@ int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle) + return err; + } + ++static int _nfs4_discover_trunking(struct nfs_server *server, ++ struct nfs_fh *fhandle) ++{ ++ struct nfs4_fs_locations *locations = NULL; ++ struct page *page; ++ const struct cred *cred; ++ struct nfs_client *clp = server->nfs_client; ++ const struct nfs4_state_maintenance_ops *ops = ++ clp->cl_mvops->state_renewal_ops; ++ int status = -ENOMEM; ++ ++ cred = ops->get_state_renewal_cred(clp); ++ if (cred == NULL) { ++ cred = nfs4_get_clid_cred(clp); ++ if (cred == NULL) ++ return -ENOKEY; ++ } ++ ++ page = alloc_page(GFP_KERNEL); ++ locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL); ++ if (page == NULL || locations == NULL) ++ goto out; ++ ++ status = nfs4_proc_get_locations(server, fhandle, locations, page, ++ cred); ++ if (status) ++ goto out; ++out: ++ if (page) ++ __free_page(page); ++ kfree(locations); ++ return status; ++} ++ ++static int nfs4_discover_trunking(struct nfs_server *server, ++ struct nfs_fh *fhandle) ++{ ++ struct nfs4_exception exception = { ++ .interruptible = true, ++ }; ++ struct nfs_client *clp = server->nfs_client; ++ int err = 0; ++ ++ if (!nfs4_has_session(clp)) ++ goto out; ++ do { ++ err = nfs4_handle_exception(server, ++ _nfs4_discover_trunking(server, fhandle), ++ &exception); ++ } while (exception.retry); ++out: ++ return err; ++} ++ + static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, + struct nfs_fsinfo *info) + { +@@ -7886,18 +7940,18 @@ int nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir, + * appended to this compound to identify the client ID which is + * performing recovery. + */ +-static int _nfs40_proc_get_locations(struct inode *inode, ++static int _nfs40_proc_get_locations(struct nfs_server *server, ++ struct nfs_fh *fhandle, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { +- struct nfs_server *server = NFS_SERVER(inode); + struct rpc_clnt *clnt = server->client; + u32 bitmask[2] = { + [0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS, + }; + struct nfs4_fs_locations_arg args = { + .clientid = server->nfs_client->cl_clientid, +- .fh = NFS_FH(inode), ++ .fh = fhandle, + .page = page, + .bitmask = bitmask, + .migration = 1, /* skip LOOKUP */ +@@ -7943,17 +7997,17 @@ static int _nfs40_proc_get_locations(struct inode *inode, + * When the client supports GETATTR(fs_locations_info), it can + * be plumbed in here. + */ +-static int _nfs41_proc_get_locations(struct inode *inode, ++static int _nfs41_proc_get_locations(struct nfs_server *server, ++ struct nfs_fh *fhandle, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { +- struct nfs_server *server = NFS_SERVER(inode); + struct rpc_clnt *clnt = server->client; + u32 bitmask[2] = { + [0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS, + }; + struct nfs4_fs_locations_arg args = { +- .fh = NFS_FH(inode), ++ .fh = fhandle, + .page = page, + .bitmask = bitmask, + .migration = 1, /* skip LOOKUP */ +@@ -8002,11 +8056,11 @@ static int _nfs41_proc_get_locations(struct inode *inode, + * -NFS4ERR_LEASE_MOVED is returned if the server still has leases + * from this client that require migration recovery. + */ +-int nfs4_proc_get_locations(struct inode *inode, ++int nfs4_proc_get_locations(struct nfs_server *server, ++ struct nfs_fh *fhandle, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { +- struct nfs_server *server = NFS_SERVER(inode); + struct nfs_client *clp = server->nfs_client; + const struct nfs4_mig_recovery_ops *ops = + clp->cl_mvops->mig_recovery_ops; +@@ -8019,10 +8073,11 @@ int nfs4_proc_get_locations(struct inode *inode, + (unsigned long long)server->fsid.major, + (unsigned long long)server->fsid.minor, + clp->cl_hostname); +- nfs_display_fhandle(NFS_FH(inode), __func__); ++ nfs_display_fhandle(fhandle, __func__); + + do { +- status = ops->get_locations(inode, locations, page, cred); ++ status = ops->get_locations(server, fhandle, locations, page, ++ cred); + if (status != -NFS4ERR_DELAY) + break; + nfs4_handle_exception(server, status, &exception); +@@ -10516,6 +10571,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = { + .free_client = nfs4_free_client, + .create_server = nfs4_create_server, + .clone_server = nfs_clone_server, ++ .discover_trunking = nfs4_discover_trunking, + }; + + static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = { +diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c +index acc1cd3e63a48..51f5cb41e87a4 100644 +--- a/fs/nfs/nfs4state.c ++++ b/fs/nfs/nfs4state.c +@@ -2097,7 +2097,8 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred + } + + inode = d_inode(server->super->s_root); +- result = nfs4_proc_get_locations(inode, locations, page, cred); ++ result = nfs4_proc_get_locations(server, NFS_FH(inode), locations, ++ page, cred); + if (result) { + dprintk("<-- %s: failed to retrieve fs_locations: %d\n", + __func__, result); +diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h +index e9698b6278a52..ecd74cc347974 100644 +--- a/include/linux/nfs_xdr.h ++++ b/include/linux/nfs_xdr.h +@@ -1805,6 +1805,7 @@ struct nfs_rpc_ops { + struct nfs_server *(*create_server)(struct fs_context *); + struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *, + struct nfs_fattr *, rpc_authflavor_t); ++ int (*discover_trunking)(struct nfs_server *, struct nfs_fh *); + }; + + /* +-- +cgit + diff --git a/linux/reference-material/0007_fix_NFSv4_mount_regression.diff b/linux/reference-material/0007_fix_NFSv4_mount_regression.diff new file mode 100644 index 0000000..c2f1260 --- /dev/null +++ b/linux/reference-material/0007_fix_NFSv4_mount_regression.diff @@ -0,0 +1,243 @@ +From 6f2836341d8a39e1e000572b10959347d7e61fd9 Mon Sep 17 00:00:00 2001 +From: Olga Kornievskaia +Date: Wed, 12 Jan 2022 10:27:38 -0500 +Subject: NFSv4.1 query for fs_location attr on a new file system + +[ Upstream commit 1976b2b31462151403c9fc110204fcc2a77bdfd1 ] + +Query the server for other possible trunkable locations for a given +file system on a 4.1+ mount. + +v2: +-- added missing static to nfs4_discover_trunking, +reported by the kernel test robot + +Signed-off-by: Olga Kornievskaia +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + fs/nfs/client.c | 7 +++++ + fs/nfs/nfs4_fs.h | 9 +++--- + fs/nfs/nfs4proc.c | 76 ++++++++++++++++++++++++++++++++++++++++++------- + fs/nfs/nfs4state.c | 3 +- + include/linux/nfs_xdr.h | 1 + + 5 files changed, 81 insertions(+), 15 deletions(-) + +diff --git a/fs/nfs/client.c b/fs/nfs/client.c +index 551833862171f..090b16890e3d6 100644 +--- a/fs/nfs/client.c ++++ b/fs/nfs/client.c +@@ -860,6 +860,13 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs + server->namelen = pathinfo.max_namelen; + } + ++ if (clp->rpc_ops->discover_trunking != NULL && ++ (server->caps & NFS_CAP_FS_LOCATIONS)) { ++ error = clp->rpc_ops->discover_trunking(server, mntfh); ++ if (error < 0) ++ return error; ++ } ++ + return 0; + } + EXPORT_SYMBOL_GPL(nfs_probe_fsinfo); +diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h +index ba78df4b13d94..1a048ee653a11 100644 +--- a/fs/nfs/nfs4_fs.h ++++ b/fs/nfs/nfs4_fs.h +@@ -261,8 +261,8 @@ struct nfs4_state_maintenance_ops { + }; + + struct nfs4_mig_recovery_ops { +- int (*get_locations)(struct inode *, struct nfs4_fs_locations *, +- struct page *, const struct cred *); ++ int (*get_locations)(struct nfs_server *, struct nfs_fh *, ++ struct nfs4_fs_locations *, struct page *, const struct cred *); + int (*fsid_present)(struct inode *, const struct cred *); + }; + +@@ -303,8 +303,9 @@ extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait); + extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); + extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *, + struct nfs4_fs_locations *, struct page *); +-extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *, +- struct page *page, const struct cred *); ++extern int nfs4_proc_get_locations(struct nfs_server *, struct nfs_fh *, ++ struct nfs4_fs_locations *, ++ struct page *page, const struct cred *); + extern int nfs4_proc_fsid_present(struct inode *, const struct cred *); + extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, + struct dentry *, +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c +index 367a1b99b7550..389fa72d4ca98 100644 +--- a/fs/nfs/nfs4proc.c ++++ b/fs/nfs/nfs4proc.c +@@ -3952,6 +3952,60 @@ int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle) + return err; + } + ++static int _nfs4_discover_trunking(struct nfs_server *server, ++ struct nfs_fh *fhandle) ++{ ++ struct nfs4_fs_locations *locations = NULL; ++ struct page *page; ++ const struct cred *cred; ++ struct nfs_client *clp = server->nfs_client; ++ const struct nfs4_state_maintenance_ops *ops = ++ clp->cl_mvops->state_renewal_ops; ++ int status = -ENOMEM; ++ ++ cred = ops->get_state_renewal_cred(clp); ++ if (cred == NULL) { ++ cred = nfs4_get_clid_cred(clp); ++ if (cred == NULL) ++ return -ENOKEY; ++ } ++ ++ page = alloc_page(GFP_KERNEL); ++ locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL); ++ if (page == NULL || locations == NULL) ++ goto out; ++ ++ status = nfs4_proc_get_locations(server, fhandle, locations, page, ++ cred); ++ if (status) ++ goto out; ++out: ++ if (page) ++ __free_page(page); ++ kfree(locations); ++ return status; ++} ++ ++static int nfs4_discover_trunking(struct nfs_server *server, ++ struct nfs_fh *fhandle) ++{ ++ struct nfs4_exception exception = { ++ .interruptible = true, ++ }; ++ struct nfs_client *clp = server->nfs_client; ++ int err = 0; ++ ++ if (!nfs4_has_session(clp)) ++ goto out; ++ do { ++ err = nfs4_handle_exception(server, ++ _nfs4_discover_trunking(server, fhandle), ++ &exception); ++ } while (exception.retry); ++out: ++ return err; ++} ++ + static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, + struct nfs_fsinfo *info) + { +@@ -7886,18 +7940,18 @@ int nfs4_proc_fs_locations(struct rpc_clnt *client, struct inode *dir, + * appended to this compound to identify the client ID which is + * performing recovery. + */ +-static int _nfs40_proc_get_locations(struct inode *inode, ++static int _nfs40_proc_get_locations(struct nfs_server *server, ++ struct nfs_fh *fhandle, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { +- struct nfs_server *server = NFS_SERVER(inode); + struct rpc_clnt *clnt = server->client; + u32 bitmask[2] = { + [0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS, + }; + struct nfs4_fs_locations_arg args = { + .clientid = server->nfs_client->cl_clientid, +- .fh = NFS_FH(inode), ++ .fh = fhandle, + .page = page, + .bitmask = bitmask, + .migration = 1, /* skip LOOKUP */ +@@ -7943,17 +7997,17 @@ static int _nfs40_proc_get_locations(struct inode *inode, + * When the client supports GETATTR(fs_locations_info), it can + * be plumbed in here. + */ +-static int _nfs41_proc_get_locations(struct inode *inode, ++static int _nfs41_proc_get_locations(struct nfs_server *server, ++ struct nfs_fh *fhandle, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { +- struct nfs_server *server = NFS_SERVER(inode); + struct rpc_clnt *clnt = server->client; + u32 bitmask[2] = { + [0] = FATTR4_WORD0_FSID | FATTR4_WORD0_FS_LOCATIONS, + }; + struct nfs4_fs_locations_arg args = { +- .fh = NFS_FH(inode), ++ .fh = fhandle, + .page = page, + .bitmask = bitmask, + .migration = 1, /* skip LOOKUP */ +@@ -8002,11 +8056,11 @@ static int _nfs41_proc_get_locations(struct inode *inode, + * -NFS4ERR_LEASE_MOVED is returned if the server still has leases + * from this client that require migration recovery. + */ +-int nfs4_proc_get_locations(struct inode *inode, ++int nfs4_proc_get_locations(struct nfs_server *server, ++ struct nfs_fh *fhandle, + struct nfs4_fs_locations *locations, + struct page *page, const struct cred *cred) + { +- struct nfs_server *server = NFS_SERVER(inode); + struct nfs_client *clp = server->nfs_client; + const struct nfs4_mig_recovery_ops *ops = + clp->cl_mvops->mig_recovery_ops; +@@ -8019,10 +8073,11 @@ int nfs4_proc_get_locations(struct inode *inode, + (unsigned long long)server->fsid.major, + (unsigned long long)server->fsid.minor, + clp->cl_hostname); +- nfs_display_fhandle(NFS_FH(inode), __func__); ++ nfs_display_fhandle(fhandle, __func__); + + do { +- status = ops->get_locations(inode, locations, page, cred); ++ status = ops->get_locations(server, fhandle, locations, page, ++ cred); + if (status != -NFS4ERR_DELAY) + break; + nfs4_handle_exception(server, status, &exception); +@@ -10516,6 +10571,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = { + .free_client = nfs4_free_client, + .create_server = nfs4_create_server, + .clone_server = nfs_clone_server, ++ .discover_trunking = nfs4_discover_trunking, + }; + + static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = { +diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c +index acc1cd3e63a48..51f5cb41e87a4 100644 +--- a/fs/nfs/nfs4state.c ++++ b/fs/nfs/nfs4state.c +@@ -2097,7 +2097,8 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred + } + + inode = d_inode(server->super->s_root); +- result = nfs4_proc_get_locations(inode, locations, page, cred); ++ result = nfs4_proc_get_locations(server, NFS_FH(inode), locations, ++ page, cred); + if (result) { + dprintk("<-- %s: failed to retrieve fs_locations: %d\n", + __func__, result); +diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h +index e9698b6278a52..ecd74cc347974 100644 +--- a/include/linux/nfs_xdr.h ++++ b/include/linux/nfs_xdr.h +@@ -1805,6 +1805,7 @@ struct nfs_rpc_ops { + struct nfs_server *(*create_server)(struct fs_context *); + struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *, + struct nfs_fattr *, rpc_authflavor_t); ++ int (*discover_trunking)(struct nfs_server *, struct nfs_fh *); + }; + + /* +-- +cgit + diff --git a/linux/reference-material/0100-netfilter-nf_tables-stricter-validation-of-element-data.diff b/linux/reference-material/0100-netfilter-nf_tables-stricter-validation-of-element-data.diff new file mode 100644 index 0000000..385b9cf --- /dev/null +++ b/linux/reference-material/0100-netfilter-nf_tables-stricter-validation-of-element-data.diff @@ -0,0 +1,44 @@ +From 7e6bc1f6cabcd30aba0b11219d8e01b952eacbb6 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Sat, 2 Jul 2022 04:16:30 +0200 +Subject: netfilter: nf_tables: stricter validation of element data + +From: Pablo Neira Ayuso + +commit 7e6bc1f6cabcd30aba0b11219d8e01b952eacbb6 upstream. + +Make sure element data type and length do not mismatch the one specified +by the set declaration. + +Fixes: 7d7402642eaf ("netfilter: nf_tables: variable sized set element keys / data") +Reported-by: Hugues ANGUELKOV +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Greg Kroah-Hartman +--- + net/netfilter/nf_tables_api.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/net/netfilter/nf_tables_api.c ++++ b/net/netfilter/nf_tables_api.c +@@ -5118,13 +5118,20 @@ static int nft_setelem_parse_data(struct + struct nft_data *data, + struct nlattr *attr) + { ++ u32 dtype; + int err; + + err = nft_data_init(ctx, data, NFT_DATA_VALUE_MAXLEN, desc, attr); + if (err < 0) + return err; + +- if (desc->type != NFT_DATA_VERDICT && desc->len != set->dlen) { ++ if (set->dtype == NFT_DATA_VERDICT) ++ dtype = NFT_DATA_VERDICT; ++ else ++ dtype = NFT_DATA_VALUE; ++ ++ if (dtype != desc->type || ++ set->dlen != desc->len) { + nft_data_release(data, desc->type); + return -EINVAL; + } diff --git a/linux/reference-material/PKGBUILD-arch.5.15.74 b/linux/reference-material/PKGBUILD-arch.5.15.74 new file mode 100644 index 0000000..760dfc3 --- /dev/null +++ b/linux/reference-material/PKGBUILD-arch.5.15.74 @@ -0,0 +1,213 @@ +# Maintainer: Andreas Radke + +pkgbase=linux-lts +pkgver=5.15.74 +pkgrel=1 +pkgdesc='LTS Linux' +url="https://www.kernel.org/" +arch=(x86_64) +license=(GPL2) +makedepends=( + bc libelf pahole cpio perl tar xz + xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick texlive-latexextra +) +options=('!strip') +_srcname=linux-$pkgver +source=( + https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.{xz,sign} + config # the main kernel config file + 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + 0002-PCI-Add-more-NVIDIA-controllers-to-the-MSI-masking-q.patch + 0003-iommu-intel-do-deep-dma-unmapping-to-avoid-kernel-fl.patch + 0004-Bluetooth-btintel-Fix-bdaddress-comparison-with-garb.patch + 0005-lg-laptop-Recognize-more-models.patch + 0006-Fix-NFSv4-mount-regression.patch +) +validpgpkeys=( + 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds + '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman +) +# https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc +sha256sums=('2c1539a2f85b835c36c4a07c8270b52b0bec38fdda7339477d07f0c3af8c4265' + 'SKIP' + '8924e710cf047279574bd3dd5a8a9869f7baeb0cd291bbaf3b9530c70600a643' + '3b5cfc9ca9cf778ea2c4b619b933cda26519969df2d764b5a687f63cf59974cd' + 'c175fbb141c3cec013c799f694d88310375ac5456042f6a4a1adc7667836d786' + '8357f000b2b622e73dcfd41c2bad42b5e99fffe8f7ee64f774aa771f86cef43c' + '5c1ee81fdd5818442af6081de987f9c1a9ce3c8d183566b3dfc19a8433aa3dde' + '067e8995fcd6f6ed25e0253e9374c0e179a000c154da3e59ce62634945ac5be9' + '10801c245064777873b580bea1fc17a4288ec519e0ce9500aa1b7c6e19fe777b') + +export KBUILD_BUILD_HOST=archlinux +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" + +prepare() { + cd $_srcname + + echo "Setting version..." + scripts/setlocalversion --save-scmversion + echo "-$pkgrel" > localversion.10-pkgrel + echo "${pkgbase#linux}" > localversion.20-pkgname + + local src + for src in "${source[@]}"; do + src="${src%%::*}" + src="${src##*/}" + [[ $src = *.patch ]] || continue + echo "Applying patch $src..." + patch -Np1 < "../$src" + done + + echo "Setting config..." + cp ../config .config + make olddefconfig + diff -u ../config .config || : + + make -s kernelrelease > version + echo "Prepared $pkgbase version $(>PKGBUILD +sha256sum {li*.tar.xz*,config,000*,sha256sums} >>PKGBUILD