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 -----
  • 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

October 2024

  • 79 participants
  • 925 discussions
[openeuler:openEuler-1.0-LTS 20444/23875] arch/arm64/kernel/cpufeature.c:1287:9: error: 'a32_elf_hwcap2' undeclared; did you mean 'elf_hwcap'?
by kernel test robot 28 Oct '24

28 Oct '24
Hi James, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 858328aa50984206eb1dfc7218a03c5cc0165d3f commit: 6dfc76f160cb5e8bf25cb85d4763cdc3144bfda8 [20444/23875] arm64: errata: Remove AES hwcap for COMPAT tasks config: arm64-randconfig-004-20241027 (https://download.01.org/0day-ci/archive/20241028/202410282030.pKjQvIBc-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241028/202410282030.pKjQvIBc-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/202410282030.pKjQvIBc-lkp@intel.com/ All errors (new ones prefixed by >>): arch/arm64/kernel/cpufeature.c: In function 'elf_hwcap_fixup': >> arch/arm64/kernel/cpufeature.c:1287:9: error: 'a32_elf_hwcap2' undeclared (first use in this function); did you mean 'elf_hwcap'? 1287 | a32_elf_hwcap2 &= ~COMPAT_HWCAP2_AES; | ^~~~~~~~~~~~~~ | elf_hwcap arch/arm64/kernel/cpufeature.c:1287:9: note: each undeclared identifier is reported only once for each function it appears in vim +1287 arch/arm64/kernel/cpufeature.c 1282 1283 static void elf_hwcap_fixup(void) 1284 { 1285 #ifdef CONFIG_ARM64_ERRATUM_1742098 1286 if (cpus_have_const_cap(ARM64_WORKAROUND_1742098)) > 1287 a32_elf_hwcap2 &= ~COMPAT_HWCAP2_AES; 1288 #endif /* ARM64_ERRATUM_1742098 */ 1289 } 1290 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-5.10] loop: fix the the direct I/O support check when used on top of block devices
by Yu Kuai 28 Oct '24

28 Oct '24
From: Christoph Hellwig <hch(a)lst.de> mainline inclusion from mainline-v6.8-rc1 commit baa7d536077dcdfe2b70c476a8873d1745d3de0f category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IAXIMQ CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- __loop_update_dio only checks the alignment requirement for block backed file systems, but misses them for the case where the loop device is created directly on top of another block device. Due to this creating a loop device with default option plus the direct I/O flag on a > 512 byte sector size file system will lead to incorrect I/O being submitted to the lower block device and a lot of error from the lock layer. This can be seen with xfstests generic/563. Fix the code in __loop_update_dio by factoring the alignment check into a helper, and calling that also for the struct block_device of a block device inode. Also remove the TODO comment talking about dynamically switching between buffered and direct I/O, which is a would be a recipe for horrible performance and occasional data loss. Fixes: 2e5ab5f379f9 ("block: loop: prepare for supporing direct IO") Signed-off-by: Christoph Hellwig <hch(a)lst.de> Reviewed-by: Ming Lei <ming.lei(a)redhat.com> Link: https://lore.kernel.org/r/20240117175901.871796-1-hch@lst.de Signed-off-by: Jens Axboe <axboe(a)kernel.dk> Conflicts: drivers/block/loop.c [A lot of conflicts, main functional related are: commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") commit 47e9624616c8 ("block: remove support for cryptoloop and the xor transfer")] Signed-off-by: Yu Kuai <yukuai3(a)huawei.com> --- drivers/block/loop.c | 56 +++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 8eefd1462c3f..ff49c3f43b25 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -167,41 +167,39 @@ static loff_t get_loop_size(struct loop_device *lo, struct file *file) return get_size(lo->lo_offset, lo->lo_sizelimit, file); } +/* + * We support direct I/O only if lo_offset is aligned with the logical I/O size + * of backing device, and the logical block size of loop is bigger than that of + * the backing device. + */ +static bool lo_bdev_can_use_dio(struct loop_device *lo, + struct block_device *backing_bdev) +{ + unsigned short sb_bsize = bdev_logical_block_size(backing_bdev); + + if (queue_logical_block_size(lo->lo_queue) < sb_bsize) + return false; + if (lo->lo_offset & (sb_bsize - 1)) + return false; + if (lo->transfer) + return false; + return true; +} + static void __loop_update_dio(struct loop_device *lo, bool dio) { struct file *file = lo->lo_backing_file; - struct address_space *mapping = file->f_mapping; - struct inode *inode = mapping->host; - unsigned short sb_bsize = 0; - unsigned dio_align = 0; + struct inode *inode = file->f_mapping->host; + struct block_device *backing_bdev = NULL; bool use_dio; - if (inode->i_sb->s_bdev) { - sb_bsize = bdev_logical_block_size(inode->i_sb->s_bdev); - dio_align = sb_bsize - 1; - } + if (S_ISBLK(inode->i_mode)) + backing_bdev = I_BDEV(inode); + else if (inode->i_sb->s_bdev) + backing_bdev = inode->i_sb->s_bdev; - /* - * We support direct I/O only if lo_offset is aligned with the - * logical I/O size of backing device, and the logical block - * size of loop is bigger than the backing device's and the loop - * needn't transform transfer. - * - * TODO: the above condition may be loosed in the future, and - * direct I/O may be switched runtime at that time because most - * of requests in sane applications should be PAGE_SIZE aligned - */ - if (dio) { - if (queue_logical_block_size(lo->lo_queue) >= sb_bsize && - !(lo->lo_offset & dio_align) && - mapping->a_ops->direct_IO && - !lo->transfer) - use_dio = true; - else - use_dio = false; - } else { - use_dio = false; - } + use_dio = dio && (file->f_mapping->a_ops->direct_IO) && + (!backing_bdev || lo_bdev_can_use_dio(lo, backing_bdev)); if (lo->use_dio == use_dio) return; -- 2.39.2
2 1
0 0
[openeuler:OLK-5.10 28630/30000] drivers/irqchip/irq-mbigen.c:693:12: warning: 'vtimer_mbigen_set_regs' defined but not used
by kernel test robot 28 Oct '24

28 Oct '24
Hi weiyuchen, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: a0194593a9cec12b03a0b5d84cbc937243e65153 commit: a8af21a94f6331eb77ca486a511cbbb548de94df [28630/30000] mbigen: add kvm dependency config: arm64-randconfig-001-20241028 (https://download.01.org/0day-ci/archive/20241028/202410281921.NaI3m81D-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241028/202410281921.NaI3m81D-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/202410281921.NaI3m81D-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/irqchip/irq-mbigen.c:875:36: warning: 'mbigen_acpi_match' defined but not used [-Wunused-const-variable=] 875 | static const struct acpi_device_id mbigen_acpi_match[] = { | ^~~~~~~~~~~~~~~~~ >> drivers/irqchip/irq-mbigen.c:693:12: warning: 'vtimer_mbigen_set_regs' defined but not used [-Wunused-function] 693 | static int vtimer_mbigen_set_regs(struct platform_device *pdev) | ^~~~~~~~~~~~~~~~~~~~~~ >> drivers/irqchip/irq-mbigen.c:651:13: warning: 'vtimer_mbigen_should_probe' defined but not used [-Wunused-function] 651 | static bool vtimer_mbigen_should_probe(struct mbigen_device *mgn_chip) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/irqchip/irq-mbigen.c:636:13: warning: 'is_mbigen_vtimer_bypass_enabled' defined but not used [-Wunused-function] 636 | static bool is_mbigen_vtimer_bypass_enabled(struct mbigen_device *mgn_chip) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/irqchip/irq-mbigen.c:597:12: warning: 'vtimer_mbigen_chip_match_cpu' defined but not used [-Wunused-function] 597 | static int vtimer_mbigen_chip_match_cpu(struct vtimer_mbigen_device *chip) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/irqchip/irq-mbigen.c:588:12: warning: 'vtimer_mbigen_chip_read_aff3' defined but not used [-Wunused-function] 588 | static int vtimer_mbigen_chip_read_aff3(struct vtimer_mbigen_device *chip) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/irqchip/irq-mbigen.c:581:13: warning: 'vtimer_mbigen_set_kvm_info' defined but not used [-Wunused-function] 581 | static void vtimer_mbigen_set_kvm_info(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/irqchip/irq-mbigen.c:268:12: warning: 'vtimer_mbigen_set_type' defined but not used [-Wunused-function] 268 | static int vtimer_mbigen_set_type(unsigned int cpu_id) | ^~~~~~~~~~~~~~~~~~~~~~ vim +/vtimer_mbigen_set_regs +693 drivers/irqchip/irq-mbigen.c f907c515ffb06e Hanjun Guo 2017-03-28 580 212e82b2357f91 Kunkun Jiang 2023-12-06 @581 static void vtimer_mbigen_set_kvm_info(void) 212e82b2357f91 Kunkun Jiang 2023-12-06 582 { 212e82b2357f91 Kunkun Jiang 2023-12-06 583 struct arch_timer_kvm_info *info = arch_timer_get_kvm_info(); 212e82b2357f91 Kunkun Jiang 2023-12-06 584 212e82b2357f91 Kunkun Jiang 2023-12-06 585 info->irqbypass_flag |= VT_EXPANDDEV_PROBED; 212e82b2357f91 Kunkun Jiang 2023-12-06 586 } 212e82b2357f91 Kunkun Jiang 2023-12-06 587 212e82b2357f91 Kunkun Jiang 2023-12-06 @588 static int vtimer_mbigen_chip_read_aff3(struct vtimer_mbigen_device *chip) 212e82b2357f91 Kunkun Jiang 2023-12-06 589 { 212e82b2357f91 Kunkun Jiang 2023-12-06 590 void __iomem *base = chip->base; 212e82b2357f91 Kunkun Jiang 2023-12-06 591 void __iomem *addr = base + MBIGEN_CTLR; 212e82b2357f91 Kunkun Jiang 2023-12-06 592 u32 val = readl_relaxed(addr); 212e82b2357f91 Kunkun Jiang 2023-12-06 593 212e82b2357f91 Kunkun Jiang 2023-12-06 594 return ((val & MBIGEN_AFF3_MASK) >> MBIGEN_AFF3_SHIFT); 212e82b2357f91 Kunkun Jiang 2023-12-06 595 } 212e82b2357f91 Kunkun Jiang 2023-12-06 596 212e82b2357f91 Kunkun Jiang 2023-12-06 @597 static int vtimer_mbigen_chip_match_cpu(struct vtimer_mbigen_device *chip) 212e82b2357f91 Kunkun Jiang 2023-12-06 598 { 212e82b2357f91 Kunkun Jiang 2023-12-06 599 int cpu; 212e82b2357f91 Kunkun Jiang 2023-12-06 600 212e82b2357f91 Kunkun Jiang 2023-12-06 601 chip->cpu_base = -1; 212e82b2357f91 Kunkun Jiang 2023-12-06 602 chip->cpu_num = 0; 212e82b2357f91 Kunkun Jiang 2023-12-06 603 212e82b2357f91 Kunkun Jiang 2023-12-06 604 for_each_possible_cpu(cpu) { 212e82b2357f91 Kunkun Jiang 2023-12-06 605 int mpidr_aff3 = MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 3); 212e82b2357f91 Kunkun Jiang 2023-12-06 606 212e82b2357f91 Kunkun Jiang 2023-12-06 607 if (chip->mpidr_aff3 == mpidr_aff3) { 212e82b2357f91 Kunkun Jiang 2023-12-06 608 /* get the first cpu attached to the mbigen */ 212e82b2357f91 Kunkun Jiang 2023-12-06 609 if (chip->cpu_base == -1) { 212e82b2357f91 Kunkun Jiang 2023-12-06 610 /* Make sure cpu_base is attached to PIN0 */ 212e82b2357f91 Kunkun Jiang 2023-12-06 611 u64 mpidr = cpu_logical_map(cpu); 212e82b2357f91 Kunkun Jiang 2023-12-06 612 if (!MPIDR_AFFINITY_LEVEL(mpidr, 2) && 212e82b2357f91 Kunkun Jiang 2023-12-06 613 !MPIDR_AFFINITY_LEVEL(mpidr, 1) && 212e82b2357f91 Kunkun Jiang 2023-12-06 614 !MPIDR_AFFINITY_LEVEL(mpidr, 0)) 212e82b2357f91 Kunkun Jiang 2023-12-06 615 chip->cpu_base = cpu; 212e82b2357f91 Kunkun Jiang 2023-12-06 616 } 212e82b2357f91 Kunkun Jiang 2023-12-06 617 212e82b2357f91 Kunkun Jiang 2023-12-06 618 chip->cpu_num++; 212e82b2357f91 Kunkun Jiang 2023-12-06 619 /* 212e82b2357f91 Kunkun Jiang 2023-12-06 620 * check if this cpu has already 212e82b2357f91 Kunkun Jiang 2023-12-06 621 * attached to another mbigen 212e82b2357f91 Kunkun Jiang 2023-12-06 622 */ 212e82b2357f91 Kunkun Jiang 2023-12-06 623 if (cpumask_test_and_set_cpu(cpu, &vtimer_cpu_mask)) { 212e82b2357f91 Kunkun Jiang 2023-12-06 624 WARN_ON_ONCE(1); 212e82b2357f91 Kunkun Jiang 2023-12-06 625 return -EINVAL; 212e82b2357f91 Kunkun Jiang 2023-12-06 626 } 212e82b2357f91 Kunkun Jiang 2023-12-06 627 } 212e82b2357f91 Kunkun Jiang 2023-12-06 628 } 212e82b2357f91 Kunkun Jiang 2023-12-06 629 212e82b2357f91 Kunkun Jiang 2023-12-06 630 if (chip->cpu_base == -1 || chip->cpu_num > IRQS_PER_MBIGEN_NODE) 212e82b2357f91 Kunkun Jiang 2023-12-06 631 return -EINVAL; 212e82b2357f91 Kunkun Jiang 2023-12-06 632 212e82b2357f91 Kunkun Jiang 2023-12-06 633 return 0; 212e82b2357f91 Kunkun Jiang 2023-12-06 634 } 212e82b2357f91 Kunkun Jiang 2023-12-06 635 212e82b2357f91 Kunkun Jiang 2023-12-06 @636 static bool is_mbigen_vtimer_bypass_enabled(struct mbigen_device *mgn_chip) 212e82b2357f91 Kunkun Jiang 2023-12-06 637 { 212e82b2357f91 Kunkun Jiang 2023-12-06 638 void __iomem *base = mgn_chip->base; 212e82b2357f91 Kunkun Jiang 2023-12-06 639 void __iomem *addr = base + MBIGEN_NODE_CFG_OFFSET; 212e82b2357f91 Kunkun Jiang 2023-12-06 640 u32 val = readl_relaxed(addr); 212e82b2357f91 Kunkun Jiang 2023-12-06 641 212e82b2357f91 Kunkun Jiang 2023-12-06 642 return ((val & MBIGEN_TYPE_MASK) >> MBIGEN_TYPE_SHIFT) 212e82b2357f91 Kunkun Jiang 2023-12-06 643 == TYPE_VTIMER_ENABLED; 212e82b2357f91 Kunkun Jiang 2023-12-06 644 } 212e82b2357f91 Kunkun Jiang 2023-12-06 645 212e82b2357f91 Kunkun Jiang 2023-12-06 646 /** 212e82b2357f91 Kunkun Jiang 2023-12-06 647 * MBIX_VPPI_ITS_TA: Indicates the address of the ITS corresponding 212e82b2357f91 Kunkun Jiang 2023-12-06 648 * to the mbigen. 212e82b2357f91 Kunkun Jiang 2023-12-06 649 */ 212e82b2357f91 Kunkun Jiang 2023-12-06 650 #define MBIX_VPPI_ITS_TA 0x0038 212e82b2357f91 Kunkun Jiang 2023-12-06 @651 static bool vtimer_mbigen_should_probe(struct mbigen_device *mgn_chip) 212e82b2357f91 Kunkun Jiang 2023-12-06 652 { 212e82b2357f91 Kunkun Jiang 2023-12-06 653 unsigned int mpidr_aff3; 212e82b2357f91 Kunkun Jiang 2023-12-06 654 struct vtimer_mbigen_device *chip; 212e82b2357f91 Kunkun Jiang 2023-12-06 655 void __iomem *addr; 212e82b2357f91 Kunkun Jiang 2023-12-06 656 u32 val; 212e82b2357f91 Kunkun Jiang 2023-12-06 657 212e82b2357f91 Kunkun Jiang 2023-12-06 658 /* find the valid mbigen */ 212e82b2357f91 Kunkun Jiang 2023-12-06 659 addr = mgn_chip->base + MBIX_VPPI_ITS_TA; 212e82b2357f91 Kunkun Jiang 2023-12-06 660 val = readl_relaxed(addr); 212e82b2357f91 Kunkun Jiang 2023-12-06 661 if (!val) 212e82b2357f91 Kunkun Jiang 2023-12-06 662 return false; 212e82b2357f91 Kunkun Jiang 2023-12-06 663 212e82b2357f91 Kunkun Jiang 2023-12-06 664 addr = mgn_chip->base + MBIGEN_CTLR; 212e82b2357f91 Kunkun Jiang 2023-12-06 665 val = readl_relaxed(addr); 212e82b2357f91 Kunkun Jiang 2023-12-06 666 mpidr_aff3 = (val & MBIGEN_AFF3_MASK) >> MBIGEN_AFF3_SHIFT; 212e82b2357f91 Kunkun Jiang 2023-12-06 667 list_for_each_entry(chip, &vtimer_mgn_list, entry) { 212e82b2357f91 Kunkun Jiang 2023-12-06 668 if (chip->mpidr_aff3 == mpidr_aff3) 212e82b2357f91 Kunkun Jiang 2023-12-06 669 return false; 212e82b2357f91 Kunkun Jiang 2023-12-06 670 } 212e82b2357f91 Kunkun Jiang 2023-12-06 671 212e82b2357f91 Kunkun Jiang 2023-12-06 672 return true; 212e82b2357f91 Kunkun Jiang 2023-12-06 673 } 212e82b2357f91 Kunkun Jiang 2023-12-06 674 473e1b802231d7 Kunkun Jiang 2023-12-06 675 #define CHIP0_TA_MBIGEN_PHY_BASE 0x4604400000 473e1b802231d7 Kunkun Jiang 2023-12-06 676 #define CHIP0_TA_MBIGEN_ITS_BASE 0x84028 473e1b802231d7 Kunkun Jiang 2023-12-06 677 #define CHIP0_TA_PERI_PHY_BASE 0x4614002018 473e1b802231d7 Kunkun Jiang 2023-12-06 678 473e1b802231d7 Kunkun Jiang 2023-12-06 679 #define CHIP0_TB_MBIGEN_PHY_BASE 0xc604400000 473e1b802231d7 Kunkun Jiang 2023-12-06 680 #define CHIP0_TB_PERI_PHY_BASE 0xc614002018 473e1b802231d7 Kunkun Jiang 2023-12-06 681 #define CHIP0_TB_MBIGEN_ITS_BASE 0x4028 473e1b802231d7 Kunkun Jiang 2023-12-06 682 473e1b802231d7 Kunkun Jiang 2023-12-06 683 #define CHIP1_TA_MBIGEN_PHY_BASE 0x204604400000 473e1b802231d7 Kunkun Jiang 2023-12-06 684 #define CHIP1_TA_PERI_PHY_BASE 0x204614002018 473e1b802231d7 Kunkun Jiang 2023-12-06 685 #define CHIP1_TA_MBIGEN_ITS_BASE 0x2084028 473e1b802231d7 Kunkun Jiang 2023-12-06 686 473e1b802231d7 Kunkun Jiang 2023-12-06 687 #define CHIP1_TB_MBIGEN_PHY_BASE 0x20c604400000 473e1b802231d7 Kunkun Jiang 2023-12-06 688 #define CHIP1_TB_MBIGEN_ITS_BASE 0x2004028 473e1b802231d7 Kunkun Jiang 2023-12-06 689 #define CHIP1_TB_PERI_PHY_BASE 0x20c614002018 473e1b802231d7 Kunkun Jiang 2023-12-06 690 473e1b802231d7 Kunkun Jiang 2023-12-06 691 extern bool vtimer_irqbypass; 473e1b802231d7 Kunkun Jiang 2023-12-06 692 473e1b802231d7 Kunkun Jiang 2023-12-06 @693 static int vtimer_mbigen_set_regs(struct platform_device *pdev) 473e1b802231d7 Kunkun Jiang 2023-12-06 694 { 473e1b802231d7 Kunkun Jiang 2023-12-06 695 struct mbigen_device *mgn_chip = platform_get_drvdata(pdev); 473e1b802231d7 Kunkun Jiang 2023-12-06 696 struct resource *res; 473e1b802231d7 Kunkun Jiang 2023-12-06 697 void __iomem *addr; 473e1b802231d7 Kunkun Jiang 2023-12-06 698 unsigned int mpidr_aff3; 473e1b802231d7 Kunkun Jiang 2023-12-06 699 u32 val; 473e1b802231d7 Kunkun Jiang 2023-12-06 700 struct vtimer_mbigen_device *chip; 473e1b802231d7 Kunkun Jiang 2023-12-06 701 473e1b802231d7 Kunkun Jiang 2023-12-06 702 addr = mgn_chip->base + MBIGEN_CTLR; 473e1b802231d7 Kunkun Jiang 2023-12-06 703 val = readl_relaxed(addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 704 mpidr_aff3 = (val & MBIGEN_AFF3_MASK) >> MBIGEN_AFF3_SHIFT; 473e1b802231d7 Kunkun Jiang 2023-12-06 705 list_for_each_entry(chip, &vtimer_mgn_list, entry) { 473e1b802231d7 Kunkun Jiang 2023-12-06 706 if (chip->mpidr_aff3 == mpidr_aff3) 473e1b802231d7 Kunkun Jiang 2023-12-06 707 return 0; 473e1b802231d7 Kunkun Jiang 2023-12-06 708 } 473e1b802231d7 Kunkun Jiang 2023-12-06 709 473e1b802231d7 Kunkun Jiang 2023-12-06 710 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 473e1b802231d7 Kunkun Jiang 2023-12-06 711 if (!mgn_chip) 473e1b802231d7 Kunkun Jiang 2023-12-06 712 return -ENOMEM; 473e1b802231d7 Kunkun Jiang 2023-12-06 713 473e1b802231d7 Kunkun Jiang 2023-12-06 714 if (res->start == CHIP0_TA_MBIGEN_PHY_BASE) { 473e1b802231d7 Kunkun Jiang 2023-12-06 715 addr = ioremap(CHIP0_TA_PERI_PHY_BASE, 4); 473e1b802231d7 Kunkun Jiang 2023-12-06 716 if (!addr) { 473e1b802231d7 Kunkun Jiang 2023-12-06 717 pr_err("Unable to map CHIP0-TA-PERI\n"); 473e1b802231d7 Kunkun Jiang 2023-12-06 718 return -ENOMEM; 473e1b802231d7 Kunkun Jiang 2023-12-06 719 } 473e1b802231d7 Kunkun Jiang 2023-12-06 720 473e1b802231d7 Kunkun Jiang 2023-12-06 721 writel_relaxed(1, addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 722 iounmap(addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 723 473e1b802231d7 Kunkun Jiang 2023-12-06 724 addr = mgn_chip->base + MBIX_VPPI_ITS_TA; 473e1b802231d7 Kunkun Jiang 2023-12-06 725 writel_relaxed(CHIP0_TA_MBIGEN_ITS_BASE, addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 726 } 473e1b802231d7 Kunkun Jiang 2023-12-06 727 473e1b802231d7 Kunkun Jiang 2023-12-06 728 if (res->start == CHIP0_TB_MBIGEN_PHY_BASE) { 473e1b802231d7 Kunkun Jiang 2023-12-06 729 addr = ioremap(CHIP0_TB_PERI_PHY_BASE, 4); 473e1b802231d7 Kunkun Jiang 2023-12-06 730 if (!addr) { 473e1b802231d7 Kunkun Jiang 2023-12-06 731 pr_err("Unable to map CHIP0-TB-PERI\n"); 473e1b802231d7 Kunkun Jiang 2023-12-06 732 return -ENOMEM; 473e1b802231d7 Kunkun Jiang 2023-12-06 733 } 473e1b802231d7 Kunkun Jiang 2023-12-06 734 473e1b802231d7 Kunkun Jiang 2023-12-06 735 writel_relaxed(1, addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 736 iounmap(addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 737 473e1b802231d7 Kunkun Jiang 2023-12-06 738 addr = mgn_chip->base + MBIX_VPPI_ITS_TA; 473e1b802231d7 Kunkun Jiang 2023-12-06 739 writel_relaxed(CHIP0_TB_MBIGEN_ITS_BASE, addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 740 } 473e1b802231d7 Kunkun Jiang 2023-12-06 741 473e1b802231d7 Kunkun Jiang 2023-12-06 742 if (res->start == CHIP1_TA_MBIGEN_PHY_BASE) { 473e1b802231d7 Kunkun Jiang 2023-12-06 743 addr = ioremap(CHIP1_TA_PERI_PHY_BASE, 4); 473e1b802231d7 Kunkun Jiang 2023-12-06 744 if (!addr) { 473e1b802231d7 Kunkun Jiang 2023-12-06 745 pr_err("Unable to map CHIP1-TA-PERI\n"); 473e1b802231d7 Kunkun Jiang 2023-12-06 746 return -ENOMEM; 473e1b802231d7 Kunkun Jiang 2023-12-06 747 } 473e1b802231d7 Kunkun Jiang 2023-12-06 748 473e1b802231d7 Kunkun Jiang 2023-12-06 749 writel_relaxed(1, addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 750 iounmap(addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 751 473e1b802231d7 Kunkun Jiang 2023-12-06 752 addr = mgn_chip->base + MBIX_VPPI_ITS_TA; 473e1b802231d7 Kunkun Jiang 2023-12-06 753 writel_relaxed(CHIP1_TA_MBIGEN_ITS_BASE, addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 754 } 473e1b802231d7 Kunkun Jiang 2023-12-06 755 473e1b802231d7 Kunkun Jiang 2023-12-06 756 if (res->start == CHIP1_TB_MBIGEN_PHY_BASE) { 473e1b802231d7 Kunkun Jiang 2023-12-06 757 addr = ioremap(CHIP1_TB_PERI_PHY_BASE, 4); 473e1b802231d7 Kunkun Jiang 2023-12-06 758 if (!addr) { 473e1b802231d7 Kunkun Jiang 2023-12-06 759 pr_err("Unable to map CHIP1-TB-PERI\n"); 473e1b802231d7 Kunkun Jiang 2023-12-06 760 return -ENOMEM; 473e1b802231d7 Kunkun Jiang 2023-12-06 761 } 473e1b802231d7 Kunkun Jiang 2023-12-06 762 473e1b802231d7 Kunkun Jiang 2023-12-06 763 writel_relaxed(1, addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 764 iounmap(addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 765 473e1b802231d7 Kunkun Jiang 2023-12-06 766 addr = mgn_chip->base + MBIX_VPPI_ITS_TA; 473e1b802231d7 Kunkun Jiang 2023-12-06 767 writel_relaxed(CHIP1_TB_MBIGEN_ITS_BASE, addr); 473e1b802231d7 Kunkun Jiang 2023-12-06 768 } 473e1b802231d7 Kunkun Jiang 2023-12-06 769 473e1b802231d7 Kunkun Jiang 2023-12-06 770 return 0; 473e1b802231d7 Kunkun Jiang 2023-12-06 771 } 473e1b802231d7 Kunkun Jiang 2023-12-06 772 :::::: The code at line 693 was first introduced by commit :::::: 473e1b802231d790ba8eb31c0597d5b8eba306d6 mbigen: Sets the regs related to vtimer irqbypass :::::: TO: Kunkun Jiang <jiangkunkun(a)huawei.com> :::::: CC: Dongxu Sun <sundongxu3(a)huawei.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-6.6] iommufd: Require drivers to supply the cache_invalidate_user ops
by Lin Ruifeng 28 Oct '24

28 Oct '24
From: Jason Gunthorpe <jgg(a)nvidia.com> stable inclusion from stable-v6.10.10 commit 89827a4de802765b1ebb401fc1e73a90108c7520 bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9LS CVE: CVE-2024-46824 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit a11dda723c6493bb1853bbc61c093377f96e2d47 ] If drivers don't do this then iommufd will oops invalidation ioctls with something like: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Mem abort info: ESR = 0x0000000086000004 EC = 0x21: IABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault user pgtable: 4k pages, 48-bit VAs, pgdp=0000000101059000 [0000000000000000] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 0000000086000004 [#1] PREEMPT SMP Modules linked in: CPU: 2 PID: 371 Comm: qemu-system-aar Not tainted 6.8.0-rc7-gde77230ac23a #9 Hardware name: linux,dummy-virt (DT) pstate: 81400809 (Nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=-c) pc : 0x0 lr : iommufd_hwpt_invalidate+0xa4/0x204 sp : ffff800080f3bcc0 x29: ffff800080f3bcf0 x28: ffff0000c369b300 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 x23: 0000000000000000 x22: 00000000c1e334a0 x21: ffff0000c1e334a0 x20: ffff800080f3bd38 x19: ffff800080f3bd58 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffff8240d6d8 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000001000000002 x7 : 0000fffeac1ec950 x6 : 0000000000000000 x5 : ffff800080f3bd78 x4 : 0000000000000003 x3 : 0000000000000002 x2 : 0000000000000000 x1 : ffff800080f3bcc8 x0 : ffff0000c6034d80 Call trace: 0x0 iommufd_fops_ioctl+0x154/0x274 __arm64_sys_ioctl+0xac/0xf0 invoke_syscall+0x48/0x110 el0_svc_common.constprop.0+0x40/0xe0 do_el0_svc+0x1c/0x28 el0_svc+0x34/0xb4 el0t_64_sync_handler+0x120/0x12c el0t_64_sync+0x190/0x194 All existing drivers implement this op for nesting, this is mostly a bisection aid. Fixes: 8c6eabae3807 ("iommufd: Add IOMMU_HWPT_INVALIDATE") Link: https://lore.kernel.org/r/0-v1-e153859bd707+61-iommufd_check_ops_jgg@nvidia… Reviewed-by: Nicolin Chen <nicolinc(a)nvidia.com> Reviewed-by: Yi Liu <yi.l.liu(a)intel.com> Reviewed-by: Kevin Tian <kevin.tian(a)intel.com> Signed-off-by: Jason Gunthorpe <jgg(a)nvidia.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> --- drivers/iommu/iommufd/hw_pagetable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iommufd/hw_pagetable.c b/drivers/iommu/iommufd/hw_pagetable.c index 33d142f8057d..a9f1fe44c4c0 100644 --- a/drivers/iommu/iommufd/hw_pagetable.c +++ b/drivers/iommu/iommufd/hw_pagetable.c @@ -236,7 +236,8 @@ iommufd_hwpt_nested_alloc(struct iommufd_ctx *ictx, } hwpt->domain->owner = ops; - if (WARN_ON_ONCE(hwpt->domain->type != IOMMU_DOMAIN_NESTED)) { + if (WARN_ON_ONCE(hwpt->domain->type != IOMMU_DOMAIN_NESTED || + !hwpt->domain->ops->cache_invalidate_user)) { rc = -EINVAL; goto out_abort; } -- 2.17.1
2 1
0 0
[PATCH OLK-5.10] drm/amd/display: Check null pointer before dereferencing se
by Xiaomeng Zhang 28 Oct '24

28 Oct '24
From: Alex Hung <alex.hung(a)amd.com> mainline inclusion from mainline-v6.12-rc1 commit ff599ef6970ee000fa5bc38d02fa5ff5f3fc7575 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAZM9W Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [WHAT & HOW] se is null checked previously in the same function, indicating it might be null; therefore, it must be checked when used again. This fixes 1 FORWARD_NULL issue reported by Coverity. Acked-by: Alex Hung <alex.hung(a)amd.com> Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira(a)amd.com> Signed-off-by: Alex Hung <alex.hung(a)amd.com> Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com> Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com> Signed-off-by: Xiaomeng Zhang <zhangxiaomeng13(a)huawei.com> --- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index adcf5ba83703..c172622365d3 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -1252,7 +1252,7 @@ bool dc_validate_seamless_boot_timing(const struct dc *dc, if (crtc_timing->pix_clk_100hz != pix_clk_100hz) return false; - if (!se->funcs->dp_get_pixel_format) + if (!se || !se->funcs->dp_get_pixel_format) return false; if (!se->funcs->dp_get_pixel_format( -- 2.34.1
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1] drm/amd/display: Check null pointer before dereferencing se
by Xiaomeng Zhang 28 Oct '24

28 Oct '24
From: Alex Hung <alex.hung(a)amd.com> mainline inclusion from mainline-v6.12-rc1 commit ff599ef6970ee000fa5bc38d02fa5ff5f3fc7575 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAZM9W Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [WHAT & HOW] se is null checked previously in the same function, indicating it might be null; therefore, it must be checked when used again. This fixes 1 FORWARD_NULL issue reported by Coverity. Acked-by: Alex Hung <alex.hung(a)amd.com> Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira(a)amd.com> Signed-off-by: Alex Hung <alex.hung(a)amd.com> Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com> Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com> Signed-off-by: Xiaomeng Zhang <zhangxiaomeng13(a)huawei.com> --- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index ddbfce8390bb..3c350c76790a 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -1251,7 +1251,7 @@ bool dc_validate_seamless_boot_timing(const struct dc *dc, if (crtc_timing->pix_clk_100hz != pix_clk_100hz) return false; - if (!se->funcs->dp_get_pixel_format) + if (!se || !se->funcs->dp_get_pixel_format) return false; if (!se->funcs->dp_get_pixel_format( -- 2.34.1
2 1
0 0
[PATCH OLK-5.10] scsi: fnic: Move flush_work initialization out of if block
by GONG Ruiqi 28 Oct '24

28 Oct '24
From: Martin Wilck <martin.wilck(a)suse.com> mainline inclusion from mainline-v6.12-rc3 commit f30e5f77d2f205ac14d09dec40fd4bb76712f13d category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYRJ6 CVE: CVE-2024-50025 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- After commit 379a58caa199 ("scsi: fnic: Move fnic_fnic_flush_tx() to a work queue"), it can happen that a work item is sent to an uninitialized work queue. This may has the effect that the item being queued is never actually queued, and any further actions depending on it will not proceed. The following warning is observed while the fnic driver is loaded: kernel: WARNING: CPU: 11 PID: 0 at ../kernel/workqueue.c:1524 __queue_work+0x373/0x410 kernel: <IRQ> kernel: queue_work_on+0x3a/0x50 kernel: fnic_wq_copy_cmpl_handler+0x54a/0x730 [fnic 62fbff0c42e7fb825c60a55cde2fb91facb2ed24] kernel: fnic_isr_msix_wq_copy+0x2d/0x60 [fnic 62fbff0c42e7fb825c60a55cde2fb91facb2ed24] kernel: __handle_irq_event_percpu+0x36/0x1a0 kernel: handle_irq_event_percpu+0x30/0x70 kernel: handle_irq_event+0x34/0x60 kernel: handle_edge_irq+0x7e/0x1a0 kernel: __common_interrupt+0x3b/0xb0 kernel: common_interrupt+0x58/0xa0 kernel: </IRQ> It has been observed that this may break the rediscovery of Fibre Channel devices after a temporary fabric failure. This patch fixes it by moving the work queue initialization out of an if block in fnic_probe(). Signed-off-by: Martin Wilck <mwilck(a)suse.com> Fixes: 379a58caa199 ("scsi: fnic: Move fnic_fnic_flush_tx() to a work queue") Cc: stable(a)vger.kernel.org Link: https://lore.kernel.org/r/20240930133014.71615-1-mwilck@suse.com Reviewed-by: Lee Duncan <lduncan(a)suse.com> Reviewed-by: Karan Tilak Kumar <kartilak(a)cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com> Signed-off-by: GONG Ruiqi <gongruiqi1(a)huawei.com> --- drivers/scsi/fnic/fnic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 16c2cdacd0a6..580ee456eab3 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -776,7 +776,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) spin_lock_init(&fnic->vlans_lock); INIT_WORK(&fnic->fip_frame_work, fnic_handle_fip_frame); INIT_WORK(&fnic->event_work, fnic_handle_event); - INIT_WORK(&fnic->flush_work, fnic_flush_tx); skb_queue_head_init(&fnic->fip_frame_queue); INIT_LIST_HEAD(&fnic->evlist); INIT_LIST_HEAD(&fnic->vlans); @@ -877,6 +876,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) INIT_WORK(&fnic->link_work, fnic_handle_link); INIT_WORK(&fnic->frame_work, fnic_handle_frame); + INIT_WORK(&fnic->flush_work, fnic_flush_tx); skb_queue_head_init(&fnic->frame_queue); skb_queue_head_init(&fnic->tx_queue); -- 2.25.1
2 1
0 0
[PATCH OLK-6.6] scsi: fnic: Move flush_work initialization out of if block
by GONG Ruiqi 28 Oct '24

28 Oct '24
From: Martin Wilck <martin.wilck(a)suse.com> mainline inclusion from mainline-v6.12-rc3 commit f30e5f77d2f205ac14d09dec40fd4bb76712f13d category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYRJ6 CVE: CVE-2024-50025 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- After commit 379a58caa199 ("scsi: fnic: Move fnic_fnic_flush_tx() to a work queue"), it can happen that a work item is sent to an uninitialized work queue. This may has the effect that the item being queued is never actually queued, and any further actions depending on it will not proceed. The following warning is observed while the fnic driver is loaded: kernel: WARNING: CPU: 11 PID: 0 at ../kernel/workqueue.c:1524 __queue_work+0x373/0x410 kernel: <IRQ> kernel: queue_work_on+0x3a/0x50 kernel: fnic_wq_copy_cmpl_handler+0x54a/0x730 [fnic 62fbff0c42e7fb825c60a55cde2fb91facb2ed24] kernel: fnic_isr_msix_wq_copy+0x2d/0x60 [fnic 62fbff0c42e7fb825c60a55cde2fb91facb2ed24] kernel: __handle_irq_event_percpu+0x36/0x1a0 kernel: handle_irq_event_percpu+0x30/0x70 kernel: handle_irq_event+0x34/0x60 kernel: handle_edge_irq+0x7e/0x1a0 kernel: __common_interrupt+0x3b/0xb0 kernel: common_interrupt+0x58/0xa0 kernel: </IRQ> It has been observed that this may break the rediscovery of Fibre Channel devices after a temporary fabric failure. This patch fixes it by moving the work queue initialization out of an if block in fnic_probe(). Signed-off-by: Martin Wilck <mwilck(a)suse.com> Fixes: 379a58caa199 ("scsi: fnic: Move fnic_fnic_flush_tx() to a work queue") Cc: stable(a)vger.kernel.org Link: https://lore.kernel.org/r/20240930133014.71615-1-mwilck@suse.com Reviewed-by: Lee Duncan <lduncan(a)suse.com> Reviewed-by: Karan Tilak Kumar <kartilak(a)cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com> Signed-off-by: GONG Ruiqi <gongruiqi1(a)huawei.com> --- drivers/scsi/fnic/fnic_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index de369bb03e3e..e85bbdf5ebae 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -792,7 +792,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) spin_lock_init(&fnic->vlans_lock); INIT_WORK(&fnic->fip_frame_work, fnic_handle_fip_frame); INIT_WORK(&fnic->event_work, fnic_handle_event); - INIT_WORK(&fnic->flush_work, fnic_flush_tx); skb_queue_head_init(&fnic->fip_frame_queue); INIT_LIST_HEAD(&fnic->evlist); INIT_LIST_HEAD(&fnic->vlans); @@ -893,6 +892,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) INIT_WORK(&fnic->link_work, fnic_handle_link); INIT_WORK(&fnic->frame_work, fnic_handle_frame); + INIT_WORK(&fnic->flush_work, fnic_flush_tx); skb_queue_head_init(&fnic->frame_queue); skb_queue_head_init(&fnic->tx_queue); -- 2.25.1
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1 0/3] fix CVE-2024-47699
by Zhang Kunbo 28 Oct '24

28 Oct '24
This addresses three potential issues with empty b-tree nodes that can occur with corrupted filesystem images, including one recently discovered by syzbot. Ryusuke Konishi (3): nilfs2: fix potential null-ptr-deref in nilfs_btree_insert() nilfs2: determine empty node blocks as corrupted nilfs2: fix potential oob read in nilfs_btree_check_delete() fs/nilfs2/btree.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.34.1
2 4
0 0
[PATCH openEuler-1.0-LTS] pinctrl: single: fix potential NULL dereference in pcs_get_function()
by Zhang Zekun 28 Oct '24

28 Oct '24
From: Ma Ke <make24(a)iscas.ac.cn> mainline inclusion from mainline-v6.11-rc6 commit 1c38a62f15e595346a1106025722869e87ffe044 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAR49K CVE: CVE-2024-46685 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… ------------------------------------------------------- pinmux_generic_get_function() can return NULL and the pointer 'function' was dereferenced without checking against NULL. Add checking of pointer 'function' in pcs_get_function(). Found by code review. Cc: stable(a)vger.kernel.org Fixes: 571aec4df5b7 ("pinctrl: single: Use generic pinmux helpers for managing functions") Signed-off-by: Ma Ke <make24(a)iscas.ac.cn> Link: https://lore.kernel.org/20240808041355.2766009-1-make24@iscas.ac.cn Signed-off-by: Linus Walleij <linus.walleij(a)linaro.org> Signed-off-by: Zhang Zekun <zhangzekun11(a)huawei.com> --- drivers/pinctrl/pinctrl-single.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 2958758935ed..4aea8e10aea7 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -323,6 +323,8 @@ static int pcs_get_function(struct pinctrl_dev *pctldev, unsigned pin, return -ENOTSUPP; fselector = setting->func; function = pinmux_generic_get_function(pctldev, fselector); + if (!function) + return -EINVAL; *func = function->data; if (!(*func)) { dev_err(pcs->dev, "%s could not find function%i\n", -- 2.17.1
2 1
0 0
  • ← Newer
  • 1
  • ...
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • ...
  • 93
  • Older →

HyperKitty Powered by HyperKitty