mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 27 participants
  • 18549 discussions
[PATCH openEuler-1.0-LTS] Revert "sched/dynamic_affinity: fix preffered_cpu offline problem"
by He Yujie 14 Nov '24

14 Nov '24
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB42TC CVE: NA -------------------------------- This reverts commit 3b2c79ffe971f042f1cdfbd42e2cf52ab0caf6e7. This patch 3b2c79ffe971 ("sched/dynamic_affinity: fix preffered_cpu offline problem") want to fix preffer_cpu offline issue but The requirement that causes the problem is not merge in this version. Therefore, this patch is not required. Signed-off-by: He Yujie <coka.heyujie(a)huawei.com> --- kernel/sched/fair.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 41b339c5b671..63f4344ac344 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7248,7 +7248,6 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, struct task_group *tg; long spare; int cpu, mode; - int nr_cpus_valid = 0; rcu_read_lock(); mode = dynamic_affinity_mode(p); @@ -7266,7 +7265,7 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, /* manual mode */ tg = task_group(p); - for_each_cpu_and(cpu, p->prefer_cpus, cpu_online_mask) { + for_each_cpu(cpu, p->prefer_cpus) { if (unlikely(!tg->se[cpu])) continue; @@ -7290,18 +7289,10 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, util_avg_sum += tg->se[cpu]->avg.util_avg; tg_capacity += capacity_of(cpu); - nr_cpus_valid++; } rcu_read_unlock(); - /* - * Follow cases should select cpus_ptr, checking by condition of - * tg_capacity > nr_cpus_valid: - * 1. all prefer_cpus offline; - * 2. all prefer_cpus has no cfs capaicity(tg_capacity = - * nr_cpus_valid * 1) - */ - if (tg_capacity > nr_cpus_valid && + if (tg_capacity > cpumask_weight(p->prefer_cpus) && util_avg_sum * 100 <= tg_capacity * sysctl_sched_util_low_pct) { p->select_cpus = p->prefer_cpus; if (sd_flag & SD_BALANCE_WAKE) -- 2.34.1
2 1
0 0
[OLK-6.6 PATCH 0/2] Some bug fix patches for OLK-6.6 perf
by Yushan Wang 14 Nov '24

14 Nov '24
From: zhangqz <14294317+zhangqizhi3(a)user.noreply.gitee.com> Some bug fix patches for OLK-5.10 perf John Garry (2): perf metricgroup: Fix for metrics containing duration_time perf metricgroup: Fix system PMU metrics tools/perf/util/metricgroup.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) -- 2.33.0
1 5
0 0
[openeuler:openEuler-1.0-LTS 1291/1291] drivers/char/svm.c:312:17-38: WARNING: atomic_dec_and_test variation before object free at line 335.
by kernel test robot 14 Nov '24

14 Nov '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: d5c3ef07e625af7ba8aded2f507f092bceab3cbc commit: 4cdb60f56180d6ef7c10bd0e50ddda96ebc9f783 [1291/1291] svm: implement unpin pages to dec refcount config: arm64-randconfig-r063-20241113 (https://download.01.org/0day-ci/archive/20241114/202411142057.pcqq5uGT-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202411142057.pcqq5uGT-lkp@intel.com/ cocci warnings: (new ones prefixed by >>) >> drivers/char/svm.c:312:17-38: WARNING: atomic_dec_and_test variation before object free at line 335. vim +312 drivers/char/svm.c 304 305 static void svm_remove_sdma(struct svm_process *process, 306 struct svm_sdma *sdma, bool try_rm) 307 { 308 int null_count = 0; 309 310 mutex_lock(&process->mutex); 311 > 312 if (try_rm && (!atomic64_dec_and_test(&sdma->ref))) { 313 mutex_unlock(&process->mutex); 314 return; 315 } 316 317 rb_erase(&sdma->node, &process->sdma_list); 318 RB_CLEAR_NODE(&sdma->node); 319 mutex_unlock(&process->mutex); 320 321 while (sdma->nr_pages--) { 322 if (sdma->pages[sdma->nr_pages] == NULL) { 323 pr_err("null pointer, nr_pages:%d.\n", sdma->nr_pages); 324 null_count++; 325 continue; 326 } 327 328 put_page(sdma->pages[sdma->nr_pages]); 329 } 330 331 if (null_count) 332 dump_stack(); 333 334 kfree(sdma->pages); > 335 kfree(sdma); 336 } 337 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH openEuler-22.03-LTS-SP1] scsi: libsas: Add smp_ata_check_ready_type()
by Li Nan 14 Nov '24

14 Nov '24
From: Jie Zhan <zhanjie9(a)hisilicon.com> mainline inclusion from mainline-v6.2-rc1 commit 9181ce3cb5d9 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6V6I1 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… ---------------------------------------------------------------------- Create function smp_ata_check_ready_type() for LLDDs to wait for SATA devices to come up after a link reset. Signed-off-by: Jie Zhan <zhanjie9(a)hisilicon.com> Link: https://lore.kernel.org/r/20221118083714.4034612-4-zhanjie9@hisilicon.com Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com> Signed-off-by: xiabing <xiabing12(a)h-partners.com> Signed-off-by: Li Nan <linan122(a)huawei.com> --- drivers/scsi/libsas/sas_internal.h | 2 ++ include/scsi/sas_ata.h | 6 ++++++ drivers/scsi/libsas/sas_ata.c | 25 +++++++++++++++++++++++++ drivers/scsi/libsas/sas_expander.c | 4 ++-- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h index acd515c01861..18749b2a6502 100644 --- a/drivers/scsi/libsas/sas_internal.h +++ b/drivers/scsi/libsas/sas_internal.h @@ -86,6 +86,8 @@ struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id); int sas_ex_phy_discover(struct domain_device *dev, int single); int sas_get_report_phy_sata(struct domain_device *dev, int phy_id, struct smp_resp *rps_resp); +int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, + u8 *sas_addr, enum sas_device_type *type); int sas_try_ata_reset(struct asd_sas_phy *phy); void sas_hae_reset(struct work_struct *work); diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h index e0d2d4915257..74e8feea85b4 100644 --- a/include/scsi/sas_ata.h +++ b/include/scsi/sas_ata.h @@ -34,6 +34,7 @@ void sas_suspend_sata(struct asd_sas_port *port); void sas_resume_sata(struct asd_sas_port *port); void sas_ata_end_eh(struct ata_port *ap); int sas_ata_wait_after_reset(struct domain_device *dev, unsigned long deadline); +int smp_ata_check_ready_type(struct ata_link *link); #else @@ -92,6 +93,11 @@ static inline int sas_ata_wait_after_reset(struct domain_device *dev, { return -ETIMEDOUT; } + +static inline int smp_ata_check_ready_type(struct ata_link *link) +{ + return 0; +} #endif #endif /* _SAS_ATA_H_ */ diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index d54f91636ad1..ff09e0ff00d2 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -301,6 +301,31 @@ static int sas_ata_clear_pending(struct domain_device *dev, struct ex_phy *phy) return 1; } +int smp_ata_check_ready_type(struct ata_link *link) +{ + struct domain_device *dev = link->ap->private_data; + struct sas_phy *phy = sas_get_local_phy(dev); + struct domain_device *ex_dev = dev->parent; + enum sas_device_type type = SAS_PHY_UNUSED; + u8 sas_addr[SAS_ADDR_SIZE]; + int res; + + res = sas_get_phy_attached_dev(ex_dev, phy->number, sas_addr, &type); + sas_put_local_phy(phy); + if (res) + return res; + + switch (type) { + case SAS_SATA_PENDING: + return 0; + case SAS_END_DEVICE: + return 1; + default: + return -ENODEV; + } +} +EXPORT_SYMBOL_GPL(smp_ata_check_ready_type); + static int smp_ata_check_ready(struct ata_link *link) { int res; diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index dd22c7a32059..2287f8e07968 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -1727,8 +1727,8 @@ static int sas_get_phy_change_count(struct domain_device *dev, return res; } -static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, - u8 *sas_addr, enum sas_device_type *type) +int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, + u8 *sas_addr, enum sas_device_type *type) { int res; struct smp_disc_resp *disc_resp; -- 2.39.2
2 1
0 0
[openeuler:openEuler-1.0-LTS 1291/1291] drivers/char/svm.c:312:17-38: WARNING: atomic_dec_and_test variation before object free at line 335.
by kernel test robot 14 Nov '24

14 Nov '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: d5c3ef07e625af7ba8aded2f507f092bceab3cbc commit: 4cdb60f56180d6ef7c10bd0e50ddda96ebc9f783 [1291/1291] svm: implement unpin pages to dec refcount config: arm64-randconfig-r063-20241113 (https://download.01.org/0day-ci/archive/20241114/202411141631.Gm0CdUvq-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202411141631.Gm0CdUvq-lkp@intel.com/ cocci warnings: (new ones prefixed by >>) >> drivers/char/svm.c:312:17-38: WARNING: atomic_dec_and_test variation before object free at line 335. vim +312 drivers/char/svm.c 304 305 static void svm_remove_sdma(struct svm_process *process, 306 struct svm_sdma *sdma, bool try_rm) 307 { 308 int null_count = 0; 309 310 mutex_lock(&process->mutex); 311 > 312 if (try_rm && (!atomic64_dec_and_test(&sdma->ref))) { 313 mutex_unlock(&process->mutex); 314 return; 315 } 316 317 rb_erase(&sdma->node, &process->sdma_list); 318 RB_CLEAR_NODE(&sdma->node); 319 mutex_unlock(&process->mutex); 320 321 while (sdma->nr_pages--) { 322 if (sdma->pages[sdma->nr_pages] == NULL) { 323 pr_err("null pointer, nr_pages:%d.\n", sdma->nr_pages); 324 null_count++; 325 continue; 326 } 327 328 put_page(sdma->pages[sdma->nr_pages]); 329 } 330 331 if (null_count) 332 dump_stack(); 333 334 kfree(sdma->pages); > 335 kfree(sdma); 336 } 337 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH openEuler-1.0-LTS] sched/dynamic_affinity: fix preffered_cpu offline problem
by He Yujie 14 Nov '24

14 Nov '24
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB42TC CVE: NA -------------------------------- After the preferred_cpu goes offline, the core selection of dynamic affinity does not check whether the preferred_cpu is valid. As a result, related dynamic affinity processes are concentrated on a shared_cpu. This patch resolves this problem to checks whether the preferred_cpu is valid and compares only the usage threshold of the valid preferred_cpu. Fixes: 70a232a564cf ("sched: Adjust wakeup cpu range according CPU util dynamicly") Signed-off-by: He Yujie <coka.heyujie(a)huawei.com> --- kernel/sched/fair.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 63f4344ac344..41b339c5b671 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7248,6 +7248,7 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, struct task_group *tg; long spare; int cpu, mode; + int nr_cpus_valid = 0; rcu_read_lock(); mode = dynamic_affinity_mode(p); @@ -7265,7 +7266,7 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, /* manual mode */ tg = task_group(p); - for_each_cpu(cpu, p->prefer_cpus) { + for_each_cpu_and(cpu, p->prefer_cpus, cpu_online_mask) { if (unlikely(!tg->se[cpu])) continue; @@ -7289,10 +7290,18 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, util_avg_sum += tg->se[cpu]->avg.util_avg; tg_capacity += capacity_of(cpu); + nr_cpus_valid++; } rcu_read_unlock(); - if (tg_capacity > cpumask_weight(p->prefer_cpus) && + /* + * Follow cases should select cpus_ptr, checking by condition of + * tg_capacity > nr_cpus_valid: + * 1. all prefer_cpus offline; + * 2. all prefer_cpus has no cfs capaicity(tg_capacity = + * nr_cpus_valid * 1) + */ + if (tg_capacity > nr_cpus_valid && util_avg_sum * 100 <= tg_capacity * sysctl_sched_util_low_pct) { p->select_cpus = p->prefer_cpus; if (sd_flag & SD_BALANCE_WAKE) -- 2.34.1
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1 0/7] CVE-2022-48878
by Yuan Can 14 Nov '24

14 Nov '24
Fix patch of CVE-2022-48878 and its pre requests and new fix patches. Krzysztof Kozlowski (1): Bluetooth: hci_qca: Fix driver shutdown on closed serdev Venkata Lakshmi Narayana Gubba (4): Bluetooth: hci_qca: Wait for timeout during suspend Bluetooth: hci_qca: Wait for SSR completion during suspend Bluetooth: hci_qca: check for SSR triggered flag while suspend Bluetooth: hci_qca: Fixed issue during suspend Yang Yingliang (1): Bluetooth: hci_qca: don't call kfree_skb() under spin_lock_irqsave() Zijun Hu (1): Bluetooth: qca: Fix BT enable failure again for QCA6390 after warm reboot drivers/bluetooth/hci_qca.c | 82 ++++++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 10 deletions(-) -- 2.17.1
2 8
0 0
[PATCH openEuler-1.0-LTS] sched/dynamic_affinity: fix preffered_cpu offline problem
by He Yujie 14 Nov '24

14 Nov '24
Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB42TC -------------------------------- After the preferred_cpu goes offline, the core selection of dynamic affinity does not check whether the preferred_cpu is valid. As a result, related dynamic affinity processes are concentrated on a shared_cpu. This patch resolves this problem to checks whether the preferred_cpu is valid and compares only the usage threshold of the valid preferred_cpu. Fixes: 70a232a564cf ("sched: Adjust wakeup cpu range according CPU util dynamicly") Signed-off-by: He Yujie <coka.heyujie(a)huawei.com> --- kernel/sched/fair.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 63f4344ac344..41b339c5b671 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7248,6 +7248,7 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, struct task_group *tg; long spare; int cpu, mode; + int nr_cpus_valid = 0; rcu_read_lock(); mode = dynamic_affinity_mode(p); @@ -7265,7 +7266,7 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, /* manual mode */ tg = task_group(p); - for_each_cpu(cpu, p->prefer_cpus) { + for_each_cpu_and(cpu, p->prefer_cpus, cpu_online_mask) { if (unlikely(!tg->se[cpu])) continue; @@ -7289,10 +7290,18 @@ static void set_task_select_cpus(struct task_struct *p, int *idlest_cpu, util_avg_sum += tg->se[cpu]->avg.util_avg; tg_capacity += capacity_of(cpu); + nr_cpus_valid++; } rcu_read_unlock(); - if (tg_capacity > cpumask_weight(p->prefer_cpus) && + /* + * Follow cases should select cpus_ptr, checking by condition of + * tg_capacity > nr_cpus_valid: + * 1. all prefer_cpus offline; + * 2. all prefer_cpus has no cfs capaicity(tg_capacity = + * nr_cpus_valid * 1) + */ + if (tg_capacity > nr_cpus_valid && util_avg_sum * 100 <= tg_capacity * sysctl_sched_util_low_pct) { p->select_cpus = p->prefer_cpus; if (sd_flag & SD_BALANCE_WAKE) -- 2.34.1
2 1
0 0
[PATCH OLK-5.10 V1] scsi: pm80xx: Set phy->enable_completion only when we wait for it
by Zicheng Qu 14 Nov '24

14 Nov '24
From: Igor Pylypiv <ipylypiv(a)google.com> stable inclusion from stable-v6.6.51 commit 7b1d779647afaea9185fa2f150b1721e7c1aae89 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAVU94 CVE: CVE-2024-47666 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit e4f949ef1516c0d74745ee54a0f4882c1f6c7aea ] pm8001_phy_control() populates the enable_completion pointer with a stack address, sends a PHY_LINK_RESET / PHY_HARD_RESET, waits 300 ms, and returns. The problem arises when a phy control response comes late. After 300 ms the pm8001_phy_control() function returns and the passed enable_completion stack address is no longer valid. Late phy control response invokes complete() on a dangling enable_completion pointer which leads to a kernel crash. Signed-off-by: Igor Pylypiv <ipylypiv(a)google.com> Signed-off-by: Terrence Adams <tadamsjr(a)google.com> Link: https://lore.kernel.org/r/20240627155924.2361370-2-tadamsjr@google.com Acked-by: Jack Wang <jinpu.wang(a)ionos.com> Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Conflicts: drivers/scsi/pm8001/pm8001_sas.c [The 5.10 stable version lacks this patch 7b1d779647afaea9185fa2f150b1721e7c1aae89, which was pulled from 6.6. Missing commits a961ea0afd632cc570b71e455fe4328ee2fd9348 and 4851c39aae3a917d09983e1c6948fa9d749b5448 in 5.10 led to manually removing the if (PM8001_CHIP_DISP->fatal_errors(pm8001_ha)) code.] Signed-off-by: Zicheng Qu <quzicheng(a)huawei.com> --- drivers/scsi/pm8001/pm8001_sas.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index f77061396871..2d5f2ab0a0f7 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -163,7 +163,6 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func, unsigned long flags; pm8001_ha = sas_phy->ha->lldd_ha; phy = &pm8001_ha->phy[phy_id]; - pm8001_ha->phy[phy_id].enable_completion = &completion; switch (func) { case PHY_FUNC_SET_LINK_RATE: rates = funcdata; @@ -176,6 +175,7 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func, rates->maximum_linkrate; } if (pm8001_ha->phy[phy_id].phy_state == PHY_LINK_DISABLE) { + pm8001_ha->phy[phy_id].enable_completion = &completion; PM8001_CHIP_DISP->phy_start_req(pm8001_ha, phy_id); wait_for_completion(&completion); } @@ -184,6 +184,7 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func, break; case PHY_FUNC_HARD_RESET: if (pm8001_ha->phy[phy_id].phy_state == PHY_LINK_DISABLE) { + pm8001_ha->phy[phy_id].enable_completion = &completion; PM8001_CHIP_DISP->phy_start_req(pm8001_ha, phy_id); wait_for_completion(&completion); } @@ -192,6 +193,7 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func, break; case PHY_FUNC_LINK_RESET: if (pm8001_ha->phy[phy_id].phy_state == PHY_LINK_DISABLE) { + pm8001_ha->phy[phy_id].enable_completion = &completion; PM8001_CHIP_DISP->phy_start_req(pm8001_ha, phy_id); wait_for_completion(&completion); } -- 2.34.1
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1 V1] staging: iio: frequency: ad9834: Validate frequency parameter value
by Zicheng Qu 14 Nov '24

14 Nov '24
From: Aleksandr Mishin <amishin(a)t-argos.ru> stable inclusion from stable-v5.10.226 commit 41cc91e3138fe52f8da92a81bebcd0e6cf488c53 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAVU8A CVE: CVE-2024-47663 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- commit b48aa991758999d4e8f9296c5bbe388f293ef465 upstream. In ad9834_write_frequency() clk_get_rate() can return 0. In such case ad9834_calc_freqreg() call will lead to division by zero. Checking 'if (fout > (clk_freq / 2))' doesn't protect in case of 'fout' is 0. ad9834_write_frequency() is called from ad9834_write(), where fout is taken from text buffer, which can contain any value. Modify parameters checking. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 12b9d5bf76bf ("Staging: IIO: DDS: AD9833 / AD9834 driver") Suggested-by: Dan Carpenter <dan.carpenter(a)linaro.org> Signed-off-by: Aleksandr Mishin <amishin(a)t-argos.ru> Reviewed-by: Dan Carpenter <dan.carpenter(a)linaro.org> Link: https://patch.msgid.link/20240703154506.25584-1-amishin@t-argos.ru Cc: <Stable(a)vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron(a)huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org> Signed-off-by: Zicheng Qu <quzicheng(a)huawei.com> --- drivers/staging/iio/frequency/ad9834.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c index 262c3590e64e..fa0a7056dea4 100644 --- a/drivers/staging/iio/frequency/ad9834.c +++ b/drivers/staging/iio/frequency/ad9834.c @@ -115,7 +115,7 @@ static int ad9834_write_frequency(struct ad9834_state *st, clk_freq = clk_get_rate(st->mclk); - if (fout > (clk_freq / 2)) + if (!clk_freq || fout > (clk_freq / 2)) return -EINVAL; regval = ad9834_calc_freqreg(clk_freq, fout); -- 2.34.1
2 1
0 0
  • ← Newer
  • 1
  • ...
  • 394
  • 395
  • 396
  • 397
  • 398
  • 399
  • 400
  • ...
  • 1855
  • Older →

HyperKitty Powered by HyperKitty