iommu/amd: Fix the configuration of GCR3 table root pointer
Subsystems (7)
Sasha Levin
maintainerPATCH 1/19 iommu/amd: Fix the configuration of GCR3 table root pointer
From: Adrian Huang <[email protected]>
[ Upstream commit c20f36534666e37858a14e591114d93cc1be0d34 ]
The SPA of the GCR3 table root pointer[51:31] masks 20 bits. However, this requires 21 bits (Please see the AMD IOMMU specification). This leads to the potential failure when the bit 51 of SPA of the GCR3 table root pointer is 1'.
--- drivers/iommu/amd_iommu_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd_iommu_types.h +1 -1
@@ -303,7 +303,7 @@#define DTE_GCR3_VAL_A (x) (((x) >> 12) & 0x00007ULL)#define DTE_GCR3_VAL_B (x) (((x) >> 15) & 0x0ffffULL) -#define DTE_GCR3_VAL_C (x) (((x) >> 31) & 0xfffffULL) +#define DTE_GCR3_VAL_C (x) (((x) >> 31) & 0x1fffffULL)#define DTE_GCR3_INDEX_A 0#define DTE_GCR3_INDEX_B 1
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 2/19 scsi: lpfc: Fix kasan slab-out-of-bounds error in lpfc_unreg_login
From: James Smart <[email protected]>
[ Upstream commit 38503943c89f0bafd9e3742f63f872301d44cbea ]
The following kasan bug was called out:
BUG: KASAN: slab-out-of-bounds in lpfc_unreg_login+0x7c/0xc0 [lpfc] Read of size 2 at addr ffff889fc7c50a22 by task lpfc_worker_3/6676 ... Call Trace: dump_stack+0x96/0xe0 ? lpfc_unreg_login+0x7c/0xc0 [lpfc] print_address_description.constprop.6+0x1b/0x220 ? lpfc_unreg_login+0x7c/0xc0 [lpfc] ? lpfc_unreg_login+0x7c/0xc0 [lpfc] __kasan_report.cold.9+0x37/0x7c ? lpfc_unreg_login+0x7c/0xc0 [lpfc] kasan_report+0xe/0x20 lpfc_unreg_login+0x7c/0xc0 [lpfc] lpfc_sli_def_mbox_cmpl+0x334/0x430 [lpfc] ...
When processing the completion of a "Reg Rpi" login mailbox command in lpfc_sli_def_mbox_cmpl, a call may be made to lpfc_unreg_login. The vpi is extracted from the completing mailbox context and passed as an input for the next. However, the vpi stored in the mailbox command context is an absolute vpi, which for SLI4 represents both base + offset. When used with a non-zero base component, (function id > 0) this results in an out-of-range access beyond the allocated phba->vpi_ids array.
Fix by subtracting the function's base value to get an accurate vpi number.
--- drivers/scsi/lpfc/lpfc_sli.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/lpfc/lpfc_sli.c +2 -0
@@ -2186,6 +2186,8 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) !pmb->u.mb.mbxStatus) { rpi = pmb->u.mb.un.varWords[0 ]; vpi = pmb->u.mb.un.varRegLogin.vpi; +if (phba->sli_rev ==LPFC_SLI_REV4 ) + vpi -= phba->sli4_hba.max_cfg_param.vpi_base;lpfc_unreg_login (phba, vpi, rpi, pmb); pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; rc =lpfc_sli_issue_mbox (phba, pmb,MBX_NOWAIT );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 3/19 ceph: return ceph_mdsc_do_request() errors from __get_parent()
In reply to Sasha LevinFrom: Qiujun Huang <[email protected]>
[ Upstream commit c6d50296032f0b97473eb2e274dc7cc5d0173847 ]
Return the error returned by ceph_mdsc_do_request(). Otherwise, r_target_inode ends up being NULL this ends up returning ENOENT regardless of the error.
--- fs/ceph/export.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/ceph/export.c +5 -0
@@ -146,6 +146,11 @@ static struct dentry *__get_parent(struct super_block *sb, } req->r_num_caps =1 ; err =ceph_mdsc_do_request (mdsc,NULL , req); +if (err) { +ceph_mdsc_put_request (req); +return ERR_PTR (err); + } + inode = req->r_target_inode;if (inode)ihold (inode);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 4/19 ceph: don't skip updating wanted caps when cap is stale
In reply to Sasha LevinFrom: "Yan, Zheng" <[email protected]>
[ Upstream commit 0aa971b6fd3f92afef6afe24ef78d9bb14471519 ]
1. try_get_cap_refs() fails to get caps and finds that mds_wanted does not include what it wants. It returns -ESTALE.
2. ceph_get_caps() calls ceph_renew_caps(). ceph_renew_caps() finds that inode has cap, so it calls ceph_check_caps().
3. ceph_check_caps() finds that issued caps (without checking if it's stale) already includes caps wanted by open file, so it skips updating wanted caps.
Above events can cause an infinite loop inside ceph_get_caps().
--- fs/ceph/caps.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/ceph/caps.c +6 -2
@@ -1734,8 +1734,12 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags, }/* want more caps from mds? */ -if (want & ~(cap->mds_wanted | cap->issued)) - goto ack; +if (want & ~cap->mds_wanted) { +if (want & ~(cap->mds_wanted | cap->issued)) + goto ack; +if (!__cap_is_valid (cap)) + goto ack; + }/* things we might delay */ if ((cap->issued & ~retain) == 0 &&
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/19 pwm: rcar: Fix late Runtime PM enablement
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 1451a3eed24b5fd6a604683f0b6995e0e7e16c79 ]
Runtime PM should be enabled before calling pwmchip_add(), as PWM users can appear immediately after the PWM chip has been added. Likewise, Runtime PM should be disabled after the removal of the PWM chip.
--- drivers/pwm/pwm-rcar.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/pwm/pwm-rcar.c +7 -3
@@ -232,24 +232,28 @@ static int rcar_pwm_probe(struct platform_device *pdev) rcar_pwm->chip.base =-1 ; rcar_pwm->chip.npwm =1 ; +pm_runtime_enable (&pdev->dev); + ret =pwmchip_add (&rcar_pwm->chip);if (ret <0 ) {dev_err (&pdev->dev,"failed to register PWM chip: %d\n" , ret); +pm_runtime_disable (&pdev->dev);return ret; } -pm_runtime_enable (&pdev->dev); -return 0 ; }static int rcar_pwm_remove (struct platform_device *pdev) {struct rcar_pwm_chip *rcar_pwm =platform_get_drvdata (pdev); +int ret; + + ret =pwmchip_remove (&rcar_pwm->chip);pm_runtime_disable (&pdev->dev); -return pwmchip_remove (&rcar_pwm->chip); +return ret; }static const struct of_device_id rcar_pwm_of_table[] = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/19 ASoC: dpcm: allow start or stop during pause for backend
In reply to Sasha LevinFrom: 이경택 <[email protected]>
[ Upstream commit 21fca8bdbb64df1297e8c65a746c4c9f4a689751 ]
soc_compr_trigger_fe() allows start or stop after pause_push. In dpcm_be_dai_trigger(), however, only pause_release is allowed command after pause_push.
So, start or stop after pause in compress offload is always returned as error if the compress offload is used with dpcm. To fix the problem, SND_SOC_DPCM_STATE_PAUSED should be allowed for start or stop command.
--- sound/soc/soc-pcm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/soc-pcm.c +4 -2
@@ -1951,7 +1951,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,switch (cmd) {case SNDRV_PCM_TRIGGER_START :if ((be->dpcm[stream].state !=SND_SOC_DPCM_STATE_PREPARE ) && - (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_STOP )) + (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_STOP ) && + (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_PAUSED ))continue ; ret =dpcm_do_trigger (dpcm, be_substream, cmd);
@@ -1981,7 +1982,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, be->dpcm[stream].state =SND_SOC_DPCM_STATE_START ;break ;case SNDRV_PCM_TRIGGER_STOP : -if (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_START ) +if ((be->dpcm[stream].state !=SND_SOC_DPCM_STATE_START ) && + (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_PAUSED ))continue ;if (!snd_soc_dpcm_can_be_free_stop (fe, be, stream))
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 7/19 scsi: iscsi: Report unbind session event when the target has been removed
In reply to Sasha LevinFrom: Wu Bo <[email protected]>
[ Upstream commit 13e60d3ba287d96eeaf1deaadba51f71578119a3 ]
If the daemon is restarted or crashes while logging out of a session, the unbind session event sent by the kernel is not processed and is lost. When the daemon starts again, the session can't be unbound because the daemon is waiting for the event message. However, the kernel has already logged out and the event will not be resent.
When iscsid restart is complete, logout session reports error:
Logging out of session [sid: 6, target: iqn.xxxxx, portal: xx.xx.xx.xx,3260]
iscsiadm: Could not logout of [sid: 6, target: iscsiadm -m node iqn.xxxxx, portal: xx.xx.xx.xx,3260].
iscsiadm: initiator reported error (9 - internal error)
iscsiadm: Could not logout of all requested sessions
Make sure the unbind event is emitted.
[mkp: commit desc and applied by hand since patch was mangled]
--- drivers/scsi/scsi_transport_iscsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/scsi_transport_iscsi.c +3 -1
@@ -2014,7 +2014,7 @@ static void __iscsi_unbind_session(struct work_struct *work)if (session->target_id ==ISCSI_MAX_TARGET ) {spin_unlock_irqrestore (&session->lock, flags);mutex_unlock (&ihost->mutex); -return ; + goto unbind_session_exit; } target_id = session->target_id;
@@ -2026,6 +2026,8 @@ static void __iscsi_unbind_session(struct work_struct *work)ida_simple_remove (&iscsi_sess_ida, target_id);scsi_remove_target (&session->dev); + +unbind_session_exit:iscsi_session_event (session,ISCSI_KEVENT_UNBIND_SESSION );ISCSI_DBG_TRANS_SESSION (session,"Completed target removal\n" ); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 8/19 ASoC: Intel: atom: Take the drv->lock mutex before calling sst_send_slot_map()
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 81630dc042af998b9f58cd8e2c29dab9777ea176 ]
sst_send_slot_map() uses sst_fill_and_send_cmd_unlocked() because in some places it is called with the drv->lock mutex already held.
So it must always be called with the mutex locked. This commit adds missing locking in the sst_set_be_modules() code-path.
--- sound/soc/intel/atom/sst-atom-controls.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/intel/atom/sst-atom-controls.c +2 -0
@@ -963,7 +963,9 @@ static int sst_set_be_modules(struct snd_soc_dapm_widget *w,dev_dbg (c->dev,"Enter: widget=%s\n" , w->name);if (SND_SOC_DAPM_EVENT_ON (event)) { +mutex_lock (&drv->lock); ret =sst_send_slot_map (drv); +mutex_unlock (&drv->lock);if (ret)return ret; ret =sst_send_pipe_module_params (w, k);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 9/19 kernel/gcov/fs.c: gcov_seq_next() should increase position index
In reply to Sasha LevinFrom: Vasily Averin <[email protected]>
[ Upstream commit f4d74ef6220c1eda0875da30457bef5c7111ab06 ]
If seq_file .next function does not change position index, read after some lseek can generate unexpected output.
https://bugzilla.kernel.org/show_bug.cgi?id=206283
--- kernel/gcov/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/gcov/fs.c +1 -1
@@ -108,9 +108,9 @@ static void *gcov_seq_next(struct seq_file *seq, void *data, loff_t *pos) {struct gcov_iterator *iter = data; + (*pos)++;if (gcov_iter_next (iter))return NULL ; - (*pos)++;return iter; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/19 ipc/util.c: sysvipc_find_ipc() should increase position index
In reply to Sasha LevinFrom: Vasily Averin <[email protected]>
[ Upstream commit 89163f93c6f969da5811af5377cc10173583123b ]
If seq_file .next function does not change position index, read after some lseek can generate unexpected output.
https://bugzilla.kernel.org/show_bug.cgi?id=206283
--- ipc/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ipc/util.c +1 -1
@@ -756,13 +756,13 @@ static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos, total++; } + *new_pos = pos +1 ;if (total >= ids->in_use)return NULL ;for (; pos <IPCMNI ; pos++) { ipc =idr_find (&ids->ipcs_idr, pos);if (ipc !=NULL ) { - *new_pos = pos +1 ;rcu_read_lock ();ipc_lock_object (ipc);return ipc;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/19 s390/cio: avoid duplicated 'ADD' uevents
In reply to Sasha LevinFrom: Cornelia Huck <[email protected]>
[ Upstream commit 05ce3e53f375295c2940390b2b429e506e07655c ]
The common I/O layer delays the ADD uevent for subchannels and delegates generating this uevent to the individual subchannel drivers. The io_subchannel driver will do so when the associated ccw_device has been registered -- but unconditionally, so more ADD uevents will be generated if a subchannel has been unbound from the io_subchannel driver and later rebound.
To fix this, only generate the ADD event if uevents were still suppressed for the device.
Message-Id: <[email protected]>
--- drivers/s390/cio/device.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/s390/cio/device.c +9 -4
@@ -872,8 +872,10 @@ static void io_subchannel_register(struct ccw_device *cdev)* Now we know this subchannel will stay, we can throw * our delayed uevent. */ -dev_set_uevent_suppress (&sch->dev,0 ); -kobject_uevent (&sch->dev.kobj,KOBJ_ADD ); +if (dev_get_uevent_suppress (&sch->dev)) { +dev_set_uevent_suppress (&sch->dev,0 ); +kobject_uevent (&sch->dev.kobj,KOBJ_ADD ); + }/* make it known to the system */ ret =ccw_device_add (cdev);if (ret) {
@@ -1082,8 +1084,11 @@ static int io_subchannel_probe(struct subchannel *sch)* Throw the delayed uevent for the subchannel, register * the ccw_device and exit. */ -dev_set_uevent_suppress (&sch->dev,0 ); -kobject_uevent (&sch->dev.kobj,KOBJ_ADD ); +if (dev_get_uevent_suppress (&sch->dev)) { +/* should always be the case for the console */ +dev_set_uevent_suppress (&sch->dev,0 ); +kobject_uevent (&sch->dev.kobj,KOBJ_ADD ); + } cdev =sch_get_cdev (sch); rc =ccw_device_add (cdev);if (rc) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 12/19 pwm: renesas-tpu: Fix late Runtime PM enablement
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit d5a3c7a4536e1329a758e14340efd0e65252bd3d ]
Runtime PM should be enabled before calling pwmchip_add(), as PWM users can appear immediately after the PWM chip has been added. Likewise, Runtime PM should always be disabled after the removal of the PWM chip, even if the latter failed.
--- drivers/pwm/pwm-renesas-tpu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/pwm/pwm-renesas-tpu.c +4 -5
@@ -423,16 +423,17 @@ static int tpu_probe(struct platform_device *pdev) tpu->chip.base =-1 ; tpu->chip.npwm =TPU_CHANNEL_MAX ; +pm_runtime_enable (&pdev->dev); + ret =pwmchip_add (&tpu->chip);if (ret <0 ) {dev_err (&pdev->dev,"failed to register PWM chip\n" ); +pm_runtime_disable (&pdev->dev);return ret; }dev_info (&pdev->dev,"TPU PWM %d registered\n" , tpu->pdev->id); -pm_runtime_enable (&pdev->dev); -return 0 ; }
@@ -442,12 +443,10 @@ static int tpu_remove(struct platform_device *pdev)int ret; ret =pwmchip_remove (&tpu->chip); -if (ret) -return ret;pm_runtime_disable (&pdev->dev); -return 0 ; +return ret; }#ifdef CONFIG_OF
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 13/19 pwm: bcm2835: Dynamically allocate base
In reply to Sasha LevinFrom: Florian Fainelli <[email protected]>
[ Upstream commit 2c25b07e5ec119cab609e41407a1fb3fa61442f5 ]
The newer 2711 and 7211 chips have two PWM controllers and failure to dynamically allocate the PWM base would prevent the second PWM controller instance being probed for succeeding with an -EEXIST error from alloc_pwms().
--- drivers/pwm/pwm-bcm2835.c | 1 + 1 file changed, 1 insertion(+)
drivers/pwm/pwm-bcm2835.c +1 -0
@@ -160,6 +160,7 @@ static int bcm2835_pwm_probe(struct platform_device *pdev) pc->chip.dev = &pdev->dev; pc->chip.ops = &bcm2835_pwm_ops; + pc->chip.base =-1 ; pc->chip.npwm =2 ;platform_set_drvdata (pdev, pc);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 14/19 iommu/vt-d: Silence RCU-list debugging warning in dmar_find_atsr()
In reply to Sasha LevinFrom: Qian Cai <[email protected]>
[ Upstream commit c6f4ebdeba4cff590594df931ff1ee610c426431 ]
dmar_find_atsr() calls list_for_each_entry_rcu() outside of an RCU read side critical section but with dmar_global_lock held. Silence this false positive.
drivers/iommu/intel-iommu.c:4504 RCU-list traversed in non-reader section!! 1 lock held by swapper/0/1:
#0: ffffffff9755bee8 (dmar_global_lock){+.+.}, at: intel_iommu_init+0x1a6/0xe19
Call Trace: dump_stack+0xa4/0xfe lockdep_rcu_suspicious+0xeb/0xf5 dmar_find_atsr+0x1ab/0x1c0 dmar_parse_one_atsr+0x64/0x220 dmar_walk_remapping_entries+0x130/0x380 dmar_table_init+0x166/0x243 intel_iommu_init+0x1ab/0xe19 pci_iommu_init+0x1a/0x44 do_one_initcall+0xae/0x4d0 kernel_init_freeable+0x412/0x4c5 kernel_init+0x19/0x193
--- drivers/iommu/intel-iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/intel-iommu.c +2 -1
@@ -4164,7 +4164,8 @@ static struct dmar_atsr_unit *dmar_find_atsr(struct acpi_dmar_atsr *atsr)struct dmar_atsr_unit *atsru;struct acpi_dmar_atsr *tmp; -list_for_each_entry_rcu (atsru, &dmar_atsr_units, list) { +list_for_each_entry_rcu (atsru, &dmar_atsr_units, list, +dmar_rcu_check ()) { tmp = (struct acpi_dmar_atsr *)atsru->hdr;if (atsr->segment != tmp->segment)continue ;
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 15/19 ocfs2: no need try to truncate file beyond i_size
In reply to Sasha LevinFrom: Changwei Ge <[email protected]>
[ Upstream commit 783fda856e1034dee90a873f7654c418212d12d7 ]
Linux fallocate(2) with FALLOC_FL_PUNCH_HOLE mode set, its offset can exceed the inode size. Ocfs2 now doesn't allow that offset beyond inode size. This restriction is not necessary and violates fallocate(2) semantics.
If fallocate(2) offset is beyond inode size, just return success and do nothing further.
Otherwise, ocfs2 will crash the kernel.
kernel BUG at fs/ocfs2//alloc.c:7264!
ocfs2_truncate_inline+0x20f/0x360 [ocfs2] ocfs2_remove_inode_range+0x23c/0xcb0 [ocfs2] __ocfs2_change_file_space+0x4a5/0x650 [ocfs2] ocfs2_fallocate+0x83/0xa0 [ocfs2] vfs_fallocate+0x148/0x230 SyS_fallocate+0x48/0x80 do_syscall_64+0x79/0x170
--- fs/ocfs2/alloc.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ocfs2/alloc.c +4 -0
@@ -7206,6 +7206,10 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;struct ocfs2_inline_data *idata = &di->id2.i_data; +/* No need to punch hole beyond i_size. */ +if (start >=i_size_read (inode)) +return 0 ; +if (end >i_size_read (inode)) end =i_size_read (inode);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 16/19 hfsplus: fix crash and filesystem corruption when deleting files
In reply to Sasha LevinFrom: Simon Gander <[email protected]>
[ Upstream commit 25efb2ffdf991177e740b2f63e92b4ec7d310a92 ]
When removing files containing extended attributes, the hfsplus driver may remove the wrong entries from the attributes b-tree, causing major filesystem damage and in some cases even kernel crashes.
To remove a file, all its extended attributes have to be removed as well. The driver does this by looking up all keys in the attributes b-tree with the cnid of the file. Each of these entries then gets deleted using the key used for searching, which doesn't contain the attribute's name when it should. Since the key doesn't contain the name, the deletion routine will not find the correct entry and instead remove the one in front of it. If parent nodes have to be modified, these become corrupt as well. This causes invalid links and unsorted entries that not even macOS's fsck_hfs is able to fix.
To fix this, modify the search key before an entry is deleted from the attributes b-tree by copying the found entry's key into the search key, therefore ensuring that the correct entry gets removed from the tree.
--- fs/hfsplus/attributes.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/hfsplus/attributes.c +4 -0
@@ -291,6 +291,10 @@ static int __hfsplus_delete_attr(struct inode *inode, u32 cnid,return -ENOENT ; } +/* Avoid btree corruption */ +hfs_bnode_read (fd->bnode, fd->search_key, + fd->keyoffset, fd->keylength); + err =hfs_brec_remove (fd);if (err)return err;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 17/19 libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set
In reply to Sasha LevinFrom: Kai-Heng Feng <[email protected]>
[ Upstream commit 8305f72f952cff21ce8109dc1ea4b321c8efc5af ]
During system resume from suspend, this can be observed on ASM1062 PMP controller:
ata10.01: SATA link down (SStatus 0 SControl 330)
ata10.02: hard resetting link
ata10.02: SATA link down (SStatus 0 SControl 330)
ata10.00: configured for UDMA/133
Kernel panic - not syncing: stack-protector: Kernel in: sata_pmp_eh_recover+0xa2b/0xa40 CPU: 2 PID: 230 Comm: scsi_eh_9 Tainted: P OE #49-Ubuntu Hardware name: System manufacturer System Product 1001 12/10/2017 Call Trace: dump_stack+0x63/0x8b panic+0xe4/0x244 ? sata_pmp_eh_recover+0xa2b/0xa40 __stack_chk_fail+0x19/0x20 sata_pmp_eh_recover+0xa2b/0xa40 ? ahci_do_softreset+0x260/0x260 [libahci] ? ahci_do_hardreset+0x140/0x140 [libahci] ? ata_phys_link_offline+0x60/0x60 ? ahci_stop_engine+0xc0/0xc0 [libahci] sata_pmp_error_handler+0x22/0x30 ahci_error_handler+0x45/0x80 [libahci] ata_scsi_port_error_handler+0x29b/0x770 ? ata_scsi_cmd_error_handler+0x101/0x140 ata_scsi_error+0x95/0xd0 ? scsi_try_target_reset+0x90/0x90 scsi_error_handler+0xd0/0x5b0 kthread+0x121/0x140 ? scsi_eh_get_sense+0x200/0x200 ? kthread_create_worker_on_cpu+0x70/0x70 ret_from_fork+0x22/0x40
Kernel Offset: 0xcc00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
Since sata_pmp_eh_recover_pmp() doens't set rc when ATA_DFLAG_DETACH is set, sata_pmp_eh_recover() continues to run. During retry it triggers the stack protector.
Set correct rc in sata_pmp_eh_recover_pmp() to let sata_pmp_eh_recover() jump to pmp_fail directly.
--- drivers/ata/libata-pmp.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/libata-pmp.c +1 -0
@@ -764,6 +764,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,if (dev->flags &ATA_DFLAG_DETACH ) { detach =1 ; + rc = -ENODEV ; goto fail; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 18/19 ALSA: ice1724: Fix invalid access for enumerated ctl items
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit c47914c00be346bc5b48c48de7b0da5c2d1a296c ]
The access to Analog Capture Source control value implemented in prodigy_hifi.c is wrong, as caught by the recently introduced sanity check; it should be accessing value.enumerated.item[] instead of value.integer.value[]. This patch corrects the wrong access pattern.
--- sound/pci/ice1712/prodigy_hifi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/ice1712/prodigy_hifi.c +2 -2
@@ -569,7 +569,7 @@ static int wm_adc_mux_enum_get(struct snd_kcontrol *kcontrol,struct snd_ice1712 *ice =snd_kcontrol_chip (kcontrol);mutex_lock (&ice->gpio_mutex); - ucontrol->value.integer.value[0 ] =wm_get (ice,WM_ADC_MUX ) &0x1f ; + ucontrol->value.enumerated.item[0 ] =wm_get (ice,WM_ADC_MUX ) &0x1f ;mutex_unlock (&ice->gpio_mutex);return 0 ; }
@@ -583,7 +583,7 @@ static int wm_adc_mux_enum_put(struct snd_kcontrol *kcontrol,mutex_lock (&ice->gpio_mutex); oval =wm_get (ice,WM_ADC_MUX ); - nval = (oval &0xe0 ) | ucontrol->value.integer.value[0 ]; + nval = (oval &0xe0 ) | ucontrol->value.enumerated.item[0 ];if (nval != oval) {wm_put (ice,WM_ADC_MUX , nval); change =1 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 19/19 ALSA: hda: Fix potential access overflow in beep helper
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit 0ad3f0b384d58f3bd1f4fb87d0af5b8f6866f41a ]
The beep control helper function blindly stores the values in two stereo channels no matter whether the actual control is mono or stereo. This is practically harmless, but it annoys the recently introduced sanity check, resulting in an error when the checker is enabled.
This patch corrects the behavior to store only on the defined array member.
--- sound/pci/hda/hda_beep.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/pci/hda/hda_beep.c +5 -1
@@ -310,8 +310,12 @@ int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol, {struct hda_codec *codec =snd_kcontrol_chip (kcontrol);struct hda_beep *beep = codec->beep; +int chs =get_amp_channels (kcontrol); +if (beep && (!beep->enabled || !ctl_has_mute (kcontrol))) { - ucontrol->value.integer.value[0 ] = +if (chs &1 ) + ucontrol->value.integer.value[0 ] = beep->enabled; +if (chs &2 ) ucontrol->value.integer.value[1 ] = beep->enabled;return 0 ; }
Signature · 1 line
2.20.1