From 1f32f1eff87e22aa9935e3e8c69b1f1955347187 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Sat, 23 Sep 2023 17:20:11 -0500 Subject: [PATCH] kernel-6.5.5-200 * Sat Sep 23 2023 Justin M. Forbes [6.5.5-0] - iommu/apple-dart: Handle DMA_FQ domains in attach_dev() (Hector Martin) - Note fix for atomic locking in BugsFixed (Justin M. Forbes) - locking/atomic: scripts: fix fallback ifdeffery (Mark Rutland) - redhat: spec: Fix typo for kernel_variant_preun for 16k-debug flavor (Neal Gompa) - Fix installreq for UKI (Justin M. Forbes) - Add btrfs bug to BugsFixed for 6.5.5 (Justin M. Forbes) - btrfs: adjust overcommit logic when very close to full (Josef Bacik) - btrfs: properly report 0 avail for very full file systems (Josef Bacik) - Linux v6.5.5 Resolves: Signed-off-by: Justin M. Forbes --- Patchlist.changelog | 12 ++++ kernel.spec | 23 ++++-- patch-6.5-redhat.patch | 156 ++++++++++++++++++++++++++++++++--------- sources | 6 +- 4 files changed, 156 insertions(+), 41 deletions(-) diff --git a/Patchlist.changelog b/Patchlist.changelog index fbc7e733b..f6fc81e0b 100644 --- a/Patchlist.changelog +++ b/Patchlist.changelog @@ -1,3 +1,15 @@ +"https://gitlab.com/cki-project/kernel-ark/-/commit"/fe8fa52d7059d2dd7b171a0ad1a53bd55c7d449a + fe8fa52d7059d2dd7b171a0ad1a53bd55c7d449a iommu/apple-dart: Handle DMA_FQ domains in attach_dev() + +"https://gitlab.com/cki-project/kernel-ark/-/commit"/d08eefa0932515ada7d972c51b99153a7ea3d6ac + d08eefa0932515ada7d972c51b99153a7ea3d6ac locking/atomic: scripts: fix fallback ifdeffery + +"https://gitlab.com/cki-project/kernel-ark/-/commit"/d39b077dee33176ab97b22593fc8ae8a130ee768 + d39b077dee33176ab97b22593fc8ae8a130ee768 btrfs: adjust overcommit logic when very close to full + +"https://gitlab.com/cki-project/kernel-ark/-/commit"/a1c2565138b048b69ec731e22118ec1837fa5ceb + a1c2565138b048b69ec731e22118ec1837fa5ceb btrfs: properly report 0 avail for very full file systems + "https://gitlab.com/cki-project/kernel-ark/-/commit"/60528063540aabceb7c4d79c7938d229ed5efc4f 60528063540aabceb7c4d79c7938d229ed5efc4f selinux: fix handling of empty opts in selinux_fs_context_submount() diff --git a/kernel.spec b/kernel.spec index 2c937eabe..35164f2af 100644 --- a/kernel.spec +++ b/kernel.spec @@ -160,18 +160,18 @@ Summary: The Linux kernel # the --with-release option overrides this setting.) %define debugbuildsenabled 1 # define buildid .local -%define specrpmversion 6.5.4 -%define specversion 6.5.4 +%define specrpmversion 6.5.5 +%define specversion 6.5.5 %define patchversion 6.5 %define pkgrelease 200 %define kversion 6 -%define tarfile_release 6.5.4 +%define tarfile_release 6.5.5 # This is needed to do merge window version magic %define patchlevel 5 # This allows pkg_release to have configurable %%{?dist} tag %define specrelease 200%{?buildid}%{?dist} # This defines the kabi tarball version -%define kabiversion 6.5.4 +%define kabiversion 6.5.5 # If this variable is set to 1, a bpf selftests build failure will cause a # fatal kernel package build error @@ -1513,7 +1513,7 @@ Provides: installonlypkg(kernel)\ Provides: kernel-%{?1:%{1}-}uname-r = %{KVERREL}%{uname_suffix %{?1:+%{1}}}\ Requires: kernel%{?1:-%{1}}-modules-core-uname-r = %{KVERREL}%{uname_suffix %{?1:+%{1}}}\ Requires(pre): %{kernel_prereq}\ -Requires(pre): systemd >= 254-1\ +Requires(pre): systemd\ %endif\ %endif\ %if %{with_gcov}\ @@ -3342,7 +3342,7 @@ fi\ %endif %if %{with_debug} && %{with_arm64_16k} -%kernel_variant_preun 16k-debug +%kernel_variant_preun -v 16k-debug %kernel_variant_post -v 16k-debug %endif @@ -3702,6 +3702,17 @@ fi\ # # %changelog +* Sat Sep 23 2023 Justin M. Forbes [6.5.5-0] +- iommu/apple-dart: Handle DMA_FQ domains in attach_dev() (Hector Martin) +- Note fix for atomic locking in BugsFixed (Justin M. Forbes) +- locking/atomic: scripts: fix fallback ifdeffery (Mark Rutland) +- redhat: spec: Fix typo for kernel_variant_preun for 16k-debug flavor (Neal Gompa) +- Fix installreq for UKI (Justin M. Forbes) +- Add btrfs bug to BugsFixed for 6.5.5 (Justin M. Forbes) +- btrfs: adjust overcommit logic when very close to full (Josef Bacik) +- btrfs: properly report 0 avail for very full file systems (Josef Bacik) +- Linux v6.5.5 + * Tue Sep 19 2023 Justin M. Forbes [6.5.4-0] - Add F38 and F37 as release targets (Justin M. Forbes) - Add NFS bug fix for 6.5.4 (Justin M. Forbes) diff --git a/patch-6.5-redhat.patch b/patch-6.5-redhat.patch index 0c230ea04..3f1689fa3 100644 --- a/patch-6.5-redhat.patch +++ b/patch-6.5-redhat.patch @@ -16,6 +16,7 @@ drivers/hid/hid-rmi.c | 66 ----------- drivers/hwtracing/coresight/coresight-etm4x-core.c | 19 ++++ drivers/input/rmi4/rmi_driver.c | 124 ++++++++++++--------- + drivers/iommu/apple-dart.c | 3 +- drivers/iommu/iommu.c | 22 ++++ drivers/misc/cardreader/rts5227.c | 2 +- drivers/misc/cardreader/rts5228.c | 18 +++ @@ -29,21 +30,24 @@ drivers/pci/quirks.c | 24 ++++ drivers/scsi/sd.c | 10 ++ drivers/usb/core/hub.c | 7 ++ + fs/btrfs/space-info.c | 17 +++ + fs/btrfs/super.c | 3 +- + include/linux/atomic/atomic-arch-fallback.h | 10 +- include/linux/efi.h | 22 ++-- include/linux/lsm_hook_defs.h | 2 + include/linux/rmi.h | 1 + include/linux/security.h | 5 + kernel/module/signing.c | 9 +- + scripts/atomic/gen-atomic-fallback.sh | 2 +- scripts/tags.sh | 2 + security/integrity/platform_certs/load_uefi.c | 6 +- security/lockdown/Kconfig | 13 +++ security/lockdown/lockdown.c | 1 + security/security.c | 12 ++ - security/selinux/hooks.c | 10 +- - 42 files changed, 580 insertions(+), 192 deletions(-) + 46 files changed, 594 insertions(+), 203 deletions(-) diff --git a/Makefile b/Makefile -index beddccac3283..b7f8a65852ca 100644 +index 7545d2b0e7b7..fe35765f10c9 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,18 @@ $(if $(filter __%, $(MAKECMDGOALS)), \ @@ -242,7 +246,7 @@ index 87e385542576..7e9de6e3eb9f 100644 acpi_dev_get_resources(device, &resource_list, acpi_check_serial_bus_slave, diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c -index 06aec35f88f2..50428bd0fa12 100644 +index a6212f6d3796..1bd84617d751 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -729,6 +729,24 @@ int ahci_stop_engine(struct ata_port *ap) @@ -913,6 +917,20 @@ index 258d5fe3d395..f7298e3dc8f3 100644 if (data->f01_container->dev.driver) { /* Driver already bound, so enable ATTN now. */ +diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c +index 8af64b57f048..f4d880408254 100644 +--- a/drivers/iommu/apple-dart.c ++++ b/drivers/iommu/apple-dart.c +@@ -671,8 +671,7 @@ static int apple_dart_attach_dev(struct iommu_domain *domain, + return ret; + + switch (domain->type) { +- case IOMMU_DOMAIN_DMA: +- case IOMMU_DOMAIN_UNMANAGED: ++ default: + ret = apple_dart_domain_add_streams(dart_domain, cfg); + if (ret) + return ret; diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index cabeb5bd3e41..25ef4e9cc34a 100644 --- a/drivers/iommu/iommu.c @@ -1122,7 +1140,7 @@ index a3f4b52bb159..32b7783e9d4f 100644 /* No CD interrupt if probing driver with card inserted. * So we need to initialize pcr->card_exist here. diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c -index f3a01b79148c..9a1a74d183ce 100644 +index 21783aa2ee8e..f2f9bdb3e0c8 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -251,6 +251,9 @@ void nvme_delete_ctrl_sync(struct nvme_ctrl *ctrl) @@ -1338,6 +1356,94 @@ index 26a27ff50408..e1050b7dd63d 100644 /* Lock the device, then check to see if we were * disconnected while waiting for the lock to succeed. */ usb_lock_device(hdev); +diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c +index ba5322fe34f5..35d084c52f2d 100644 +--- a/fs/btrfs/space-info.c ++++ b/fs/btrfs/space-info.c +@@ -365,6 +365,23 @@ static u64 calc_available_free_space(struct btrfs_fs_info *fs_info, + factor = btrfs_bg_type_to_factor(profile); + avail = div_u64(avail, factor); + ++ /* ++ * Since data allocations immediately use block groups as part of the ++ * reservation, because we assume that data reservations will == actual ++ * usage, we could potentially overcommit and then immediately have that ++ * available space used by a data allocation, which could put us in a ++ * bind when we get close to filling the file system. ++ * ++ * To handle this simply remove 1G (which is our current maximum chunk ++ * allocation size) from the available space. If we are relatively ++ * empty this won't affect our ability to overcommit much, and if we're ++ * very close to full it'll keep us from getting into a position where ++ * we've given ourselves very little metadata wiggle room. ++ */ ++ if (avail < SZ_1G) ++ return 0; ++ avail -= SZ_1G; ++ + /* + * If we aren't flushing all things, let us overcommit up to + * 1/2th of the space. If we can flush, don't let us overcommit +diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c +index f1dd172d8d5b..784640ce7857 100644 +--- a/fs/btrfs/super.c ++++ b/fs/btrfs/super.c +@@ -2111,7 +2111,8 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf) + * calculated f_bavail. + */ + if (!mixed && block_rsv->space_info->full && +- total_free_meta - thresh < block_rsv->size) ++ (total_free_meta < thresh || ++ total_free_meta - thresh < block_rsv->size)) + buf->f_bavail = 0; + + buf->f_type = BTRFS_SUPER_MAGIC; +diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h +index 18f5744dfb5d..b83ef19da13d 100644 +--- a/include/linux/atomic/atomic-arch-fallback.h ++++ b/include/linux/atomic/atomic-arch-fallback.h +@@ -459,8 +459,6 @@ raw_atomic_read_acquire(const atomic_t *v) + { + #if defined(arch_atomic_read_acquire) + return arch_atomic_read_acquire(v); +-#elif defined(arch_atomic_read) +- return arch_atomic_read(v); + #else + int ret; + +@@ -508,8 +506,6 @@ raw_atomic_set_release(atomic_t *v, int i) + { + #if defined(arch_atomic_set_release) + arch_atomic_set_release(v, i); +-#elif defined(arch_atomic_set) +- arch_atomic_set(v, i); + #else + if (__native_word(atomic_t)) { + smp_store_release(&(v)->counter, i); +@@ -2575,8 +2571,6 @@ raw_atomic64_read_acquire(const atomic64_t *v) + { + #if defined(arch_atomic64_read_acquire) + return arch_atomic64_read_acquire(v); +-#elif defined(arch_atomic64_read) +- return arch_atomic64_read(v); + #else + s64 ret; + +@@ -2624,8 +2618,6 @@ raw_atomic64_set_release(atomic64_t *v, s64 i) + { + #if defined(arch_atomic64_set_release) + arch_atomic64_set_release(v, i); +-#elif defined(arch_atomic64_set) +- arch_atomic64_set(v, i); + #else + if (__native_word(atomic64_t)) { + smp_store_release(&(v)->counter, i); +@@ -4657,4 +4649,4 @@ raw_atomic64_dec_if_positive(atomic64_t *v) + } + + #endif /* _LINUX_ATOMIC_FALLBACK_H */ +-// 202b45c7db600ce36198eb1f1fc2c2d5268ace2d ++// 2fdd6702823fa842f9cea57a002e6e4476ae780c diff --git a/include/linux/efi.h b/include/linux/efi.h index ab088c662e88..f974f9d9a7c5 100644 --- a/include/linux/efi.h @@ -1477,6 +1583,19 @@ index a2ff4242e623..f0d2be1ee4f1 100644 } int module_sig_check(struct load_info *info, int flags) +diff --git a/scripts/atomic/gen-atomic-fallback.sh b/scripts/atomic/gen-atomic-fallback.sh +index c0c8a85d7c81..a45154cefa48 100755 +--- a/scripts/atomic/gen-atomic-fallback.sh ++++ b/scripts/atomic/gen-atomic-fallback.sh +@@ -102,7 +102,7 @@ gen_proto_order_variant() + fi + + # Allow ACQUIRE/RELEASE/RELAXED ops to be defined in terms of FULL ops +- if [ ! -z "${order}" ]; then ++ if [ ! -z "${order}" ] && ! meta_is_implicitly_relaxed "${meta}"; then + printf "#elif defined(arch_${basename})\n" + printf "\t${retstmt}arch_${basename}(${args});\n" + fi diff --git a/scripts/tags.sh b/scripts/tags.sh index a70d43723146..56d06b04f752 100755 --- a/scripts/tags.sh @@ -1573,30 +1692,3 @@ index 549104a447e3..73670798f075 100644 #ifdef CONFIG_PERF_EVENTS /** * security_perf_event_open() - Check if a perf event open is allowed -diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c -index afd663744041..5c16fe737a27 100644 ---- a/security/selinux/hooks.c -+++ b/security/selinux/hooks.c -@@ -2748,14 +2748,20 @@ static int selinux_umount(struct vfsmount *mnt, int flags) - static int selinux_fs_context_submount(struct fs_context *fc, - struct super_block *reference) - { -- const struct superblock_security_struct *sbsec; -+ const struct superblock_security_struct *sbsec = selinux_superblock(reference); - struct selinux_mnt_opts *opts; - -+ /* -+ * Ensure that fc->security remains NULL when no options are set -+ * as expected by selinux_set_mnt_opts(). -+ */ -+ if (!(sbsec->flags & (FSCONTEXT_MNT|CONTEXT_MNT|DEFCONTEXT_MNT))) -+ return 0; -+ - opts = kzalloc(sizeof(*opts), GFP_KERNEL); - if (!opts) - return -ENOMEM; - -- sbsec = selinux_superblock(reference); - if (sbsec->flags & FSCONTEXT_MNT) - opts->fscontext_sid = sbsec->sid; - if (sbsec->flags & CONTEXT_MNT) diff --git a/sources b/sources index 0d789984e..7c55778d7 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (linux-6.5.4.tar.xz) = 2fc0ff554d2a713ddca070a880e9143ceefaaea4261ce54b237ef8861c83c0e8b2d7e1628c54fb763809c68e4dde9c8d21638dab3619974baa7cf24f8a7d76cb -SHA512 (kernel-abi-stablelists-6.5.4.tar.bz2) = a1f27c5807dda92b31c464aa5073655182bd66a2c89b656398dfafa4f51307ae0a419afde4644ee98dcab9515e44c2244a733242151855afab11527cb8b609a5 -SHA512 (kernel-kabi-dw-6.5.4.tar.bz2) = 9cfc3cfa779336ba19f04b0a0e51cb0abfd4dd49a8b2bf911d50810477d633b35b375903fac449ef703239ce792133de59438ac2e5a6bf5bf0a6061ceac0043b +SHA512 (linux-6.5.5.tar.xz) = 294823e4b3b787b2abb1d43318f799ad91391124b56c4b7e8c435f588ef9a68be657d97c3f0df6b33dc8a7e8f10385d0b3da7cf5fa4956f20a5856bb57090164 +SHA512 (kernel-abi-stablelists-6.5.5.tar.bz2) = 427a087b114cea4bbcb106c9587ebb646cc404d9bfbe9462b2e1de60479678d0000268e22cee23ce516ed891911cde065920fedc696f3501577019b475b6c863 +SHA512 (kernel-kabi-dw-6.5.5.tar.bz2) = 7d59a3a68172dd9480fc1bc3fa26696a89f1d88fbda0f18fda5a644e1bde0f3b960531ec54ed8ce1a6baee0fc4407a51377eb774a9b5a9ccf7cf0fb93854855b