5.18.15-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 146/158 crypto: qat - remove dma_free_coherent() for DH
In reply to Greg Kroah-HartmanFrom: Giovanni Cabiddu <[email protected]>
[ Upstream commit 029aa4624a7fe35233bdd3d1354dc7be260380bf ]
The functions qat_dh_compute_value() allocates memory with dma_alloc_coherent() if the source or the destination buffers are made of multiple flat buffers or of a size that is not compatible with the hardware.
This memory is then freed with dma_free_coherent() in the context of a tasklet invoked to handle the response for the corresponding request.
According to Documentation/core-api/dma-api-howto.rst, the function dma_free_coherent() cannot be called in an interrupt context.
Replace allocations with dma_alloc_coherent() in the function qat_dh_compute_value() with kmalloc() + dma_map_single().
--- drivers/crypto/qat/qat_common/qat_asym_algs.c | 83 ++++++++----------- 1 file changed, 34 insertions(+), 49 deletions(-)
drivers/crypto/qat/qat_common/qat_asym_algs.c +34 -49
@@ -164,26 +164,21 @@ static void qat_dh_cb(struct icp_qat_fw_pke_resp *resp) err = (err ==ICP_QAT_FW_COMN_STATUS_FLAG_OK ) ?0 : -EINVAL ;if (areq->src) { -if (req->src_align) -dma_free_coherent (dev, req->ctx.dh->p_size, - req->src_align, req->in.dh.in.b); -else -dma_unmap_single (dev, req->in.dh.in.b, - req->ctx.dh->p_size,DMA_TO_DEVICE ); +dma_unmap_single (dev, req->in.dh.in.b, req->ctx.dh->p_size, +DMA_TO_DEVICE ); +kfree_sensitive (req->src_align); } areq->dst_len = req->ctx.dh->p_size;if (req->dst_align) {scatterwalk_map_and_copy (req->dst_align, areq->dst,0 , areq->dst_len,1 ); - -dma_free_coherent (dev, req->ctx.dh->p_size, req->dst_align, - req->out.dh.r); - }else { -dma_unmap_single (dev, req->out.dh.r, req->ctx.dh->p_size, -DMA_FROM_DEVICE ); +kfree_sensitive (req->dst_align); } +dma_unmap_single (dev, req->out.dh.r, req->ctx.dh->p_size, +DMA_FROM_DEVICE ); +dma_unmap_single (dev, req->phy_in,sizeof (struct qat_dh_input_params ),DMA_TO_DEVICE ); dma_unmap_single(dev, req->phy_out,
@@ -231,6 +226,7 @@ static int qat_dh_compute_value(struct kpp_request *req)struct icp_qat_fw_pke_request *msg = &qat_req->req;int ret;int n_input_params =0 ; +u8 *vaddr;if (unlikely (!ctx->xa))return -EINVAL ;
@@ -287,27 +283,24 @@ static int qat_dh_compute_value(struct kpp_request *req)*/ if (sg_is_last (req->src) && req->src_len == ctx->p_size) { qat_req->src_align =NULL ; - qat_req->in.dh.in.b =dma_map_single (dev, -sg_virt (req->src), - req->src_len, -DMA_TO_DEVICE ); -if (unlikely (dma_mapping_error (dev, - qat_req->in.dh.in.b))) -return ret; - + vaddr =sg_virt (req->src); }else {int shift = ctx->p_size - req->src_len; - qat_req->src_align =dma_alloc_coherent (dev, - ctx->p_size, - &qat_req->in.dh.in.b, -GFP_KERNEL ); + qat_req->src_align =kzalloc (ctx->p_size,GFP_KERNEL );if (unlikely (!qat_req->src_align))return ret;scatterwalk_map_and_copy (qat_req->src_align + shift, req->src,0 , req->src_len,0 ); + + vaddr = qat_req->src_align; } + + qat_req->in.dh.in.b =dma_map_single (dev, vaddr, ctx->p_size, +DMA_TO_DEVICE ); +if (unlikely (dma_mapping_error (dev, qat_req->in.dh.in.b))) + goto unmap_src; }/* * dst can be of any size in valid range, but HW expects it to be the
@@ -318,20 +311,18 @@ static int qat_dh_compute_value(struct kpp_request *req)*/ if (sg_is_last (req->dst) && req->dst_len == ctx->p_size) { qat_req->dst_align =NULL ; - qat_req->out.dh.r =dma_map_single (dev,sg_virt (req->dst), - req->dst_len, -DMA_FROM_DEVICE ); - -if (unlikely (dma_mapping_error (dev, qat_req->out.dh.r))) - goto unmap_src; - + vaddr =sg_virt (req->dst); }else { - qat_req->dst_align =dma_alloc_coherent (dev, ctx->p_size, - &qat_req->out.dh.r, -GFP_KERNEL ); + qat_req->dst_align =kzalloc (ctx->p_size,GFP_KERNEL );if (unlikely (!qat_req->dst_align)) goto unmap_src; + + vaddr = qat_req->dst_align; } + qat_req->out.dh.r =dma_map_single (dev, vaddr, ctx->p_size, +DMA_FROM_DEVICE ); +if (unlikely (dma_mapping_error (dev, qat_req->out.dh.r))) + goto unmap_dst; qat_req->in.dh.in_tab[n_input_params] =0 ; qat_req->out.dh.out_tab[1 ] =0 ;
@@ -371,23 +362,17 @@ static int qat_dh_compute_value(struct kpp_request *req)sizeof (struct qat_dh_input_params ), DMA_TO_DEVICE); unmap_dst: -if (qat_req->dst_align) -dma_free_coherent (dev, ctx->p_size, qat_req->dst_align, - qat_req->out.dh.r); -else -if (!dma_mapping_error (dev, qat_req->out.dh.r)) -dma_unmap_single (dev, qat_req->out.dh.r, ctx->p_size, -DMA_FROM_DEVICE ); +if (!dma_mapping_error (dev, qat_req->out.dh.r)) +dma_unmap_single (dev, qat_req->out.dh.r, ctx->p_size, +DMA_FROM_DEVICE ); +kfree_sensitive (qat_req->dst_align); unmap_src:if (req->src) { -if (qat_req->src_align) -dma_free_coherent (dev, ctx->p_size, qat_req->src_align, - qat_req->in.dh.in.b); -else -if (!dma_mapping_error (dev, qat_req->in.dh.in.b)) -dma_unmap_single (dev, qat_req->in.dh.in.b, - ctx->p_size, -DMA_TO_DEVICE ); +if (!dma_mapping_error (dev, qat_req->in.dh.in.b)) +dma_unmap_single (dev, qat_req->in.dh.in.b, + ctx->p_size, +DMA_TO_DEVICE ); +kfree_sensitive (qat_req->src_align); }return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 133/158 mm/mempolicy: fix uninit-value in mpol_rebind_policy()
In reply to Greg Kroah-HartmanFrom: Wang Cheng <[email protected]>
commit 018160ad314d75b1409129b2247b614a9f35894c upstream.
mpol_set_nodemask()(mm/mempolicy.c) does not set up nodemask when pol->mode is MPOL_LOCAL. Check pol->mode before access pol->w.cpuset_mems_allowed in mpol_rebind_policy()(mm/mempolicy.c).
BUG: KMSAN: uninit-value in mpol_rebind_policy mm/mempolicy.c:352 [inline] BUG: KMSAN: uninit-value in mpol_rebind_task+0x2ac/0x2c0 mm/mempolicy.c:368 mpol_rebind_policy mm/mempolicy.c:352 [inline] mpol_rebind_task+0x2ac/0x2c0 mm/mempolicy.c:368 cpuset_change_task_nodemask kernel/cgroup/cpuset.c:1711 [inline] cpuset_attach+0x787/0x15e0 kernel/cgroup/cpuset.c:2278 cgroup_migrate_execute+0x1023/0x1d20 kernel/cgroup/cgroup.c:2515 cgroup_migrate kernel/cgroup/cgroup.c:2771 [inline] cgroup_attach_task+0x540/0x8b0 kernel/cgroup/cgroup.c:2804 __cgroup1_procs_write+0x5cc/0x7a0 kernel/cgroup/cgroup-v1.c:520 cgroup1_tasks_write+0x94/0xb0 kernel/cgroup/cgroup-v1.c:539 cgroup_file_write+0x4c2/0x9e0 kernel/cgroup/cgroup.c:3852 kernfs_fop_write_iter+0x66a/0x9f0 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2162 [inline] new_sync_write fs/read_write.c:503 [inline] vfs_write+0x1318/0x2030 fs/read_write.c:590 ksys_write+0x28b/0x510 fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __x64_sys_write+0xdb/0x120 fs/read_write.c:652 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x44/0xae
Uninit was created at:
slab_post_alloc_hook mm/slab.h:524 [inline] slab_alloc_node mm/slub.c:3251 [inline] slab_alloc mm/slub.c:3259 [inline] kmem_cache_alloc+0x902/0x11c0 mm/slub.c:3264 mpol_new mm/mempolicy.c:293 [inline] do_set_mempolicy+0x421/0xb70 mm/mempolicy.c:853 kernel_set_mempolicy mm/mempolicy.c:1504 [inline] __do_sys_set_mempolicy mm/mempolicy.c:1510 [inline] __se_sys_set_mempolicy+0x44c/0xb60 mm/mempolicy.c:1507 __x64_sys_set_mempolicy+0xd8/0x110 mm/mempolicy.c:1507 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x44/0xae
KMSAN: uninit-value in mpol_rebind_task (2)
https://syzkaller.appspot.com/bug?id=d6eb90f952c2a5de9ea718a1b873c55cb13b59dc
This patch seems to fix below bug too.
KMSAN: uninit-value in mpol_rebind_mm (2)
https://syzkaller.appspot.com/bug?id=f2fecd0d7013f54ec4162f60743a2b28df40926b
The uninit-value is pol->w.cpuset_mems_allowed in mpol_rebind_policy(). When syzkaller reproducer runs to the beginning of mpol_new(),
mpol_new() mm/mempolicy.c
do_mbind() mm/mempolicy.c
kernel_mbind() mm/mempolicy.c
mode is 1(MPOL_PREFERRED), nodes_empty(*nodes) is true and flags is 0. Then
mode = MPOL_LOCAL; ... policy->mode = mode; policy->flags = flags;
will be executed. So in mpol_set_nodemask(),
mpol_set_nodemask() mm/mempolicy.c do_mbind() kernel_mbind()
pol->mode is 4 (MPOL_LOCAL), that nodemask in pol is not initialized, which will be accessed in mpol_rebind_policy().
--- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mempolicy.c +1 -1
@@ -350,7 +350,7 @@ static void mpol_rebind_preferred(struct*/ static void mpol_rebind_policy (struct mempolicy *pol,const nodemask_t *newmask) { -if (!pol) +if (!pol || pol->mode ==MPOL_LOCAL )return ;if (!mpol_store_user_nodemask (pol) &&nodes_equal (pol->w.cpuset_mems_allowed, *newmask))
Greg Kroah-Hartman
maintainerPATCH 148/158 crypto: qat - add param check for DH
In reply to Greg Kroah-HartmanFrom: Giovanni Cabiddu <[email protected]>
[ Upstream commit 2acbb8771f6ac82422886e63832ee7a0f4b1635b ]
Reject requests with a source buffer that is bigger than the size of the key. This is to prevent a possible integer underflow that might happen when copying the source scatterlist into a linear buffer.
--- drivers/crypto/qat/qat_common/qat_asym_algs.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/crypto/qat/qat_common/qat_asym_algs.c +4 -0
@@ -235,6 +235,10 @@ static int qat_dh_compute_value(struct kpp_request *req) req->dst_len = ctx->p_size;return -EOVERFLOW ; } + +if (req->src_len > ctx->p_size) +return -EINVAL ; +memset (msg,'\0' ,sizeof (*msg));ICP_QAT_FW_PKE_HDR_VALID_FLAG_SET (msg->pke_hdr,ICP_QAT_FW_COMN_REQ_FLAG_SET );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 150/158 exfat: fix referencing wrong parent directory information after renaming
In reply to Greg Kroah-HartmanFrom: Yuezhang Mo <[email protected]>
[ Upstream commit d8dad2588addd1d861ce19e7df3b702330f0c7e3 ]
During renaming, the parent directory information maybe updated. But the file/directory still references to the old parent directory information.
This bug will cause 2 problems.
(1) The renamed file can not be written.
[10768.175172] exFAT-fs (sda1): error, failed to bmap (inode : 7afd50e4 iblock : 0, err : -5)
[10768.184285] exFAT-fs (sda1): Filesystem has been set read-only
ash: write error: Input/output error(2) Some dentries of the renamed file/directory are not set to deleted after removing the file/directory.
exfat_update_parent_info() is a workaround for the wrong parent directory information being used after renaming. Now that bug is fixed, this is no longer needed, so remove it.
--- fs/exfat/namei.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-)
fs/exfat/namei.c +1 -26
@@ -1080,6 +1080,7 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,exfat_remove_entries (inode, p_dir, oldentry,0 , num_old_entries); + ei->dir = *p_dir; ei->entry = newentry; }else {if (exfat_get_entry_type (epold) ==TYPE_FILE ) {
@@ -1167,28 +1168,6 @@ static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,return 0 ; } -static void exfat_update_parent_info (struct exfat_inode_info *ei, -struct inode *parent_inode) -{ -struct exfat_sb_info *sbi =EXFAT_SB (parent_inode->i_sb); -struct exfat_inode_info *parent_ei =EXFAT_I (parent_inode); -loff_t parent_isize =i_size_read (parent_inode); - -/* -* the problem that struct exfat_inode_info caches wrong parent info. -* -* because of flag-mismatch of ei->dir, -* there is abnormal traversing cluster chain. -*/ -if (unlikely (parent_ei->flags != ei->dir.flags || - parent_isize !=EXFAT_CLU_TO_B (ei->dir.size, sbi) || - parent_ei->start_clu != ei->dir.dir)) { -exfat_chain_set (&ei->dir, parent_ei->start_clu, -EXFAT_B_TO_CLU_ROUND_UP (parent_isize, sbi), - parent_ei->flags); - } -} -/* rename or move a old file into a new file */ static int __exfat_rename(struct inode *old_parent_inode, struct exfat_inode_info *ei, struct inode *new_parent_inode,
@@ -1219,8 +1198,6 @@ static int __exfat_rename(struct inode *old_parent_inode,return -ENOENT ; } -exfat_update_parent_info (ei, old_parent_inode); -exfat_chain_dup (&olddir, &ei->dir); dentry = ei->entry;
@@ -1241,8 +1218,6 @@ static int __exfat_rename(struct inode *old_parent_inode, goto out; } -exfat_update_parent_info (new_ei, new_parent_inode); - p_dir = &(new_ei->dir); new_entry = new_ei->entry; ep =exfat_get_dentry (sb, p_dir, new_entry, &new_bh);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 149/158 crypto: qat - re-enable registration of algorithms
In reply to Greg Kroah-HartmanFrom: Giovanni Cabiddu <[email protected]>
[ Upstream commit d09144745959bf7852ccafd73243dd7d1eaeb163 ]
Re-enable the registration of algorithms after fixes to (1) use pre-allocated buffers in the datapath and (2) support the CRYPTO_TFM_REQ_MAY_BACKLOG flag.
This reverts commit 8893d27ffcaf6ec6267038a177cb87bcde4dd3de.
--- drivers/crypto/qat/qat_4xxx/adf_drv.c | 7 ------- drivers/crypto/qat/qat_common/qat_crypto.c | 7 ------- 2 files changed, 14 deletions(-)
drivers/crypto/qat/qat_4xxx/adf_drv.c +0 -7
@@ -75,13 +75,6 @@ static int adf_crypto_dev_config(struct adf_accel_dev *accel_dev)if (ret) goto err; -/* Temporarily set the number of crypto instances to zero to avoid -* registering the crypto algorithms. -* This will be removed when the algorithms will support the -* CRYPTO_TFM_REQ_MAY_BACKLOG flag -*/ - instances =0 ; -for (i =0 ; i < instances; i++) { val = i; bank = i *2 ;
drivers/crypto/qat/qat_common/qat_crypto.c +0 -7
@@ -161,13 +161,6 @@ int qat_crypto_dev_config(struct adf_accel_dev *accel_dev)if (ret) goto err; -/* Temporarily set the number of crypto instances to zero to avoid -* registering the crypto algorithms. -* This will be removed when the algorithms will support the -* CRYPTO_TFM_REQ_MAY_BACKLOG flag -*/ - instances =0 ; -for (i =0 ; i < instances; i++) { val = i;snprintf (key,sizeof (key),ADF_CY "%d" ADF_RING_ASYM_BANK_NUM , i);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 151/158 exfat: use updated exfat_chain directly during renaming
In reply to Greg Kroah-HartmanFrom: Sungjong Seo <[email protected]>
commit 204e6ceaa1035cb7b92b156517e88842ebb4c7ff upstream.
In order for a file to access its own directory entry set, exfat_inode_info(ei) has two copied values. One is ei->dir, which is a snapshot of exfat_chain of the parent directory, and the other is ei->entry, which is the offset of the start of the directory entry set in the parent directory.
Since the parent directory can be updated after the snapshot point, it should be used only for accessing one's own directory entry set.
However, as of now, during renaming, it could try to traverse or to allocate clusters via snapshot values, it does not make sense.
This potential problem has been revealed when exfat_update_parent_info() was removed by commit d8dad2588add ("exfat: fix referencing wrong parent directory information after renaming"). However, I don't think it's good idea to bring exfat_update_parent_info() back.
Instead, let's use the updated exfat_chain of parent directory diectly.
--- fs/exfat/namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/exfat/namei.c +3 -1
@@ -1198,7 +1198,9 @@ static int __exfat_rename(struct inode *return -ENOENT ; } -exfat_chain_dup (&olddir, &ei->dir); +exfat_chain_set (&olddir,EXFAT_I (old_parent_inode)->start_clu, +EXFAT_B_TO_CLU_ROUND_UP (i_size_read (old_parent_inode), sbi), +EXFAT_I (old_parent_inode)->flags); dentry = ei->entry; ep =exfat_get_dentry (sb, &olddir, dentry, &old_bh);
Greg Kroah-Hartman
maintainerPATCH 96/158 gpio: pca953x: use the correct range when do regmap sync
In reply to Greg Kroah-HartmanFrom: Haibo Chen <[email protected]>
[ Upstream commit 2abc17a93867dc816f0ed9d32021dda8078e7330 ]
regmap will sync a range of registers, here use the correct range to make sure the sync do not touch other unexpected registers.
Find on pca9557pw on imx8qxp/dxl evk board, this device support 8 pin, so only need one register(8 bits) to cover all the 8 pins's property setting. But when sync the output, we find it actually update two registers, output register and the following register.
--- drivers/gpio/gpio-pca953x.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpio/gpio-pca953x.c +6 -6
@@ -900,12 +900,12 @@ static int device_pca95xx_init(struct pca953x_chip *chip, u32 invert)int ret; ret =regcache_sync_region (chip->regmap, chip->regs->output, - chip->regs->output +NBANK (chip)); + chip->regs->output +NBANK (chip) -1 );if (ret) goto out; ret =regcache_sync_region (chip->regmap, chip->regs->direction, - chip->regs->direction +NBANK (chip)); + chip->regs->direction +NBANK (chip) -1 );if (ret) goto out;
@@ -1118,14 +1118,14 @@ static int pca953x_regcache_sync(struct device *dev)* sync these registers first and only then sync the rest. */ regaddr =pca953x_recalc_addr (chip, chip->regs->direction,0 ); - ret =regcache_sync_region (chip->regmap, regaddr, regaddr +NBANK (chip)); + ret =regcache_sync_region (chip->regmap, regaddr, regaddr +NBANK (chip) -1 );if (ret) {dev_err (dev,"Failed to sync GPIO dir registers: %d\n" , ret);return ret; } regaddr =pca953x_recalc_addr (chip, chip->regs->output,0 ); - ret =regcache_sync_region (chip->regmap, regaddr, regaddr +NBANK (chip)); + ret =regcache_sync_region (chip->regmap, regaddr, regaddr +NBANK (chip) -1 );if (ret) {dev_err (dev,"Failed to sync GPIO out registers: %d\n" , ret);return ret;
@@ -1135,7 +1135,7 @@ static int pca953x_regcache_sync(struct device *dev)if (chip->driver_data &PCA_PCAL ) { regaddr =pca953x_recalc_addr (chip,PCAL953X_IN_LATCH ,0 ); ret =regcache_sync_region (chip->regmap, regaddr, - regaddr +NBANK (chip)); + regaddr +NBANK (chip) -1 );if (ret) {dev_err (dev,"Failed to sync INT latch registers: %d\n" , ret);
@@ -1144,7 +1144,7 @@ static int pca953x_regcache_sync(struct device *dev) regaddr =pca953x_recalc_addr (chip,PCAL953X_INT_MASK ,0 ); ret =regcache_sync_region (chip->regmap, regaddr, - regaddr +NBANK (chip)); + regaddr +NBANK (chip) -1 );if (ret) {dev_err (dev,"Failed to sync INT mask registers: %d\n" , ret);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 152/158 x86/amd: Use IBPB for firmware calls
In reply to Greg Kroah-HartmanFrom: Peter Zijlstra <[email protected]>
commit 28a99e95f55c61855983d36a88c05c178d966bb7 upstream.
On AMD IBRS does not prevent Retbleed; as such use IBPB before a firmware call to flush the branch history state.
And because in order to do an EFI call, the kernel maps a whole lot of the kernel page table into the EFI page table, do an IBPB just in case in order to prevent the scenario of poisoning the BTB and causing an EFI call using the unprotected RET there.
[ bp: Massage. ]
--- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/nospec-branch.h | 2 ++ arch/x86/kernel/cpu/bugs.c | 11 ++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-)
arch/x86/include/asm/cpufeatures.h +1 -0
@@ -301,6 +301,7 @@#define X86_FEATURE_RETPOLINE_LFENCE (11*32+13)/* "" Use LFENCE for Spectre variant 2 */ #define X86_FEATURE_RETHUNK (11*32+14)/* "" Use REturn THUNK */ #define X86_FEATURE_UNRET (11*32+15)/* "" AMD BTB untrain return */ +#define X86_FEATURE_USE_IBPB_FW (11*32+16)/* "" Use IBPB during runtime firmware calls */ /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */ #define X86_FEATURE_AVX_VNNI (12*32+ 4)/* AVX VNNI instructions */
arch/x86/include/asm/nospec-branch.h +2 -0
@@ -297,6 +297,8 @@ do { \alternative_msr_write (MSR_IA32_SPEC_CTRL , \spec_ctrl_current () |SPEC_CTRL_IBRS , \X86_FEATURE_USE_IBRS_FW ); \ +alternative_msr_write (MSR_IA32_PRED_CMD ,PRED_CMD_IBPB , \ +X86_FEATURE_USE_IBPB_FW ); \ }while (0 ) #define firmware_restrict_branch_speculation_end() \
arch/x86/kernel/cpu/bugs.c +10 -1
@@ -1512,7 +1512,16 @@ static void __init spectre_v2_select_mit* the CPU supports Enhanced IBRS, kernel might un-intentionally not * enable IBRS around firmware calls. */ -if (boot_cpu_has (X86_FEATURE_IBRS ) && !spectre_v2_in_ibrs_mode (mode)) { +if (boot_cpu_has_bug (X86_BUG_RETBLEED ) && + (boot_cpu_data.x86_vendor ==X86_VENDOR_AMD || + boot_cpu_data.x86_vendor ==X86_VENDOR_HYGON )) { + +if (retbleed_cmd !=RETBLEED_CMD_IBPB ) { +setup_force_cpu_cap (X86_FEATURE_USE_IBPB_FW ); +pr_info ("Enabling Speculation Barrier for firmware calls\n" ); + } + + }else if (boot_cpu_has (X86_FEATURE_IBRS ) && !spectre_v2_in_ibrs_mode (mode)) {setup_force_cpu_cap (X86_FEATURE_USE_IBRS_FW );pr_info ("Enabling Restricted Speculation for firmware calls\n" ); }
Greg Kroah-Hartman
maintainerPATCH 153/158 x86/alternative: Report missing return thunk details
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
commit 65cdf0d623bedf0e069bb64ed52e8bb20105e2ba upstream.
Debugging missing return thunks is easier if we can see where they're happening.
--- arch/x86/kernel/alternative.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/alternative.c +3 -1
@@ -555,7 +555,9 @@ void __init_or_module noinline apply_ret dest = addr + insn.length + insn.immediate.value;if (__static_call_fixup (addr, op, dest) || -WARN_ON_ONCE (dest != &__x86_return_thunk)) +WARN_ONCE (dest != &__x86_return_thunk, +"missing return thunk: %pS-%pS: %*ph" , + addr, dest,5 , addr))continue ; DPRINTK("return thunk at: %pS (%px) len: %d to: %pS",
Greg Kroah-Hartman
maintainerPATCH 154/158 watchqueue: make sure to serialize wqueue->defunct properly
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
commit 353f7988dd8413c47718f7ca79c030b6fb62cfe5 upstream.
When the pipe is closed, we mark the associated watchqueue defunct by calling watch_queue_clear(). However, while that is protected by the watchqueue lock, new watchqueue entries aren't actually added under that lock at all: they use the pipe->rd_wait.lock instead, and looking up that pipe happens without any locking.
The watchqueue code uses the RCU read-side section to make sure that the wqueue entry itself hasn't disappeared, but that does not protect the pipe_info in any way.
So make sure to actually hold the wqueue lock when posting watch events, properly serializing against the pipe being torn down.
--- kernel/watch_queue.c | 53 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 16 deletions(-)
kernel/watch_queue.c +37 -16
@@ -34,6 +34,27 @@ MODULE_LICENSE("GPL");#define WATCH_QUEUE_NOTE_SIZE 128#define WATCH_QUEUE_NOTES_PER_PAGE (PAGE_SIZE / WATCH_QUEUE_NOTE_SIZE) +/* +* This must be called under the RCU read-lock, which makes +* sure that the wqueue still exists. It can then take the lock, +* and check that the wqueue hasn't been destroyed, which in +* turn makes sure that the notification pipe still exists. +*/ +static inline bool lock_wqueue (struct watch_queue *wqueue) +{ +spin_lock_bh (&wqueue->lock); +if (unlikely (wqueue->defunct)) { +spin_unlock_bh (&wqueue->lock); +return false; + } +return true; +} + +static inline void unlock_wqueue (struct watch_queue *wqueue) +{ +spin_unlock_bh (&wqueue->lock); +} +static void watch_queue_pipe_buf_release (struct pipe_inode_info *pipe,struct pipe_buffer *buf) {
@@ -69,6 +90,10 @@ static const struct pipe_buf_operations/* * Post a notification to a watch queue. +* +* Must be called with the RCU lock for reading, and the +* watch_queue lock held, which guarantees that the pipe +* hasn't been released. */ static bool post_one_notification (struct watch_queue *wqueue,struct watch_notification *n)
@@ -85,9 +110,6 @@ static bool post_one_notification(structspin_lock_irq (&pipe->rd_wait.lock); -if (wqueue->defunct) - goto out; - mask = pipe->ring_size -1 ; head = pipe->head; tail = pipe->tail;
@@ -203,7 +225,10 @@ void __post_watch_notification(struct waif (security_post_notification (watch->cred, cred, n) <0 )continue ; -post_one_notification (wqueue, n); +if (lock_wqueue (wqueue)) { +post_one_notification (wqueue, n); +unlock_wqueue (wqueue);; + } }rcu_read_unlock ();
@@ -462,11 +487,12 @@ int add_watch_to_object(struct watch *wareturn -EAGAIN ; } -spin_lock_bh (&wqueue->lock); -kref_get (&wqueue->usage); -kref_get (&watch->usage); -hlist_add_head (&watch->queue_node, &wqueue->watches); -spin_unlock_bh (&wqueue->lock); +if (lock_wqueue (wqueue)) { +kref_get (&wqueue->usage); +kref_get (&watch->usage); +hlist_add_head (&watch->queue_node, &wqueue->watches); +unlock_wqueue (wqueue); + }hlist_add_head (&watch->list_node, &wlist->watchers);return 0 ;
@@ -520,20 +546,15 @@ found: wqueue =rcu_dereference (watch->queue); -/* We don't need the watch list lock for the next bit as RCU is -* protecting *wqueue from deallocation. -*/ -if (wqueue) { +if (lock_wqueue (wqueue)) {post_one_notification (wqueue, &n.watch); -spin_lock_bh (&wqueue->lock); -if (!hlist_unhashed (&watch->queue_node)) {hlist_del_init_rcu (&watch->queue_node);put_watch (watch); } -spin_unlock_bh (&wqueue->lock); +unlock_wqueue (wqueue); }if (wlist->release_watch) {
Greg Kroah-Hartman
maintainerPATCH 155/158 ASoC: SOF: pm: add explicit behavior for ACPI S1 and S2
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
commit a933084558c61cac8c902d2474b39444d87fba46 upstream.
The existing code only deals with S0 and S3, let's start adding S1 and S2.
No functional change.
--- sound/soc/sof/pm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
sound/soc/sof/pm.c +11 -1
@@ -327,8 +327,18 @@ int snd_sof_prepare(struct device *dev)return 0 ;#if defined(CONFIG_ACPI ) -if (acpi_target_system_state () ==ACPI_STATE_S0 ) +switch (acpi_target_system_state ()) { +case ACPI_STATE_S0 : sdev->system_suspend_target =SOF_SUSPEND_S0IX ; +break ; +case ACPI_STATE_S1 : +case ACPI_STATE_S2 : +case ACPI_STATE_S3 : + sdev->system_suspend_target =SOF_SUSPEND_S3 ; +break ; +default : +break ; + }#endif return 0 ;
Greg Kroah-Hartman
maintainerPATCH 157/158 ASoC: SOF: Intel: disable IMR boot when resuming from ACPI S4 and S5 states
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
commit 391153522d186f19a008d824bb3a05950351ce6c upstream.
The IMR was assumed to be preserved when suspending to S4 and S5 states, but community reports invalidate that assumption, the hardware seems to be powered off and the IMR memory content cleared.
Make sure regular boot with firmware download is used for S4 and S5.
--- sound/soc/sof/intel/hda-loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/sof/intel/hda-loader.c +2 -1
@@ -397,7 +397,8 @@ int hda_dsp_cl_boot_firmware(struct snd_struct firmware stripped_firmware;int ret, ret1, i; -if ((sdev->fw_ready.flags &SOF_IPC_INFO_D3_PERSISTENT ) && +if ((sdev->system_suspend_target <SOF_SUSPEND_S4 ) && + (sdev->fw_ready.flags &SOF_IPC_INFO_D3_PERSISTENT ) && !(sof_debug_check_flag (SOF_DBG_IGNORE_D3_PERSISTENT )) && !sdev->first_boot) {dev_dbg (sdev->dev,"IMR restore supported, booting from IMR directly\n" );
Greg Kroah-Hartman
maintainerPATCH 158/158 watch-queue: remove spurious double semicolon
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
commit 44e29e64cf1ac0cffb152e0532227ea6d002aa28 upstream.
Sedat Dilek noticed that I had an extraneous semicolon at the end of a line in the previous patch.
It's harmless, but unintentional, and while compilers just treat it as an extra empty statement, for all I know some other tooling might warn about it. So clean it up before other people notice too ;)
--- kernel/watch_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/watch_queue.c +1 -1
@@ -227,7 +227,7 @@ void __post_watch_notification(struct waif (lock_wqueue (wqueue)) {post_one_notification (wqueue, n); -unlock_wqueue (wqueue);; +unlock_wqueue (wqueue); } }
Greg Kroah-Hartman
maintainerPATCH 134/158 bpf: Make sure mac_header was set before using it
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit 0326195f523a549e0a9d7fd44c70b26fd7265090 upstream.
Classic BPF has a way to load bytes starting from the mac header.
Some skbs do not have a mac header, and skb_mac_header() in this case is returning a pointer that 65535 bytes after skb->head.
Existing range check in bpf_internal_load_pointer_neg_helper() was properly kicking and no illegal access was happening.
New sanity check in skb_mac_header() is firing, so we need to avoid it.
WARNING: CPU: 1 PID: 28990 at include/linux/skbuff.h:2785 skb_mac_header include/linux/skbuff.h:2785 [inline] WARNING: CPU: 1 PID: 28990 at include/linux/skbuff.h:2785 bpf_internal_load_pointer_neg_helper+0x1b1/0x1c0 kernel/bpf/core.c:74 Modules linked in: CPU: 1 PID: 28990 Comm: syz-executor.0 Not tainted 5.19.0-rc4-syzkaller-00865-g4874fb9484be #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 RIP: 0010:skb_mac_header include/linux/skbuff.h:2785 [inline] RIP: 0010:bpf_internal_load_pointer_neg_helper+0x1b1/0x1c0 kernel/bpf/core.c:74 Code: ff ff 45 31 f6 e9 5a ff ff ff e8 aa 27 40 00 e9 3b ff ff ff e8 90 27 40 00 e9 df fe ff ff e8 86 27 40 00 eb 9e e8 2f 2c f3 ff <0f> 0b eb b1 e8 96 27 40 00 e9 79 fe ff ff 90 41 57 41 56 41 55 41 RSP: 0018:ffffc9000309f668 EFLAGS: 00010216 RAX: 0000000000000118 RBX: ffffffffffeff00c RCX: ffffc9000e417000 RDX: 0000000000040000 RSI: ffffffff81873f21 RDI: 0000000000000003 RBP: ffff8880842878c0 R08: 0000000000000003 R09: 000000000000ffff R10: 000000000000ffff R11: 0000000000000001 R12: 0000000000000004 R13: ffff88803ac56c00 R14: 000000000000ffff R15: dffffc0000000000 FS: 00007f5c88a16700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fdaa9f6c058 CR3: 000000003a82c000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> ____bpf_skb_load_helper_32 net/core/filter.c:276 [inline] bpf_skb_load_helper_32+0x191/0x220 net/core/filter.c:264
--- kernel/bpf/core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
kernel/bpf/core.c +5 -3
@@ -68,11 +68,13 @@ void *bpf_internal_load_pointer_neg_help {u8 *ptr =NULL ; -if (k >=SKF_NET_OFF ) +if (k >=SKF_NET_OFF ) { ptr =skb_network_header (skb) + k -SKF_NET_OFF ; -else if (k >=SKF_LL_OFF ) + }else if (k >=SKF_LL_OFF ) { +if (unlikely (!skb_mac_header_was_set (skb))) +return NULL ; ptr =skb_mac_header (skb) + k -SKF_LL_OFF ; - + }if (ptr >= skb->head && ptr + size <=skb_tail_pointer (skb))return ptr;
Greg Kroah-Hartman
maintainerPATCH 136/158 perf/x86/intel/lbr: Fix unchecked MSR access error on HSW
In reply to Greg Kroah-HartmanFrom: Kan Liang <[email protected]>
commit b0380e13502adf7dd8be4c47d622c3522aae6c63 upstream.
The fuzzer triggers the below trace.
[ 7763.384369] unchecked MSR access error: WRMSR to 0x689 (tried to write 0x1fffffff8101349e) at rIP: 0xffffffff810704a4 (native_write_msr+0x4/0x20) [ 7763.397420] Call Trace: [ 7763.399881] <TASK> [ 7763.401994] intel_pmu_lbr_restore+0x9a/0x1f0 [ 7763.406363] intel_pmu_lbr_sched_task+0x91/0x1c0 [ 7763.410992] __perf_event_task_sched_in+0x1cd/0x240
On a machine with the LBR format LBR_FORMAT_EIP_FLAGS2, when the TSX is disabled, a TSX quirk is required to access LBR from registers. The lbr_from_signext_quirk_needed() is introduced to determine whether the TSX quirk should be applied. However, the lbr_from_signext_quirk_needed() is invoked before the intel_pmu_lbr_init(), which parses the LBR format information. Without the correct LBR format information, the TSX quirk never be applied.
Move the lbr_from_signext_quirk_needed() into the intel_pmu_lbr_init(). Checking x86_pmu.lbr_has_tsx in the lbr_from_signext_quirk_needed() is not required anymore.
Both LBR_FORMAT_EIP_FLAGS2 and LBR_FORMAT_INFO have LBR_TSX flag, but only the LBR_FORMAT_EIP_FLAGS2 requirs the quirk. Update the comments accordingly.
--- arch/x86/events/intel/lbr.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
arch/x86/events/intel/lbr.c +10 -9
@@ -278,9 +278,9 @@ enum { };/* -* For formats with LBR_TSX flags (e.g. LBR_FORMAT_EIP_FLAGS2), bits 61:62 in -* MSR_LAST_BRANCH_FROM_x are the TSX flags when TSX is supported, but when -* TSX is not supported they have no consistent behavior: +* For format LBR_FORMAT_EIP_FLAGS2, bits 61:62 in MSR_LAST_BRANCH_FROM_x +* are the TSX flags when TSX is supported, but when TSX is not supported +* they have no consistent behavior: * * - For wrmsr(), bits 61:62 are considered part of the sign extension. * - For HW updates (branch captures) bits 61:62 are always OFF and are not
@@ -288,7 +288,7 @@ enum {* * Therefore, if: * -* 1) LBR has TSX format +* 1) LBR format LBR_FORMAT_EIP_FLAGS2 * 2) CPU has no TSX support enabled * * ... then any value passed to wrmsr() must be sign extended to 63 bits and any
@@ -300,7 +300,7 @@ static inline bool lbr_from_signext_quirbool tsx_support =boot_cpu_has (X86_FEATURE_HLE ) ||boot_cpu_has (X86_FEATURE_RTM ); -return !tsx_support && x86_pmu.lbr_has_tsx; +return !tsx_support; }static DEFINE_STATIC_KEY_FALSE (lbr_from_quirk_key);
@@ -1611,9 +1611,6 @@ void intel_pmu_lbr_init_hsw(void) x86_pmu.lbr_sel_map = hsw_lbr_sel_map;x86_get_pmu (smp_processor_id ())->task_ctx_cache =create_lbr_kmem_cache (size,0 ); - -if (lbr_from_signext_quirk_needed ()) -static_branch_enable (&lbr_from_quirk_key); }/* skylake */
@@ -1704,7 +1701,11 @@ void intel_pmu_lbr_init(void)switch (x86_pmu.intel_cap.lbr_format) {case LBR_FORMAT_EIP_FLAGS2 : x86_pmu.lbr_has_tsx =1 ; - fallthrough; + x86_pmu.lbr_from_flags =1 ; +if (lbr_from_signext_quirk_needed ()) +static_branch_enable (&lbr_from_quirk_key); +break ; +case LBR_FORMAT_EIP_FLAGS : x86_pmu.lbr_from_flags =1 ;break ;
Greg Kroah-Hartman
maintainerPATCH 156/158 ASoC: SOF: pm: add definitions for S4 and S5 states
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
commit 9d2d462713384538477703e68577b05131c7d97d upstream.
We currently don't have a means to differentiate between S3, S4 and S5. Add definitions so that we have select different code paths depending on the target state in follow-up patches.
--- sound/soc/sof/pm.c | 9 +++++++++ sound/soc/sof/sof-priv.h | 2 ++ 2 files changed, 11 insertions(+)
sound/soc/sof/pm.c +9 -0
@@ -23,6 +23,9 @@ static u32 snd_sof_dsp_power_target(struu32 target_dsp_state;switch (sdev->system_suspend_target) { +case SOF_SUSPEND_S5 : +case SOF_SUSPEND_S4 : +/* DSP should be in D3 if the system is suspending to S3+ */ case SOF_SUSPEND_S3 :/* DSP should be in D3 if the system is suspending to S3 */ target_dsp_state =SOF_DSP_PM_D3 ;
@@ -336,6 +339,12 @@ int snd_sof_prepare(struct device *dev)case ACPI_STATE_S3 : sdev->system_suspend_target =SOF_SUSPEND_S3 ;break ; +case ACPI_STATE_S4 : + sdev->system_suspend_target =SOF_SUSPEND_S4 ; +break ; +case ACPI_STATE_S5 : + sdev->system_suspend_target =SOF_SUSPEND_S5 ; +break ;default :break ; }
sound/soc/sof/sof-priv.h +2 -0
@@ -85,6 +85,8 @@ enum sof_system_suspend_state {SOF_SUSPEND_NONE =0 ,SOF_SUSPEND_S0IX ,SOF_SUSPEND_S3 , +SOF_SUSPEND_S4 , + SOF_SUSPEND_S5, }; enum sof_dfsentry_type {
Greg Kroah-Hartman
maintainerPATCH 137/158 x86/bugs: Warn when "ibrs" mitigation is selected on Enhanced IBRS parts
In reply to Greg Kroah-HartmanFrom: Pawan Gupta <[email protected]>
commit eb23b5ef9131e6d65011de349a4d25ef1b3d4314 upstream.
IBRS mitigation for spectre_v2 forces write to MSR_IA32_SPEC_CTRL at every kernel entry/exit. On Enhanced IBRS parts setting MSR_IA32_SPEC_CTRL[IBRS] only once at boot is sufficient. MSR writes at every kernel entry/exit incur unnecessary performance loss.
When Enhanced IBRS feature is present, print a warning about this unnecessary performance loss.
--- arch/x86/kernel/cpu/bugs.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kernel/cpu/bugs.c +3 -0
@@ -968,6 +968,7 @@ static inline const char *spectre_v2_mod#define SPECTRE_V2_LFENCE_MSG "WARNING: LFENCE mitigation is not recommended for this CPU, data leaks possible!\n"#define SPECTRE_V2_EIBRS_EBPF_MSG "WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!\n"#define SPECTRE_V2_EIBRS_LFENCE_EBPF_SMT_MSG "WARNING: Unprivileged eBPF is enabled with eIBRS+LFENCE mitigation and SMT, data leaks possible via Spectre v2 BHB attacks!\n" +#define SPECTRE_V2_IBRS_PERF_MSG "WARNING: IBRS mitigation selected on Enhanced IBRS CPU, this may cause unnecessary performance loss\n"#ifdef CONFIG_BPF_SYSCALL void unpriv_ebpf_notify (int new_state)
@@ -1408,6 +1409,8 @@ static void __init spectre_v2_select_mitcase SPECTRE_V2_IBRS :setup_force_cpu_cap (X86_FEATURE_KERNEL_IBRS ); +if (boot_cpu_has (X86_FEATURE_IBRS_ENHANCED )) +pr_warn (SPECTRE_V2_IBRS_PERF_MSG );break ;case SPECTRE_V2_LFENCE :
Greg Kroah-Hartman
maintainerPATCH 138/158 clk: lan966x: Fix the lan966x clock gate register address
In reply to Greg Kroah-HartmanFrom: Herve Codina <[email protected]>
commit 25c2a075eb6a3031813b6051bd10dfc22c36a2a4 upstream.
The register address used for the clock gate register is the base register address coming from first reg map (ie. the generic clock registers) instead of the second reg map defining the clock gate register.
Use the correct clock gate register address.
--- drivers/clk/clk-lan966x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-lan966x.c +1 -1
@@ -213,7 +213,7 @@ static int lan966x_gate_clk_register(str hw_data->hws[i] =devm_clk_hw_register_gate (dev, clk_gate_desc[idx].name, -"lan966x" ,0 , base, +"lan966x" ,0 , gate_base, clk_gate_desc[idx].bit_idx,0 , &clk_gate_lock);
Greg Kroah-Hartman
maintainerPATCH 140/158 crypto: qat - set to zero DH parameters before free
In reply to Greg Kroah-HartmanFrom: Giovanni Cabiddu <[email protected]>
[ Upstream commit 1731160ff7c7bbb11bb1aacb14dd25e18d522779 ]
Set to zero the context buffers containing the DH key before they are freed.
This is a defense in depth measure that avoids keys to be recovered from memory in case the system is compromised between the free of the buffer and when that area of memory (containing keys) gets overwritten.
--- drivers/crypto/qat/qat_common/qat_asym_algs.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/crypto/qat/qat_common/qat_asym_algs.c +3 -0
@@ -420,14 +420,17 @@ static int qat_dh_set_params(struct qat_dh_ctx *ctx, struct dh *params)static void qat_dh_clear_ctx (struct device *dev,struct qat_dh_ctx *ctx) {if (ctx->g) { +memset (ctx->g,0 , ctx->p_size);dma_free_coherent (dev, ctx->p_size, ctx->g, ctx->dma_g); ctx->g =NULL ; }if (ctx->xa) { +memset (ctx->xa,0 , ctx->p_size);dma_free_coherent (dev, ctx->p_size, ctx->xa, ctx->dma_xa); ctx->xa =NULL ; }if (ctx->p) { +memset (ctx->p,0 , ctx->p_size);dma_free_coherent (dev, ctx->p_size, ctx->p, ctx->dma_p); ctx->p =NULL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 135/158 sched/deadline: Fix BUG_ON condition for deboosted tasks
In reply to Greg Kroah-HartmanFrom: Juri Lelli <[email protected]>
commit ddfc710395cccc61247348df9eb18ea50321cbed upstream.
Tasks the are being deboosted from SCHED_DEADLINE might enter enqueue_task_dl() one last time and hit an erroneous BUG_ON condition:
since they are not boosted anymore, the if (is_dl_boosted()) branch is not taken, but the else if (!dl_prio) is and inside this one we BUG_ON(!is_dl_boosted), which is of course false (BUG_ON triggered) otherwise we had entered the if branch above. Long story short, the current condition doesn't make sense and always leads to triggering of a BUG.
Fix this by only checking enqueue flags, properly: ENQUEUE_REPLENISH has to be present, but additional flags are not a problem.
--- kernel/sched/deadline.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
kernel/sched/deadline.c +4 -1
@@ -1669,7 +1669,10 @@ static void enqueue_task_dl(struct rq *r* the throttle. */ p->dl.dl_throttled =0 ; -BUG_ON (!is_dl_boosted (&p->dl) || flags !=ENQUEUE_REPLENISH ); +if (!(flags &ENQUEUE_REPLENISH )) +printk_deferred_once ("sched: DL de-boosted task PID %d: REPLENISH flag missing\n" , +task_pid_nr (p)); +return ; }
Greg Kroah-Hartman
maintainerPATCH 139/158 dlm: fix pending remove if msg allocation fails
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit ba58995909b5098ca4003af65b0ccd5a8d13dd25 ]
This patch unsets ls_remove_len and ls_remove_name if a message allocation of a remove messages fails. In this case we never send a remove message out but set the per ls ls_remove_len ls_remove_name variable for a pending remove. Unset those variable should indicate possible waiters in wait_pending_remove() that no pending remove is going on at this moment.
--- fs/dlm/lock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/dlm/lock.c +2 -1
@@ -4085,13 +4085,14 @@ static void send_repeat_remove(struct dlm_ls *ls, char *ms_name, int len) rv =_create_message (ls,sizeof (struct dlm_message ) + len, dir_nodeid,DLM_MSG_REMOVE , &ms, &mh);if (rv) -return ; + goto out;memcpy (ms->m_extra, name, len); ms->m_hash = hash;send_message (mh, ms); +out:spin_lock (&ls->ls_remove_spin); ls->ls_remove_len =0 ;memset (ls->ls_remove_name,0 ,DLM_RESNAME_MAXLEN );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 131/158 spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers
In reply to Greg Kroah-HartmanFrom: Marc Kleine-Budde <[email protected]>
commit 4ceaa684459d414992acbefb4e4c31f2dfc50641 upstream.
In case a IRQ based transfer times out the bcm2835_spi_handle_err() function is called. Since commit 1513ceee70f2 ("spi: bcm2835: Drop dma_pending flag") the TX and RX DMA transfers are unconditionally canceled, leading to NULL pointer derefs if ctlr->dma_tx or ctlr->dma_rx are not set.
Fix the NULL pointer deref by checking that ctlr->dma_tx and ctlr->dma_rx are valid pointers before accessing them.
--- drivers/spi/spi-bcm2835.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/spi/spi-bcm2835.c +8 -4
@@ -1138,10 +1138,14 @@ static void bcm2835_spi_handle_err(strucstruct bcm2835_spi *bs =spi_controller_get_devdata (ctlr);/* if an error occurred and we have an active dma, then terminate */ -dmaengine_terminate_sync (ctlr->dma_tx); - bs->tx_dma_active = false; -dmaengine_terminate_sync (ctlr->dma_rx); - bs->rx_dma_active = false; +if (ctlr->dma_tx) { +dmaengine_terminate_sync (ctlr->dma_tx); + bs->tx_dma_active = false; + } +if (ctlr->dma_rx) { +dmaengine_terminate_sync (ctlr->dma_rx); + bs->rx_dma_active = false; + }bcm2835_spi_undo_prologue (bs);/* and reset */
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.18.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels and build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.18.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.18.15-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-5.18.y
* git commit: 63d1be154edd5513bff11d778954f7ec7cbf50c1
* git describe: v5.18.14-159-g63d1be154edd
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.18.y/build/v5.18.14-159-g63d1be154edd
## Test Regressions (compared to v5.18.14)
No test regressions found.
## Metric Regressions (compared to v5.18.14)
No metric regressions found.
## Test Fixes (compared to v5.18.14)
No test fixes found.
## Metric Fixes (compared to v5.18.14)
No metric fixes found.
## Test result summary
total: 131463, pass: 120143, fail: 902, skip: 9686, xfail: 732
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 307 total, 307 passed, 0 failed
* arm64: 62 total, 60 passed, 2 failed
* i386: 52 total, 50 passed, 2 failed
* mips: 45 total, 45 passed, 0 failed
* parisc: 12 total, 12 passed, 0 failed
* powerpc: 60 total, 54 passed, 6 failed
* riscv: 27 total, 22 passed, 5 failed
* s390: 18 total, 18 passed, 0 failed
* sh: 24 total, 24 passed, 0 failed
* sparc: 12 total, 12 passed, 0 failed
* x86_64: 56 total, 54 passed, 2 failed
## Test suites summary
* fwts
* igt-gpu-tools
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-open-posix-tests
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* packetdrill
* rcutorture
* ssuite
* v4l2-compliance
* vdso
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.18.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Successfully cross-compiled for arm64 (bcm2711_defconfig, GCC 10.2.0) and powerpc (ps3_defconfig, GCC 12.1.0).
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.18.y
and the diffstat can be found below.
openSUSE configs¹⁾ all green.
¹⁾ armv6hl armv7hl arm64 i386 ppc64 ppc64le riscv64 s390x x86_64
Signature · 2 lines
js suse labs
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.18.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.18:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
130 tests: 130 pass, 0 failLinux version: 5.18.15-rc1-g63d1be154edd
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.18.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Hi Greg,
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
Build test (gcc version 12.1.1 20220724):
mips: 59 configs -> no failure
arm: 99 configs -> no failure
arm64: 3 configs -> no failurex86_64: 4 configs -> no failure
alpha allmodconfig -> no failure
csky allmodconfig -> no failure
powerpc allmodconfig -> no failure
riscv allmodconfig -> no failure
s390 allmodconfig -> no failure
xtensa allmodconfig -> no failure
Boot test:x86_64: Booted on my test laptop. No regression.x86_64: Booted on qemu. No regression. [1]
arm64: Booted on rpi4b (4GB model). No regression. [2]
mips: Booted on ci20 board. No regression. [3]
[1]. https://openqa.qa.codethink.co.uk/tests/1574
[2]. https://openqa.qa.codethink.co.uk/tests/1578
[3]. https://openqa.qa.codethink.co.uk/tests/1580
--
Regards
Sudip
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
Build results:
total: 154 pass: 154 fail: 0 Qemu test results: total: 489 pass: 489 fail: 0
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.18.15 release. There are 158 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 29 Jul 2022 16:09:50 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.18.y
and the diffstat can be found below.thanks,
greg k-h
Tested rc1 against the Fedora build system (aarch64, armv7, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.