From 4b96d0066110c20b6a0689d3376a294c64d84a76 Mon Sep 17 00:00:00 2001 From: Justin M. Forbes Date: Mar 17 2022 05:26:21 +0000 Subject: kernel-5.16.15-1 * Thu Mar 17 2022 Justin M. Forbes [5.16.15-1] - Back out the nfs workaround and just revert the query for fs_location (Justin M. Forbes) Resolves: rhbz# Signed-off-by: Justin M. Forbes --- diff --git a/Makefile.rhelver b/Makefile.rhelver index 8e6ba08..a3e9c2e 100644 --- a/Makefile.rhelver +++ b/Makefile.rhelver @@ -12,7 +12,7 @@ RHEL_MINOR = 99 # # Use this spot to avoid future merge conflicts. # Do not trim this comment. -RHEL_RELEASE = 0 +RHEL_RELEASE = 1 # # Early y+1 numbering diff --git a/Patchlist.changelog b/Patchlist.changelog index f803e61..f822909 100644 --- a/Patchlist.changelog +++ b/Patchlist.changelog @@ -1,3 +1,6 @@ +https://gitlab.com/cki-project/kernel-ark/-/commit/dd24222299c0cc5a6a118f2265fcf3f769a7cfb4 + dd24222299c0cc5a6a118f2265fcf3f769a7cfb4 Back out the nfs workaround and just revert the query for fs_location + https://gitlab.com/cki-project/kernel-ark/-/commit/c6295fc9bb25d3684c10aaa89e00f5e12ccd4dd2 c6295fc9bb25d3684c10aaa89e00f5e12ccd4dd2 nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION diff --git a/kernel.spec b/kernel.spec index df351fd..e073f6d 100755 --- a/kernel.spec +++ b/kernel.spec @@ -87,7 +87,7 @@ Summary: The Linux kernel # the --with-release option overrides this setting.) %define debugbuildsenabled 1 -%global distro_build 100 +%global distro_build 101 %if 0%{?fedora} %define secure_boot_arch x86_64 @@ -132,13 +132,13 @@ Summary: The Linux kernel %define rpmversion 5.16.15 %define patchversion 5.16 -%define pkgrelease 100 +%define pkgrelease 101 # This is needed to do merge window version magic %define patchlevel 16 # allow pkg_release to have configurable %%{?dist} tag -%define specrelease 100%{?buildid}%{?dist} +%define specrelease 101%{?buildid}%{?dist} %define pkg_release %{specrelease} @@ -2985,6 +2985,9 @@ fi # # %changelog +* Thu Mar 17 2022 Justin M. Forbes [5.16.15-1] +- Back out the nfs workaround and just revert the query for fs_location (Justin M. Forbes) + * Wed Mar 16 2022 Justin M. Forbes [5.16.15-0] - nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION (Jordy Zomer) - Restrict FS_LOCATIONS to NFS v4.2+ to work around Qnap knfsd-3.4.6 bug (Justin M. Forbes) diff --git a/patch-5.16-redhat.patch b/patch-5.16-redhat.patch index 4a6334d..e1959a1 100644 --- a/patch-5.16-redhat.patch +++ b/patch-5.16-redhat.patch @@ -32,10 +32,14 @@ drivers/pci/msi.c | 13 +-- drivers/pci/quirks.c | 24 ++++ drivers/usb/core/hub.c | 7 ++ - fs/nfs/nfs4proc.c | 7 +- + fs/nfs/client.c | 7 -- + fs/nfs/nfs4_fs.h | 9 +- + fs/nfs/nfs4proc.c | 76 ++----------- + fs/nfs/nfs4state.c | 3 +- include/linux/efi.h | 22 ++-- include/linux/lsm_hook_defs.h | 2 + include/linux/lsm_hooks.h | 6 + + include/linux/nfs_xdr.h | 1 - include/linux/random.h | 7 ++ include/linux/rmi.h | 1 + include/linux/security.h | 5 + @@ -49,7 +53,7 @@ security/lockdown/lockdown.c | 1 + security/security.c | 6 + tools/testing/selftests/netfilter/nft_nat.sh | 5 +- - 51 files changed, 810 insertions(+), 206 deletions(-) + 55 files changed, 821 insertions(+), 284 deletions(-) diff --git a/Makefile b/Makefile index 8675dd2a9cc8..fae0fa3f7ed5 100644 @@ -1617,31 +1621,209 @@ index ac6c5ccfe1cb..ec784479eece 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/nfs/client.c b/fs/nfs/client.c +index a1e87419f3a4..2d2f2c091c65 100644 +--- a/fs/nfs/client.c ++++ b/fs/nfs/client.c +@@ -860,13 +860,6 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str + 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; + } + +diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h +index 85c5d08dfa9c..2364661a6a08 100644 +--- a/fs/nfs/nfs4_fs.h ++++ b/fs/nfs/nfs4_fs.h +@@ -260,8 +260,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 *); + }; + +@@ -303,9 +303,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 0abbbf5d2bdf..c216bbf7ee75 100644 +index 0abbbf5d2bdf..ba3aa4575d25 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c -@@ -3859,8 +3859,8 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f - res.attr_bitmask[2] &= FATTR4_WORD2_NFS42_MASK; - } - memcpy(server->attr_bitmask, res.attr_bitmask, sizeof(server->attr_bitmask)); -- server->caps &= ~(NFS_CAP_ACLS | NFS_CAP_HARDLINKS | -- NFS_CAP_SYMLINKS| NFS_CAP_SECURITY_LABEL); -+ server->caps &= ~(NFS_CAP_ACLS | NFS_CAP_HARDLINKS | NFS_CAP_SYMLINKS -+ | NFS_CAP_SECURITY_LABEL | NFS_CAP_FS_LOCATIONS); - server->fattr_valid = NFS_ATTR_FATTR_V4; - if (res.attr_bitmask[0] & FATTR4_WORD0_ACL && - res.acl_bitmask & ACL4_SUPPORT_ALLOW_ACL) -@@ -3873,7 +3873,8 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f - if (res.attr_bitmask[2] & FATTR4_WORD2_SECURITY_LABEL) - server->caps |= NFS_CAP_SECURITY_LABEL; - #endif -- if (res.attr_bitmask[0] & FATTR4_WORD0_FS_LOCATIONS) -+ /* Restrict FS_LOCATIONS to NFS v4.2+ to work around Qnap knfsd-3.4.6 bug */ -+ if (res.attr_bitmask[0] & FATTR4_WORD0_FS_LOCATIONS && minorversion >= 2) - server->caps |= NFS_CAP_FS_LOCATIONS; - if (!(res.attr_bitmask[0] & FATTR4_WORD0_FILEID)) - server->fattr_valid &= ~NFS_ATTR_FATTR_FILEID; +@@ -3933,60 +3933,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) + { +@@ -7873,18 +7819,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 */ +@@ -7930,17 +7876,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 */ +@@ -7989,11 +7935,11 @@ 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; +@@ -8006,11 +7952,10 @@ int nfs4_proc_get_locations(struct nfs_server *server, + (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); +@@ -10479,7 +10424,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 499bef9fe118..f3265575c28d 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/efi.h b/include/linux/efi.h index ef8dbc0a1522..836a5dfc6156 100644 --- a/include/linux/efi.h @@ -1740,6 +1922,18 @@ index d45b6f6e27fd..70622b506461 100644 * Security hooks for perf events * * @perf_event_open: +diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h +index 695fa84611b6..967a0098f0a9 100644 +--- a/include/linux/nfs_xdr.h ++++ b/include/linux/nfs_xdr.h +@@ -1795,7 +1795,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/include/linux/random.h b/include/linux/random.h index f45b8be3e3c4..7ccdec68b789 100644 --- a/include/linux/random.h diff --git a/sources b/sources index a65680c..b487928 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (linux-5.16.15.tar.xz) = 2bb60417bfcff772de12419a4279eb21139871cad5cd800e295832b646f75b2e751115dda1ceb8344465a1f263a782f7e6dc45362433caf7bab3c164b7f78d7f -SHA512 (kernel-abi-stablelists-5.16.15-100.tar.bz2) = 9fa1a6aba3b11b63dd461cd10af1269e8354aa7df39f02ea7d2e36ec86aa7f115ea54779001bc6ce3f8e37040a03d34ccfad762684b9a1ac0a71bde8369e6a67 -SHA512 (kernel-kabi-dw-5.16.15-100.tar.bz2) = 7a07aa18af068537bd31ed63bdd796d3bc7510ad29bb5428546bbaa93a866aea193ba127058904f9fc257c01b2fb072b8d27f2ac8b845e483d7e92b0e4f4deca +SHA512 (kernel-abi-stablelists-5.16.15-101.tar.bz2) = 513bf7c6ec77863741e9747776fcc21c358849f2fcf1ace5f87a8fb8c710c2811a01e49e697b6ed6a16fc9fc99518eeb9d1f5a4dd6698447733dfc8718cd30b8 +SHA512 (kernel-kabi-dw-5.16.15-101.tar.bz2) = 7a07aa18af068537bd31ed63bdd796d3bc7510ad29bb5428546bbaa93a866aea193ba127058904f9fc257c01b2fb072b8d27f2ac8b845e483d7e92b0e4f4deca