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

  • 28 participants
  • 18564 discussions
[PATCH openEuler-22.03-LTS-SP1 V1] aoe: fix the potential use-after-free problem in more places
by Zicheng Qu 14 Nov '24

14 Nov '24
From: Chun-Yi Lee <joeyli.kernel(a)gmail.com> stable inclusion from stable-v5.10.227 commit f63461af2c1a86af4217910e47a5c46e3372e645 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYR9W CVE: CVE-2024-49982 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- commit 6d6e54fc71ad1ab0a87047fd9c211e75d86084a3 upstream. For fixing CVE-2023-6270, f98364e92662 ("aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts") makes tx() calling dev_put() instead of doing in aoecmd_cfg_pkts(). It avoids that the tx() runs into use-after-free. Then Nicolai Stange found more places in aoe have potential use-after-free problem with tx(). e.g. revalidate(), aoecmd_ata_rw(), resend(), probe() and aoecmd_cfg_rsp(). Those functions also use aoenet_xmit() to push packet to tx queue. So they should also use dev_hold() to increase the refcnt of skb->dev. On the other hand, moving dev_put() to tx() causes that the refcnt of skb->dev be reduced to a negative value, because corresponding dev_hold() are not called in revalidate(), aoecmd_ata_rw(), resend(), probe(), and aoecmd_cfg_rsp(). This patch fixed this issue. Cc: stable(a)vger.kernel.org Link: https://nvd.nist.gov/vuln/detail/CVE-2023-6270 Fixes: f98364e92662 ("aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts") Reported-by: Nicolai Stange <nstange(a)suse.com> Signed-off-by: Chun-Yi Lee <jlee(a)suse.com> Link: https://lore.kernel.org/stable/20240624064418.27043-1-jlee%40suse.com Link: https://lore.kernel.org/r/20241002035458.24401-1-jlee@suse.com Signed-off-by: Jens Axboe <axboe(a)kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org> Signed-off-by: Zicheng Qu <quzicheng(a)huawei.com> --- drivers/block/aoe/aoecmd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index c805909c8e77..833ccf2cd5df 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -362,6 +362,7 @@ ata_rw_frameinit(struct frame *f) } ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit; + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; } @@ -402,6 +403,8 @@ aoecmd_ata_rw(struct aoedev *d) __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); aoenet_xmit(&queue); + } else { + dev_put(f->t->ifp->nd); } return 1; } @@ -484,10 +487,13 @@ resend(struct aoedev *d, struct frame *f) memcpy(h->dst, t->addr, sizeof h->dst); memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src); + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; skb = skb_clone(skb, GFP_ATOMIC); - if (skb == NULL) + if (skb == NULL) { + dev_put(t->ifp->nd); return; + } f->sent = ktime_get(); __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); @@ -618,6 +624,8 @@ probe(struct aoetgt *t) __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); aoenet_xmit(&queue); + } else { + dev_put(f->t->ifp->nd); } } @@ -1403,6 +1411,7 @@ aoecmd_ata_id(struct aoedev *d) ah->cmdstat = ATA_CMD_ID_ATA; ah->lba3 = 0xa0; + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; d->rttavg = RTTAVG_INIT; @@ -1412,6 +1421,8 @@ aoecmd_ata_id(struct aoedev *d) skb = skb_clone(skb, GFP_ATOMIC); if (skb) f->sent = ktime_get(); + else + dev_put(t->ifp->nd); return skb; } -- 2.34.1
2 1
0 0
[PATCH OLK-5.10 V1] aoe: fix the potential use-after-free problem in more places
by Zicheng Qu 14 Nov '24

14 Nov '24
From: Chun-Yi Lee <joeyli.kernel(a)gmail.com> stable inclusion from stable-v5.10.227 commit f63461af2c1a86af4217910e47a5c46e3372e645 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYR9W CVE: CVE-2024-49982 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- commit 6d6e54fc71ad1ab0a87047fd9c211e75d86084a3 upstream. For fixing CVE-2023-6270, f98364e92662 ("aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts") makes tx() calling dev_put() instead of doing in aoecmd_cfg_pkts(). It avoids that the tx() runs into use-after-free. Then Nicolai Stange found more places in aoe have potential use-after-free problem with tx(). e.g. revalidate(), aoecmd_ata_rw(), resend(), probe() and aoecmd_cfg_rsp(). Those functions also use aoenet_xmit() to push packet to tx queue. So they should also use dev_hold() to increase the refcnt of skb->dev. On the other hand, moving dev_put() to tx() causes that the refcnt of skb->dev be reduced to a negative value, because corresponding dev_hold() are not called in revalidate(), aoecmd_ata_rw(), resend(), probe(), and aoecmd_cfg_rsp(). This patch fixed this issue. Cc: stable(a)vger.kernel.org Link: https://nvd.nist.gov/vuln/detail/CVE-2023-6270 Fixes: f98364e92662 ("aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts") Reported-by: Nicolai Stange <nstange(a)suse.com> Signed-off-by: Chun-Yi Lee <jlee(a)suse.com> Link: https://lore.kernel.org/stable/20240624064418.27043-1-jlee%40suse.com Link: https://lore.kernel.org/r/20241002035458.24401-1-jlee@suse.com Signed-off-by: Jens Axboe <axboe(a)kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org> Signed-off-by: Zicheng Qu <quzicheng(a)huawei.com> --- drivers/block/aoe/aoecmd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index c805909c8e77..833ccf2cd5df 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -362,6 +362,7 @@ ata_rw_frameinit(struct frame *f) } ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit; + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; } @@ -402,6 +403,8 @@ aoecmd_ata_rw(struct aoedev *d) __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); aoenet_xmit(&queue); + } else { + dev_put(f->t->ifp->nd); } return 1; } @@ -484,10 +487,13 @@ resend(struct aoedev *d, struct frame *f) memcpy(h->dst, t->addr, sizeof h->dst); memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src); + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; skb = skb_clone(skb, GFP_ATOMIC); - if (skb == NULL) + if (skb == NULL) { + dev_put(t->ifp->nd); return; + } f->sent = ktime_get(); __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); @@ -618,6 +624,8 @@ probe(struct aoetgt *t) __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); aoenet_xmit(&queue); + } else { + dev_put(f->t->ifp->nd); } } @@ -1403,6 +1411,7 @@ aoecmd_ata_id(struct aoedev *d) ah->cmdstat = ATA_CMD_ID_ATA; ah->lba3 = 0xa0; + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; d->rttavg = RTTAVG_INIT; @@ -1412,6 +1421,8 @@ aoecmd_ata_id(struct aoedev *d) skb = skb_clone(skb, GFP_ATOMIC); if (skb) f->sent = ktime_get(); + else + dev_put(t->ifp->nd); return skb; } -- 2.34.1
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1 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 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: 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: 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
[openeuler:openEuler-1.0-LTS 1294/1294] block/blk-io-hierarchy/debugfs.c:63:2: error: implicit declaration of function 'hierarchy_show_slow_io'
by kernel test robot 14 Nov '24

14 Nov '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: a81d020c58c2c6a55ebaf15846470a9ecb69bd1a commit: b2f723aef027af0f194ff0c9f53f8ae6a7cb7de3 [1294/1294] blk-io-hierarchy: support to recored the number of slow IO config: x86_64-randconfig-123-20241114 (https://download.01.org/0day-ci/archive/20241114/202411140945.MlPVuer1-lkp@…) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241114/202411140945.MlPVuer1-lkp@…) 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/202411140945.MlPVuer1-lkp@intel.com/ All errors (new ones prefixed by >>): block/blk-io-hierarchy/debugfs.c: note: in included file (through include/linux/kernel.h, include/linux/list.h, include/linux/wait.h, ...): /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: Expected ) in function call /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: got < /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:43: sparse: sparse: not a function <noident> /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:22: sparse: sparse: bad constant expression type block/blk-io-hierarchy/debugfs.c: note: in included file (through include/linux/printk.h, include/linux/kernel.h, include/linux/list.h, ...): /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: Expected ) in function call /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: got < /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:43: sparse: sparse: not a function <noident> /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:22: sparse: sparse: bad constant expression type block/blk-io-hierarchy/debugfs.c: note: in included file (through include/linux/string.h, include/linux/bitmap.h, include/linux/cpumask.h, ...): /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: Expected ) in function call /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:44: sparse: sparse: got < /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:43: sparse: sparse: not a function <noident> /opt/cross/clang-ab51eccf88/lib/clang/19/include/stdarg.h:22:22: sparse: sparse: bad constant expression type block/blk-io-hierarchy/debugfs.c:63:9: sparse: sparse: undefined identifier 'hierarchy_show_slow_io' In file included from block/blk-io-hierarchy/debugfs.c:15: In file included from include/linux/blkdev.h:16: include/linux/pagemap.h:425:21: warning: cast from 'int (*)(struct file *, struct page *)' to 'filler_t *' (aka 'int (*)(void *, struct page *)') converts to incompatible function type [-Wcast-function-type-strict] 425 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> block/blk-io-hierarchy/debugfs.c:63:2: error: implicit declaration of function 'hierarchy_show_slow_io' [-Werror,-Wimplicit-function-declaration] 63 | hierarchy_show_slow_io(hstats_data, m); | ^ block/blk-io-hierarchy/debugfs.c:63:2: note: did you mean 'hierarchy_account_slow_io'? block/blk-io-hierarchy/iodump.h:85:1: note: 'hierarchy_account_slow_io' declared here 85 | hierarchy_account_slow_io(struct hierarchy_stage *hstage, | ^ 1 warning and 1 error generated. -- In file included from block/blk-io-hierarchy/debugfs.c:15: In file included from include/linux/blkdev.h:16: include/linux/pagemap.h:425:21: warning: cast from 'int (*)(struct file *, struct page *)' to 'filler_t *' (aka 'int (*)(void *, struct page *)') converts to incompatible function type [-Wcast-function-type-strict] 425 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> block/blk-io-hierarchy/debugfs.c:63:2: error: implicit declaration of function 'hierarchy_show_slow_io' [-Werror,-Wimplicit-function-declaration] 63 | hierarchy_show_slow_io(hstats_data, m); | ^ block/blk-io-hierarchy/debugfs.c:63:2: note: did you mean 'hierarchy_account_slow_io'? block/blk-io-hierarchy/iodump.h:85:1: note: 'hierarchy_account_slow_io' declared here 85 | hierarchy_account_slow_io(struct hierarchy_stage *hstage, | ^ 1 warning and 1 error generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for SPI_PHYTIUM Depends on [n]: SPI [=y] && SPI_MASTER [=y] && (ARCH_PHYTIUM || COMPILE_TEST [=n]) Selected by [y]: - SPI_PHYTIUM_PLAT [=y] && SPI [=y] && SPI_MASTER [=y] vim +/hierarchy_show_slow_io +63 block/blk-io-hierarchy/debugfs.c 28 29 static int __hierarchy_stats_show(struct hierarchy_stats_data *hstats_data, 30 struct seq_file *m, enum stage_group stage) 31 { 32 u64 dispatched[NR_NEW_STAT_GROUPS] = {0}; 33 u64 completed[NR_NEW_STAT_GROUPS] = {0}; 34 u64 latency[NR_NEW_STAT_GROUPS] = {0}; 35 int cpu; 36 int i; 37 38 for_each_possible_cpu(cpu) { 39 struct hierarchy_stats *stat = 40 per_cpu_ptr(hstats_data->hstats, cpu); 41 42 for (i = 0; i < NR_NEW_STAT_GROUPS; ++i) { 43 dispatched[i] += stat->dispatched[i]; 44 completed[i] += stat->completed[i]; 45 latency[i] += stage_is_rq(stage) ? 46 stat->jiffies[i] : stat->nsecs[i]; 47 } 48 } 49 50 if (stage_is_rq(stage)) 51 for (i = 0; i < NR_NEW_STAT_GROUPS; ++i) 52 latency[i] = 53 jiffies_to_msecs(latency[i]) * NSEC_PER_MSEC; 54 55 seq_printf(m, "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu", 56 dispatched[STAT_READ], completed[STAT_READ], 57 latency[STAT_READ], dispatched[STAT_WRITE], 58 completed[STAT_WRITE], latency[STAT_WRITE], 59 dispatched[STAT_DISCARD], completed[STAT_DISCARD], 60 latency[STAT_DISCARD], dispatched[STAT_FLUSH], 61 completed[STAT_FLUSH], latency[STAT_FLUSH]); 62 > 63 hierarchy_show_slow_io(hstats_data, m); 64 seq_putc(m, '\n'); 65 return 0; 66 } 67 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-5.10V1] 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: 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
1 0
0 0
[openeuler:openEuler-1.0-LTS 1291/1291] kernel/watchdog_hld.c:123:13: error: implicit declaration of function 'is_hardlockup'
by kernel test robot 14 Nov '24

14 Nov '24
Hi Xiongfeng, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: a81d020c58c2c6a55ebaf15846470a9ecb69bd1a commit: 818ac22d9d2f02632b39ef1a4f472e6dbe0d417a [1291/1291] sdei_watchdog: fix compile error when CONFIG_HARDLOCKUP_DETECTOR is not set config: arm64-randconfig-004-20241113 (https://download.01.org/0day-ci/archive/20241114/202411140951.wQy7SE1b-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241114/202411140951.wQy7SE1b-lkp@…) 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/202411140951.wQy7SE1b-lkp@intel.com/ All errors (new ones prefixed by >>): kernel/watchdog_hld.c: In function 'watchdog_hardlockup_check': >> kernel/watchdog_hld.c:123:13: error: implicit declaration of function 'is_hardlockup' [-Werror=implicit-function-declaration] 123 | if (is_hardlockup()) { | ^~~~~~~~~~~~~ >> kernel/watchdog_hld.c:142:21: error: 'sysctl_hardlockup_all_cpu_backtrace' undeclared (first use in this function) 142 | if (sysctl_hardlockup_all_cpu_backtrace && | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/watchdog_hld.c:142:21: note: each undeclared identifier is reported only once for each function it appears in cc1: some warnings being treated as errors Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for HARDLOCKUP_DETECTOR Depends on [n]: DEBUG_KERNEL [=n] && !S390 && (HAVE_HARDLOCKUP_DETECTOR_PERF [=n] || HAVE_HARDLOCKUP_DETECTOR_ARCH [=y]) Selected by [y]: - SDEI_WATCHDOG [=y] && <choice> && ARM_SDE_INTERFACE [=y] && !HARDLOCKUP_CHECK_TIMESTAMP [=n] vim +/is_hardlockup +123 kernel/watchdog_hld.c 7edaeb6841dfb2 Thomas Gleixner 2017-08-15 106 b8163908982cff Xiongfeng Wang 2019-01-28 107 void watchdog_hardlockup_check(struct pt_regs *regs) 73ce0511c43686 Babu Moger 2016-12-14 108 { 73ce0511c43686 Babu Moger 2016-12-14 109 if (__this_cpu_read(watchdog_nmi_touch) == true) { 73ce0511c43686 Babu Moger 2016-12-14 110 __this_cpu_write(watchdog_nmi_touch, false); 73ce0511c43686 Babu Moger 2016-12-14 111 return; 73ce0511c43686 Babu Moger 2016-12-14 112 } 73ce0511c43686 Babu Moger 2016-12-14 113 7edaeb6841dfb2 Thomas Gleixner 2017-08-15 114 if (!watchdog_check_timestamp()) 7edaeb6841dfb2 Thomas Gleixner 2017-08-15 115 return; 7edaeb6841dfb2 Thomas Gleixner 2017-08-15 116 73ce0511c43686 Babu Moger 2016-12-14 117 /* check for a hardlockup 73ce0511c43686 Babu Moger 2016-12-14 118 * This is done by making sure our timer interrupt 73ce0511c43686 Babu Moger 2016-12-14 119 * is incrementing. The timer interrupt should have 73ce0511c43686 Babu Moger 2016-12-14 120 * fired multiple times before we overflow'd. If it hasn't 73ce0511c43686 Babu Moger 2016-12-14 121 * then this is a good indication the cpu is stuck 73ce0511c43686 Babu Moger 2016-12-14 122 */ 73ce0511c43686 Babu Moger 2016-12-14 @123 if (is_hardlockup()) { 73ce0511c43686 Babu Moger 2016-12-14 124 int this_cpu = smp_processor_id(); 73ce0511c43686 Babu Moger 2016-12-14 125 73ce0511c43686 Babu Moger 2016-12-14 126 /* only print hardlockups once */ 73ce0511c43686 Babu Moger 2016-12-14 127 if (__this_cpu_read(hard_watchdog_warn) == true) 73ce0511c43686 Babu Moger 2016-12-14 128 return; 73ce0511c43686 Babu Moger 2016-12-14 129 73ce0511c43686 Babu Moger 2016-12-14 130 pr_emerg("Watchdog detected hard LOCKUP on cpu %d", this_cpu); 73ce0511c43686 Babu Moger 2016-12-14 131 print_modules(); 73ce0511c43686 Babu Moger 2016-12-14 132 print_irqtrace_events(current); 73ce0511c43686 Babu Moger 2016-12-14 133 if (regs) 73ce0511c43686 Babu Moger 2016-12-14 134 show_regs(regs); 73ce0511c43686 Babu Moger 2016-12-14 135 else 73ce0511c43686 Babu Moger 2016-12-14 136 dump_stack(); 73ce0511c43686 Babu Moger 2016-12-14 137 73ce0511c43686 Babu Moger 2016-12-14 138 /* 73ce0511c43686 Babu Moger 2016-12-14 139 * Perform all-CPU dump only once to avoid multiple hardlockups 73ce0511c43686 Babu Moger 2016-12-14 140 * generating interleaving traces 73ce0511c43686 Babu Moger 2016-12-14 141 */ 73ce0511c43686 Babu Moger 2016-12-14 @142 if (sysctl_hardlockup_all_cpu_backtrace && 73ce0511c43686 Babu Moger 2016-12-14 143 !test_and_set_bit(0, &hardlockup_allcpu_dumped)) 73ce0511c43686 Babu Moger 2016-12-14 144 trigger_allbutself_cpu_backtrace(); 73ce0511c43686 Babu Moger 2016-12-14 145 73ce0511c43686 Babu Moger 2016-12-14 146 if (hardlockup_panic) 73ce0511c43686 Babu Moger 2016-12-14 147 nmi_panic(regs, "Hard LOCKUP"); 73ce0511c43686 Babu Moger 2016-12-14 148 73ce0511c43686 Babu Moger 2016-12-14 149 __this_cpu_write(hard_watchdog_warn, true); 73ce0511c43686 Babu Moger 2016-12-14 150 return; 73ce0511c43686 Babu Moger 2016-12-14 151 } 73ce0511c43686 Babu Moger 2016-12-14 152 73ce0511c43686 Babu Moger 2016-12-14 153 __this_cpu_write(hard_watchdog_warn, false); 73ce0511c43686 Babu Moger 2016-12-14 154 return; 73ce0511c43686 Babu Moger 2016-12-14 155 } 6c19c0e5140a24 Xiongfeng Wang 2019-04-20 156 NOKPROBE_SYMBOL(watchdog_hardlockup_check); 73ce0511c43686 Babu Moger 2016-12-14 157 :::::: The code at line 123 was first introduced by commit :::::: 73ce0511c43686095efd2f65ef564aab952e07bc kernel/watchdog.c: move hardlockup detector to separate file :::::: TO: Babu Moger <babu.moger(a)oracle.com> :::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-6.6 1466/1466] kernel/sched/psi.c:178:13: warning: 'psi_avgs_work' used but never defined
by kernel test robot 14 Nov '24

14 Nov '24
Hi Lu, First bad commit (maybe != root cause): tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 19640fb08a2ccfb131121859517dfdbc6a04ccb6 commit: 654944510822988390470cbc5b6f914c19dd9b88 [1466/1466] sched/psi: add cpu fine grained stall tracking in pressure.stat config: loongarch-randconfig-r051-20241114 (https://download.01.org/0day-ci/archive/20241114/202411140810.T0u4OHVo-lkp@…) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241114/202411140810.T0u4OHVo-lkp@…) 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/202411140810.T0u4OHVo-lkp@intel.com/ All warnings (new ones prefixed by >>): 241 | __setup("isolcpus=", housekeeping_isolcpus_setup); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/init.h:343:46: note: in definition of macro '__setup_param' 343 | = { __setup_str_##unique_id, fn, early } | ^~ kernel/sched/isolation.c:241:1: note: in expansion of macro '__setup' 241 | __setup("isolcpus=", housekeeping_isolcpus_setup); | ^~~~~~~ kernel/sched/isolation.c:241:22: note: (near initialization for '__setup_housekeeping_isolcpus_setup.setup_func') 241 | __setup("isolcpus=", housekeeping_isolcpus_setup); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/init.h:343:46: note: in definition of macro '__setup_param' 343 | = { __setup_str_##unique_id, fn, early } | ^~ kernel/sched/isolation.c:241:1: note: in expansion of macro '__setup' 241 | __setup("isolcpus=", housekeeping_isolcpus_setup); | ^~~~~~~ In file included from kernel/sched/build_utility.c:109: kernel/sched/autogroup.c:7:28: error: section attribute cannot be specified for local variables 7 | unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:15:35: error: initializer element is not constant 15 | .data = &sysctl_sched_autogroup_enabled, | ^ kernel/sched/autogroup.c:15:35: note: (near initialization for 'sched_autogroup_sysctls[0].data') kernel/sched/autogroup.c:25:20: error: invalid storage class for function 'sched_autogroup_sysctl_init' 25 | static void __init sched_autogroup_sysctl_init(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:47:20: error: invalid storage class for function 'autogroup_destroy' 47 | static inline void autogroup_destroy(struct kref *kref) | ^~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:60:20: error: invalid storage class for function 'autogroup_kref_put' 60 | static inline void autogroup_kref_put(struct autogroup *ag) | ^~~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:65:33: error: invalid storage class for function 'autogroup_kref_get' 65 | static inline struct autogroup *autogroup_kref_get(struct autogroup *ag) | ^~~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:71:33: error: invalid storage class for function 'autogroup_task_get' 71 | static inline struct autogroup *autogroup_task_get(struct task_struct *p) | ^~~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:85:33: error: invalid storage class for function 'autogroup_create' 85 | static inline struct autogroup *autogroup_create(void) | ^~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:158:1: error: invalid storage class for function 'autogroup_move_group' 158 | autogroup_move_group(struct task_struct *p, struct autogroup *ag) | ^~~~~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:202:15: error: non-static declaration of 'sched_autogroup_create_attach' follows static declaration 202 | EXPORT_SYMBOL(sched_autogroup_create_attach); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/export.h:74:28: note: in definition of macro '__EXPORT_SYMBOL' 74 | extern typeof(sym) sym; \ | ^~~ include/linux/export.h:86:41: note: in expansion of macro '_EXPORT_SYMBOL' 86 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "") | ^~~~~~~~~~~~~~ kernel/sched/autogroup.c:202:1: note: in expansion of macro 'EXPORT_SYMBOL' 202 | EXPORT_SYMBOL(sched_autogroup_create_attach); | ^~~~~~~~~~~~~ kernel/sched/autogroup.c:193:6: note: previous definition of 'sched_autogroup_create_attach' with type 'void(struct task_struct *)' 193 | void sched_autogroup_create_attach(struct task_struct *p) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:209:15: error: non-static declaration of 'sched_autogroup_detach' follows static declaration 209 | EXPORT_SYMBOL(sched_autogroup_detach); | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/export.h:74:28: note: in definition of macro '__EXPORT_SYMBOL' 74 | extern typeof(sym) sym; \ | ^~~ include/linux/export.h:86:41: note: in expansion of macro '_EXPORT_SYMBOL' 86 | #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "") | ^~~~~~~~~~~~~~ kernel/sched/autogroup.c:209:1: note: in expansion of macro 'EXPORT_SYMBOL' 209 | EXPORT_SYMBOL(sched_autogroup_detach); | ^~~~~~~~~~~~~ kernel/sched/autogroup.c:205:6: note: previous definition of 'sched_autogroup_detach' with type 'void(struct task_struct *)' 205 | void sched_autogroup_detach(struct task_struct *p) | ^~~~~~~~~~~~~~~~~~~~~~ kernel/sched/autogroup.c:221:19: error: invalid storage class for function 'setup_autogroup' 221 | static int __init setup_autogroup(char *str) | ^~~~~~~~~~~~~~~ kernel/sched/autogroup.c:227:24: error: initializer element is not constant 227 | __setup("noautogroup", setup_autogroup); | ^~~~~~~~~~~~~~~ include/linux/init.h:343:46: note: in definition of macro '__setup_param' 343 | = { __setup_str_##unique_id, fn, early } | ^~ kernel/sched/autogroup.c:227:1: note: in expansion of macro '__setup' 227 | __setup("noautogroup", setup_autogroup); | ^~~~~~~ kernel/sched/autogroup.c:227:24: note: (near initialization for '__setup_setup_autogroup.setup_func') 227 | __setup("noautogroup", setup_autogroup); | ^~~~~~~~~~~~~~~ include/linux/init.h:343:46: note: in definition of macro '__setup_param' 343 | = { __setup_str_##unique_id, fn, early } | ^~ kernel/sched/autogroup.c:227:1: note: in expansion of macro '__setup' 227 | __setup("noautogroup", setup_autogroup); | ^~~~~~~ kernel/sched/build_utility.c:110: error: expected declaration or statement at end of input 110 | #endif kernel/sched/psi.c: At top level: >> kernel/sched/psi.c:178:13: warning: 'psi_avgs_work' used but never defined 178 | static void psi_avgs_work(struct work_struct *work); | ^~~~~~~~~~~~~ >> kernel/sched/psi.c:180:13: warning: 'poll_timer_fn' used but never defined 180 | static void poll_timer_fn(struct timer_list *t); | ^~~~~~~~~~~~~ >> kernel/sched/autogroup.c:285:5: warning: 'autogroup_path' defined but not used [-Wunused-function] 285 | int autogroup_path(struct task_group *tg, char *buf, int buflen) | ^~~~~~~~~~~~~~ >> kernel/sched/autogroup.c:269:6: warning: 'proc_sched_autogroup_show_task' defined but not used [-Wunused-function] 269 | void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> kernel/sched/autogroup.c:231:5: warning: 'proc_sched_autogroup_set_nice' defined but not used [-Wunused-function] 231 | int proc_sched_autogroup_set_nice(struct task_struct *p, int nice) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> kernel/sched/autogroup.c:216:6: warning: 'sched_autogroup_exit' defined but not used [-Wunused-function] 216 | void sched_autogroup_exit(struct signal_struct *sig) | ^~~~~~~~~~~~~~~~~~~~ >> kernel/sched/autogroup.c:211:6: warning: 'sched_autogroup_fork' defined but not used [-Wunused-function] 211 | void sched_autogroup_fork(struct signal_struct *sig) | ^~~~~~~~~~~~~~~~~~~~ >> kernel/sched/autogroup.c:147:6: warning: 'sched_autogroup_exit_task' defined but not used [-Wunused-function] 147 | void sched_autogroup_exit_task(struct task_struct *p) | ^~~~~~~~~~~~~~~~~~~~~~~~~ >> kernel/sched/autogroup.c:129:6: warning: 'task_wants_autogroup' defined but not used [-Wunused-function] 129 | bool task_wants_autogroup(struct task_struct *p, struct task_group *tg) | ^~~~~~~~~~~~~~~~~~~~ >> kernel/sched/autogroup.c:42:6: warning: 'autogroup_free' defined but not used [-Wunused-function] 42 | void autogroup_free(struct task_group *tg) | ^~~~~~~~~~~~~~ >> kernel/sched/autogroup.c:33:13: warning: 'autogroup_init' defined but not used [-Wunused-function] 33 | void __init autogroup_init(struct task_struct *init_task) | ^~~~~~~~~~~~~~ >> kernel/sched/isolation.c:82:13: warning: 'housekeeping_init' defined but not used [-Wunused-function] 82 | void __init housekeeping_init(void) | ^~~~~~~~~~~~~~~~~ >> include/linux/syscalls.h:249:25: warning: '__se_sys_membarrier' defined but not used [-Wunused-function] 249 | asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ | ^~~~~~~~ include/linux/syscalls.h:230:9: note: in expansion of macro '__SYSCALL_DEFINEx' 230 | __SYSCALL_DEFINEx(x, sname, __VA_ARGS__) | ^~~~~~~~~~~~~~~~~ include/linux/syscalls.h:221:36: note: in expansion of macro 'SYSCALL_DEFINEx' 221 | #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__) | ^~~~~~~~~~~~~~~ kernel/sched/membarrier.c:614:1: note: in expansion of macro 'SYSCALL_DEFINE3' 614 | SYSCALL_DEFINE3(membarrier, int, cmd, unsigned int, flags, int, cpu_id) | ^~~~~~~~~~~~~~~ >> kernel/sched/membarrier.c:233:6: warning: 'membarrier_update_current_mm' defined but not used [-Wunused-function] 233 | void membarrier_update_current_mm(struct mm_struct *next_mm) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> kernel/sched/membarrier.c:217:6: warning: 'membarrier_exec_mmap' defined but not used [-Wunused-function] 217 | void membarrier_exec_mmap(struct mm_struct *mm) | ^~~~~~~~~~~~~~~~~~~~ >> kernel/sched/psi.c:1471:6: warning: 'psi_cgroup_restart' defined but not used [-Wunused-function] 1471 | void psi_cgroup_restart(struct psi_group *group) | ^~~~~~~~~~~~~~~~~~ >> kernel/sched/psi.c:1416:6: warning: 'cgroup_move_task' defined but not used [-Wunused-function] 1416 | void cgroup_move_task(struct task_struct *task, struct css_set *to) | ^~~~~~~~~~~~~~~~ >> kernel/sched/psi.c:1392:6: warning: 'psi_cgroup_free' defined but not used [-Wunused-function] 1392 | void psi_cgroup_free(struct cgroup *cgroup) | ^~~~~~~~~~~~~~~ >> kernel/sched/psi.c:1373:5: warning: 'psi_cgroup_alloc' defined but not used [-Wunused-function] 1373 | int psi_cgroup_alloc(struct cgroup *cgroup) | ^~~~~~~~~~~~~~~~ >> kernel/sched/psi.c:1168:6: warning: 'psi_task_switch' defined but not used [-Wunused-function] 1168 | void psi_task_switch(struct task_struct *prev, struct task_struct *next, | ^~~~~~~~~~~~~~~ kernel/sched/psi.c:949:13: warning: 'poll_timer_fn' defined but not used [-Wunused-function] 949 | static void poll_timer_fn(struct timer_list *t) | ^~~~~~~~~~~~~ vim +/psi_avgs_work +178 kernel/sched/psi.c eb414681d5a07d Johannes Weiner 2018-10-26 177 bcc78db64168eb Suren Baghdasaryan 2019-05-14 @178 static void psi_avgs_work(struct work_struct *work); eb414681d5a07d Johannes Weiner 2018-10-26 179 8f91efd870ea5d Zhaoyang Huang 2021-06-11 @180 static void poll_timer_fn(struct timer_list *t); 8f91efd870ea5d Zhaoyang Huang 2021-06-11 181 :::::: The code at line 178 was first introduced by commit :::::: bcc78db64168eb6dede056fed2999f75f7ace309 psi: rename psi fields in preparation for psi trigger addition :::::: TO: Suren Baghdasaryan <surenb(a)google.com> :::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 1291/1291] drivers/iommu/arm-smmu-v3.c:211:55: error: 'CONFIG_CMA_ALIGNMENT' undeclared; did you mean 'CONFIG_CMDLINE'?
by kernel test robot 14 Nov '24

14 Nov '24
Hi Will, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: a81d020c58c2c6a55ebaf15846470a9ecb69bd1a commit: 3e8f9682bfad48236b3a76f113cbd5270102e745 [1291/1291] iommu/arm-smmu-v3: Increase maximum size of queues config: arm64-randconfig-r063-20241113 (https://download.01.org/0day-ci/archive/20241114/202411140740.ZYUgkfnW-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241114/202411140740.ZYUgkfnW-lkp@…) 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/202411140740.ZYUgkfnW-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/linux/list.h:9, from include/linux/resource_ext.h:17, from include/linux/acpi.h:26, from drivers/iommu/arm-smmu-v3.c:23: drivers/iommu/arm-smmu-v3.c: In function 'arm_smmu_device_hw_probe': >> drivers/iommu/arm-smmu-v3.c:211:55: error: 'CONFIG_CMA_ALIGNMENT' undeclared (first use in this function); did you mean 'CONFIG_CMDLINE'? 211 | #define Q_MAX_SZ_SHIFT (PAGE_SHIFT + CONFIG_CMA_ALIGNMENT) | ^~~~~~~~~~~~~~~~~~~~ include/linux/kernel.h:847:36: note: in definition of macro '__typecheck' 847 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^ include/linux/kernel.h:871:31: note: in expansion of macro '__safe_cmp' 871 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~ include/linux/kernel.h:939:33: note: in expansion of macro '__careful_cmp' 939 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) | ^~~~~~~~~~~~~ drivers/iommu/arm-smmu-v3.c:3558:36: note: in expansion of macro 'min_t' 3558 | smmu->cmdq.q.max_n_shift = min_t(u32, CMDQ_MAX_SZ_SHIFT, | ^~~~~ drivers/iommu/arm-smmu-v3.c:278:42: note: in expansion of macro 'Q_MAX_SZ_SHIFT' 278 | #define CMDQ_MAX_SZ_SHIFT (Q_MAX_SZ_SHIFT - CMDQ_ENT_SZ_SHIFT) | ^~~~~~~~~~~~~~ drivers/iommu/arm-smmu-v3.c:3558:47: note: in expansion of macro 'CMDQ_MAX_SZ_SHIFT' 3558 | smmu->cmdq.q.max_n_shift = min_t(u32, CMDQ_MAX_SZ_SHIFT, | ^~~~~~~~~~~~~~~~~ drivers/iommu/arm-smmu-v3.c:211:55: note: each undeclared identifier is reported only once for each function it appears in 211 | #define Q_MAX_SZ_SHIFT (PAGE_SHIFT + CONFIG_CMA_ALIGNMENT) | ^~~~~~~~~~~~~~~~~~~~ include/linux/kernel.h:847:36: note: in definition of macro '__typecheck' 847 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^ include/linux/kernel.h:871:31: note: in expansion of macro '__safe_cmp' 871 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~ include/linux/kernel.h:939:33: note: in expansion of macro '__careful_cmp' 939 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) | ^~~~~~~~~~~~~ drivers/iommu/arm-smmu-v3.c:3558:36: note: in expansion of macro 'min_t' 3558 | smmu->cmdq.q.max_n_shift = min_t(u32, CMDQ_MAX_SZ_SHIFT, | ^~~~~ drivers/iommu/arm-smmu-v3.c:278:42: note: in expansion of macro 'Q_MAX_SZ_SHIFT' 278 | #define CMDQ_MAX_SZ_SHIFT (Q_MAX_SZ_SHIFT - CMDQ_ENT_SZ_SHIFT) | ^~~~~~~~~~~~~~ drivers/iommu/arm-smmu-v3.c:3558:47: note: in expansion of macro 'CMDQ_MAX_SZ_SHIFT' 3558 | smmu->cmdq.q.max_n_shift = min_t(u32, CMDQ_MAX_SZ_SHIFT, | ^~~~~~~~~~~~~~~~~ >> include/linux/kernel.h:871:9: error: first argument to '__builtin_choose_expr' not a constant 871 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~~~~~~~~~~~~ include/linux/kernel.h:939:33: note: in expansion of macro '__careful_cmp' 939 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) | ^~~~~~~~~~~~~ drivers/iommu/arm-smmu-v3.c:3558:36: note: in expansion of macro 'min_t' 3558 | smmu->cmdq.q.max_n_shift = min_t(u32, CMDQ_MAX_SZ_SHIFT, | ^~~~~ >> include/linux/kernel.h:871:9: error: first argument to '__builtin_choose_expr' not a constant 871 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~~~~~~~~~~~~ include/linux/kernel.h:939:33: note: in expansion of macro '__careful_cmp' 939 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) | ^~~~~~~~~~~~~ drivers/iommu/arm-smmu-v3.c:3566:36: note: in expansion of macro 'min_t' 3566 | smmu->evtq.q.max_n_shift = min_t(u32, EVTQ_MAX_SZ_SHIFT, | ^~~~~ >> include/linux/kernel.h:871:9: error: first argument to '__builtin_choose_expr' not a constant 871 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~~~~~~~~~~~~ include/linux/kernel.h:939:33: note: in expansion of macro '__careful_cmp' 939 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <) | ^~~~~~~~~~~~~ drivers/iommu/arm-smmu-v3.c:3568:36: note: in expansion of macro 'min_t' 3568 | smmu->priq.q.max_n_shift = min_t(u32, PRIQ_MAX_SZ_SHIFT, | ^~~~~ vim +211 drivers/iommu/arm-smmu-v3.c > 23 #include <linux/acpi.h> 24 #include <linux/acpi_iort.h> 25 #include <linux/bitfield.h> 26 #include <linux/bitops.h> 27 #include <linux/cpufeature.h> 28 #include <linux/crash_dump.h> 29 #include <linux/delay.h> 30 #include <linux/dma-iommu.h> 31 #include <linux/err.h> 32 #include <linux/interrupt.h> 33 #include <linux/io-pgtable.h> 34 #include <linux/iommu.h> 35 #include <linux/iopoll.h> 36 #include <linux/mmu_context.h> 37 #include <linux/module.h> 38 #include <linux/msi.h> 39 #include <linux/of.h> 40 #include <linux/of_address.h> 41 #include <linux/of_iommu.h> 42 #include <linux/of_platform.h> 43 #include <linux/pci.h> 44 #include <linux/platform_device.h> 45 #include <linux/sched/mm.h> 46 47 #include <linux/irq.h> 48 #include <linux/amba/bus.h> 49 50 #include "iommu-pasid-table.h" 51 52 /* MMIO registers */ 53 #define ARM_SMMU_IDR0 0x0 54 #define IDR0_ST_LVL GENMASK(28, 27) 55 #define IDR0_ST_LVL_2LVL 1 56 #define IDR0_STALL_MODEL GENMASK(25, 24) 57 #define IDR0_STALL_MODEL_STALL 0 58 #define IDR0_STALL_MODEL_FORCE 2 59 #define IDR0_TTENDIAN GENMASK(22, 21) 60 #define IDR0_TTENDIAN_MIXED 0 61 #define IDR0_TTENDIAN_LE 2 62 #define IDR0_TTENDIAN_BE 3 63 #define IDR0_CD2L (1 << 19) 64 #define IDR0_VMID16 (1 << 18) 65 #define IDR0_PRI (1 << 16) 66 #define IDR0_SEV (1 << 14) 67 #define IDR0_MSI (1 << 13) 68 #define IDR0_ASID16 (1 << 12) 69 #define IDR0_ATS (1 << 10) 70 #define IDR0_HYP (1 << 9) 71 #define IDR0_HD (1 << 7) 72 #define IDR0_HA (1 << 6) 73 #define IDR0_BTM (1 << 5) 74 #define IDR0_COHACC (1 << 4) 75 #define IDR0_TTF GENMASK(3, 2) 76 #define IDR0_TTF_AARCH64 2 77 #define IDR0_TTF_AARCH32_64 3 78 #define IDR0_S1P (1 << 1) 79 #define IDR0_S2P (1 << 0) 80 81 #define ARM_SMMU_IDR1 0x4 82 #define IDR1_TABLES_PRESET (1 << 30) 83 #define IDR1_QUEUES_PRESET (1 << 29) 84 #define IDR1_REL (1 << 28) 85 #define IDR1_CMDQS GENMASK(25, 21) 86 #define IDR1_EVTQS GENMASK(20, 16) 87 #define IDR1_PRIQS GENMASK(15, 11) 88 #define IDR1_SSIDSIZE GENMASK(10, 6) 89 #define IDR1_SIDSIZE GENMASK(5, 0) 90 91 #define ARM_SMMU_IDR5 0x14 92 #define IDR5_STALL_MAX GENMASK(31, 16) 93 #define IDR5_GRAN64K (1 << 6) 94 #define IDR5_GRAN16K (1 << 5) 95 #define IDR5_GRAN4K (1 << 4) 96 #define IDR5_OAS GENMASK(2, 0) 97 #define IDR5_OAS_32_BIT 0 98 #define IDR5_OAS_36_BIT 1 99 #define IDR5_OAS_40_BIT 2 100 #define IDR5_OAS_42_BIT 3 101 #define IDR5_OAS_44_BIT 4 102 #define IDR5_OAS_48_BIT 5 103 #define IDR5_OAS_52_BIT 6 104 #define IDR5_VAX GENMASK(11, 10) 105 #define IDR5_VAX_52_BIT 1 106 107 #define ARM_SMMU_CR0 0x20 108 #define CR0_CMDQEN (1 << 3) 109 #define CR0_EVTQEN (1 << 2) 110 #define CR0_PRIQEN (1 << 1) 111 #define CR0_SMMUEN (1 << 0) 112 113 #define ARM_SMMU_CR0ACK 0x24 114 115 #define ARM_SMMU_CR1 0x28 116 #define CR1_TABLE_SH GENMASK(11, 10) 117 #define CR1_TABLE_OC GENMASK(9, 8) 118 #define CR1_TABLE_IC GENMASK(7, 6) 119 #define CR1_QUEUE_SH GENMASK(5, 4) 120 #define CR1_QUEUE_OC GENMASK(3, 2) 121 #define CR1_QUEUE_IC GENMASK(1, 0) 122 /* CR1 cacheability fields don't quite follow the usual TCR-style encoding */ 123 #define CR1_CACHE_NC 0 124 #define CR1_CACHE_WB 1 125 #define CR1_CACHE_WT 2 126 127 #define ARM_SMMU_CR2 0x2c 128 #define CR2_PTM (1 << 2) 129 #define CR2_RECINVSID (1 << 1) 130 #define CR2_E2H (1 << 0) 131 132 #define ARM_SMMU_GBPA 0x44 133 #define GBPA_UPDATE (1 << 31) 134 #define GBPA_ABORT (1 << 20) 135 136 #define ARM_SMMU_IRQ_CTRL 0x50 137 #define IRQ_CTRL_EVTQ_IRQEN (1 << 2) 138 #define IRQ_CTRL_PRIQ_IRQEN (1 << 1) 139 #define IRQ_CTRL_GERROR_IRQEN (1 << 0) 140 141 #define ARM_SMMU_IRQ_CTRLACK 0x54 142 143 #define ARM_SMMU_GERROR 0x60 144 #define GERROR_SFM_ERR (1 << 8) 145 #define GERROR_MSI_GERROR_ABT_ERR (1 << 7) 146 #define GERROR_MSI_PRIQ_ABT_ERR (1 << 6) 147 #define GERROR_MSI_EVTQ_ABT_ERR (1 << 5) 148 #define GERROR_MSI_CMDQ_ABT_ERR (1 << 4) 149 #define GERROR_PRIQ_ABT_ERR (1 << 3) 150 #define GERROR_EVTQ_ABT_ERR (1 << 2) 151 #define GERROR_CMDQ_ERR (1 << 0) 152 #define GERROR_ERR_MASK 0xfd 153 154 #define ARM_SMMU_GERRORN 0x64 155 156 #define ARM_SMMU_GERROR_IRQ_CFG0 0x68 157 #define ARM_SMMU_GERROR_IRQ_CFG1 0x70 158 #define ARM_SMMU_GERROR_IRQ_CFG2 0x74 159 160 #define ARM_SMMU_STRTAB_BASE 0x80 161 #define STRTAB_BASE_RA (1UL << 62) 162 #define STRTAB_BASE_ADDR_MASK GENMASK_ULL(51, 6) 163 164 #define ARM_SMMU_STRTAB_BASE_CFG 0x88 165 #define STRTAB_BASE_CFG_FMT GENMASK(17, 16) 166 #define STRTAB_BASE_CFG_FMT_LINEAR 0 167 #define STRTAB_BASE_CFG_FMT_2LVL 1 168 #define STRTAB_BASE_CFG_SPLIT GENMASK(10, 6) 169 #define STRTAB_BASE_CFG_LOG2SIZE GENMASK(5, 0) 170 171 #define ARM_SMMU_CMDQ_BASE 0x90 172 #define ARM_SMMU_CMDQ_PROD 0x98 173 #define ARM_SMMU_CMDQ_CONS 0x9c 174 175 #define ARM_SMMU_EVTQ_BASE 0xa0 176 #define ARM_SMMU_EVTQ_PROD 0x100a8 177 #define ARM_SMMU_EVTQ_CONS 0x100ac 178 #define ARM_SMMU_EVTQ_IRQ_CFG0 0xb0 179 #define ARM_SMMU_EVTQ_IRQ_CFG1 0xb8 180 #define ARM_SMMU_EVTQ_IRQ_CFG2 0xbc 181 182 #define ARM_SMMU_PRIQ_BASE 0xc0 183 #define ARM_SMMU_PRIQ_PROD 0x100c8 184 #define ARM_SMMU_PRIQ_CONS 0x100cc 185 #define ARM_SMMU_PRIQ_IRQ_CFG0 0xd0 186 #define ARM_SMMU_PRIQ_IRQ_CFG1 0xd8 187 #define ARM_SMMU_PRIQ_IRQ_CFG2 0xdc 188 189 /* Common MSI config fields */ 190 #define MSI_CFG0_ADDR_MASK GENMASK_ULL(51, 2) 191 #define MSI_CFG2_SH GENMASK(5, 4) 192 #define MSI_CFG2_MEMATTR GENMASK(3, 0) 193 194 /* Common memory attribute values */ 195 #define ARM_SMMU_SH_NSH 0 196 #define ARM_SMMU_SH_OSH 2 197 #define ARM_SMMU_SH_ISH 3 198 #define ARM_SMMU_MEMATTR_DEVICE_nGnRE 0x1 199 #define ARM_SMMU_MEMATTR_OIWB 0xf 200 201 #define Q_IDX(q, p) ((p) & ((1 << (q)->max_n_shift) - 1)) 202 #define Q_WRP(q, p) ((p) & (1 << (q)->max_n_shift)) 203 #define Q_OVERFLOW_FLAG (1 << 31) 204 #define Q_OVF(q, p) ((p) & Q_OVERFLOW_FLAG) 205 #define Q_ENT(q, p) ((q)->base + \ 206 Q_IDX(q, p) * (q)->ent_dwords) 207 208 #define Q_BASE_RWA (1UL << 62) 209 #define Q_BASE_ADDR_MASK GENMASK_ULL(51, 5) 210 #define Q_BASE_LOG2SIZE GENMASK(4, 0) > 211 #define Q_MAX_SZ_SHIFT (PAGE_SHIFT + CONFIG_CMA_ALIGNMENT) 212 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 398
  • 399
  • 400
  • 401
  • 402
  • 403
  • 404
  • ...
  • 1857
  • Older →

HyperKitty Powered by HyperKitty