Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 's390-6.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Vasily Gorbik:

- Update defconfigs

- Fix early boot code by adding missing intersection check to prevent
potential overwriting of the ipl report

- Fix a use-after-free issue in s390-specific code related to PCI
resources being retained after hot-unplugging individual functions,
by removing the resources from the PCI bus's resource list and using
the zpci_bar_struct's resource pointer directly

* tag 's390-6.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390: update defconfigs
PCI: s390: Fix use-after-free of PCI resources with per-function hotplug
s390/ipl: add missing intersection check to ipl_report handling

+54 -34
+8
arch/s390/boot/ipl_report.c
··· 57 57 if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && initrd_data.start && initrd_data.size && 58 58 intersects(initrd_data.start, initrd_data.size, safe_addr, size)) 59 59 safe_addr = initrd_data.start + initrd_data.size; 60 + if (intersects(safe_addr, size, (unsigned long)comps, comps->len)) { 61 + safe_addr = (unsigned long)comps + comps->len; 62 + goto repeat; 63 + } 60 64 for_each_rb_entry(comp, comps) 61 65 if (intersects(safe_addr, size, comp->addr, comp->len)) { 62 66 safe_addr = comp->addr + comp->len; 63 67 goto repeat; 64 68 } 69 + if (intersects(safe_addr, size, (unsigned long)certs, certs->len)) { 70 + safe_addr = (unsigned long)certs + certs->len; 71 + goto repeat; 72 + } 65 73 for_each_rb_entry(cert, certs) 66 74 if (intersects(safe_addr, size, cert->addr, cert->len)) { 67 75 safe_addr = cert->addr + cert->len;
+4 -9
arch/s390/configs/debug_defconfig
··· 23 23 CONFIG_MEMCG=y 24 24 CONFIG_BLK_CGROUP=y 25 25 CONFIG_CFS_BANDWIDTH=y 26 - CONFIG_RT_GROUP_SCHED=y 27 26 CONFIG_CGROUP_PIDS=y 28 27 CONFIG_CGROUP_RDMA=y 29 28 CONFIG_CGROUP_FREEZER=y ··· 89 90 CONFIG_SOLARIS_X86_PARTITION=y 90 91 CONFIG_UNIXWARE_DISKLABEL=y 91 92 CONFIG_IOSCHED_BFQ=y 92 - CONFIG_BFQ_GROUP_IOSCHED=y 93 93 CONFIG_BINFMT_MISC=m 94 94 CONFIG_ZSWAP=y 95 95 CONFIG_ZSMALLOC_STAT=y ··· 296 298 CONFIG_IP_NF_NAT=m 297 299 CONFIG_IP_NF_TARGET_MASQUERADE=m 298 300 CONFIG_IP_NF_MANGLE=m 299 - CONFIG_IP_NF_TARGET_CLUSTERIP=m 300 301 CONFIG_IP_NF_TARGET_ECN=m 301 302 CONFIG_IP_NF_TARGET_TTL=m 302 303 CONFIG_IP_NF_RAW=m ··· 337 340 CONFIG_VLAN_8021Q=m 338 341 CONFIG_VLAN_8021Q_GVRP=y 339 342 CONFIG_NET_SCHED=y 340 - CONFIG_NET_SCH_CBQ=m 341 343 CONFIG_NET_SCH_HTB=m 342 344 CONFIG_NET_SCH_HFSC=m 343 345 CONFIG_NET_SCH_PRIO=m ··· 347 351 CONFIG_NET_SCH_TEQL=m 348 352 CONFIG_NET_SCH_TBF=m 349 353 CONFIG_NET_SCH_GRED=m 350 - CONFIG_NET_SCH_DSMARK=m 351 354 CONFIG_NET_SCH_NETEM=m 352 355 CONFIG_NET_SCH_DRR=m 353 356 CONFIG_NET_SCH_MQPRIO=m ··· 358 363 CONFIG_NET_SCH_PLUG=m 359 364 CONFIG_NET_SCH_ETS=m 360 365 CONFIG_NET_CLS_BASIC=m 361 - CONFIG_NET_CLS_TCINDEX=m 362 366 CONFIG_NET_CLS_ROUTE4=m 363 367 CONFIG_NET_CLS_FW=m 364 368 CONFIG_NET_CLS_U32=m 365 369 CONFIG_CLS_U32_PERF=y 366 370 CONFIG_CLS_U32_MARK=y 367 - CONFIG_NET_CLS_RSVP=m 368 - CONFIG_NET_CLS_RSVP6=m 369 371 CONFIG_NET_CLS_FLOW=m 370 372 CONFIG_NET_CLS_CGROUP=y 371 373 CONFIG_NET_CLS_BPF=m ··· 576 584 CONFIG_FB=y 577 585 CONFIG_FRAMEBUFFER_CONSOLE=y 578 586 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y 579 - # CONFIG_HID is not set 587 + # CONFIG_HID_SUPPORT is not set 580 588 # CONFIG_USB_SUPPORT is not set 581 589 CONFIG_INFINIBAND=m 582 590 CONFIG_INFINIBAND_USER_ACCESS=m ··· 820 828 CONFIG_DETECT_HUNG_TASK=y 821 829 CONFIG_WQ_WATCHDOG=y 822 830 CONFIG_TEST_LOCKUP=m 831 + CONFIG_DEBUG_PREEMPT=y 823 832 CONFIG_PROVE_LOCKING=y 824 833 CONFIG_LOCK_STAT=y 825 834 CONFIG_DEBUG_ATOMIC_SLEEP=y ··· 836 843 # CONFIG_RCU_TRACE is not set 837 844 CONFIG_LATENCYTOP=y 838 845 CONFIG_BOOTTIME_TRACING=y 846 + CONFIG_FPROBE=y 839 847 CONFIG_FUNCTION_PROFILER=y 840 848 CONFIG_STACK_TRACER=y 841 849 CONFIG_IRQSOFF_TRACER=y ··· 851 857 CONFIG_SAMPLE_TRACE_PRINTK=m 852 858 CONFIG_SAMPLE_FTRACE_DIRECT=m 853 859 CONFIG_SAMPLE_FTRACE_DIRECT_MULTI=m 860 + CONFIG_SAMPLE_FTRACE_OPS=m 854 861 CONFIG_DEBUG_ENTRY=y 855 862 CONFIG_CIO_INJECT=y 856 863 CONFIG_KUNIT=m
+3 -9
arch/s390/configs/defconfig
··· 21 21 CONFIG_MEMCG=y 22 22 CONFIG_BLK_CGROUP=y 23 23 CONFIG_CFS_BANDWIDTH=y 24 - CONFIG_RT_GROUP_SCHED=y 25 24 CONFIG_CGROUP_PIDS=y 26 25 CONFIG_CGROUP_RDMA=y 27 26 CONFIG_CGROUP_FREEZER=y ··· 84 85 CONFIG_SOLARIS_X86_PARTITION=y 85 86 CONFIG_UNIXWARE_DISKLABEL=y 86 87 CONFIG_IOSCHED_BFQ=y 87 - CONFIG_BFQ_GROUP_IOSCHED=y 88 88 CONFIG_BINFMT_MISC=m 89 89 CONFIG_ZSWAP=y 90 90 CONFIG_ZSMALLOC_STAT=y ··· 287 289 CONFIG_IP_NF_NAT=m 288 290 CONFIG_IP_NF_TARGET_MASQUERADE=m 289 291 CONFIG_IP_NF_MANGLE=m 290 - CONFIG_IP_NF_TARGET_CLUSTERIP=m 291 292 CONFIG_IP_NF_TARGET_ECN=m 292 293 CONFIG_IP_NF_TARGET_TTL=m 293 294 CONFIG_IP_NF_RAW=m ··· 327 330 CONFIG_VLAN_8021Q=m 328 331 CONFIG_VLAN_8021Q_GVRP=y 329 332 CONFIG_NET_SCHED=y 330 - CONFIG_NET_SCH_CBQ=m 331 333 CONFIG_NET_SCH_HTB=m 332 334 CONFIG_NET_SCH_HFSC=m 333 335 CONFIG_NET_SCH_PRIO=m ··· 337 341 CONFIG_NET_SCH_TEQL=m 338 342 CONFIG_NET_SCH_TBF=m 339 343 CONFIG_NET_SCH_GRED=m 340 - CONFIG_NET_SCH_DSMARK=m 341 344 CONFIG_NET_SCH_NETEM=m 342 345 CONFIG_NET_SCH_DRR=m 343 346 CONFIG_NET_SCH_MQPRIO=m ··· 348 353 CONFIG_NET_SCH_PLUG=m 349 354 CONFIG_NET_SCH_ETS=m 350 355 CONFIG_NET_CLS_BASIC=m 351 - CONFIG_NET_CLS_TCINDEX=m 352 356 CONFIG_NET_CLS_ROUTE4=m 353 357 CONFIG_NET_CLS_FW=m 354 358 CONFIG_NET_CLS_U32=m 355 359 CONFIG_CLS_U32_PERF=y 356 360 CONFIG_CLS_U32_MARK=y 357 - CONFIG_NET_CLS_RSVP=m 358 - CONFIG_NET_CLS_RSVP6=m 359 361 CONFIG_NET_CLS_FLOW=m 360 362 CONFIG_NET_CLS_CGROUP=y 361 363 CONFIG_NET_CLS_BPF=m ··· 565 573 CONFIG_FB=y 566 574 CONFIG_FRAMEBUFFER_CONSOLE=y 567 575 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y 568 - # CONFIG_HID is not set 576 + # CONFIG_HID_SUPPORT is not set 569 577 # CONFIG_USB_SUPPORT is not set 570 578 CONFIG_INFINIBAND=m 571 579 CONFIG_INFINIBAND_USER_ACCESS=m ··· 787 795 CONFIG_RCU_CPU_STALL_TIMEOUT=60 788 796 CONFIG_LATENCYTOP=y 789 797 CONFIG_BOOTTIME_TRACING=y 798 + CONFIG_FPROBE=y 790 799 CONFIG_FUNCTION_PROFILER=y 791 800 CONFIG_STACK_TRACER=y 792 801 CONFIG_SCHED_TRACER=y ··· 798 805 CONFIG_SAMPLE_TRACE_PRINTK=m 799 806 CONFIG_SAMPLE_FTRACE_DIRECT=m 800 807 CONFIG_SAMPLE_FTRACE_DIRECT_MULTI=m 808 + CONFIG_SAMPLE_FTRACE_OPS=m 801 809 CONFIG_KUNIT=m 802 810 CONFIG_KUNIT_DEBUGFS=y 803 811 CONFIG_LKDTM=m
+1 -1
arch/s390/configs/zfcpdump_defconfig
··· 58 58 # CONFIG_VMCP is not set 59 59 # CONFIG_MONWRITER is not set 60 60 # CONFIG_S390_VMUR is not set 61 - # CONFIG_HID is not set 61 + # CONFIG_HID_SUPPORT is not set 62 62 # CONFIG_VIRTIO_MENU is not set 63 63 # CONFIG_VHOST_MENU is not set 64 64 # CONFIG_IOMMU_SUPPORT is not set
+10 -6
arch/s390/pci/pci.c
··· 544 544 return r; 545 545 } 546 546 547 - int zpci_setup_bus_resources(struct zpci_dev *zdev, 548 - struct list_head *resources) 547 + int zpci_setup_bus_resources(struct zpci_dev *zdev) 549 548 { 550 549 unsigned long addr, size, flags; 551 550 struct resource *res; ··· 580 581 return -ENOMEM; 581 582 } 582 583 zdev->bars[i].res = res; 583 - pci_add_resource(resources, res); 584 584 } 585 585 zdev->has_resources = 1; 586 586 ··· 588 590 589 591 static void zpci_cleanup_bus_resources(struct zpci_dev *zdev) 590 592 { 593 + struct resource *res; 591 594 int i; 592 595 596 + pci_lock_rescan_remove(); 593 597 for (i = 0; i < PCI_STD_NUM_BARS; i++) { 594 - if (!zdev->bars[i].size || !zdev->bars[i].res) 598 + res = zdev->bars[i].res; 599 + if (!res) 595 600 continue; 596 601 602 + release_resource(res); 603 + pci_bus_remove_resource(zdev->zbus->bus, res); 597 604 zpci_free_iomap(zdev, zdev->bars[i].map_idx); 598 - release_resource(zdev->bars[i].res); 599 - kfree(zdev->bars[i].res); 605 + zdev->bars[i].res = NULL; 606 + kfree(res); 600 607 } 601 608 zdev->has_resources = 0; 609 + pci_unlock_rescan_remove(); 602 610 } 603 611 604 612 int pcibios_device_add(struct pci_dev *pdev)
+5 -7
arch/s390/pci/pci_bus.c
··· 41 41 */ 42 42 static int zpci_bus_prepare_device(struct zpci_dev *zdev) 43 43 { 44 - struct resource_entry *window, *n; 45 - struct resource *res; 46 - int rc; 44 + int rc, i; 47 45 48 46 if (!zdev_enabled(zdev)) { 49 47 rc = zpci_enable_device(zdev); ··· 55 57 } 56 58 57 59 if (!zdev->has_resources) { 58 - zpci_setup_bus_resources(zdev, &zdev->zbus->resources); 59 - resource_list_for_each_entry_safe(window, n, &zdev->zbus->resources) { 60 - res = window->res; 61 - pci_bus_add_resource(zdev->zbus->bus, res, 0); 60 + zpci_setup_bus_resources(zdev); 61 + for (i = 0; i < PCI_STD_NUM_BARS; i++) { 62 + if (zdev->bars[i].res) 63 + pci_bus_add_resource(zdev->zbus->bus, zdev->bars[i].res, 0); 62 64 } 63 65 } 64 66
+1 -2
arch/s390/pci/pci_bus.h
··· 30 30 31 31 int zpci_alloc_domain(int domain); 32 32 void zpci_free_domain(int domain); 33 - int zpci_setup_bus_resources(struct zpci_dev *zdev, 34 - struct list_head *resources); 33 + int zpci_setup_bus_resources(struct zpci_dev *zdev); 35 34 36 35 static inline struct zpci_dev *zdev_from_bus(struct pci_bus *bus, 37 36 unsigned int devfn)
+21
drivers/pci/bus.c
··· 76 76 } 77 77 EXPORT_SYMBOL_GPL(pci_bus_resource_n); 78 78 79 + void pci_bus_remove_resource(struct pci_bus *bus, struct resource *res) 80 + { 81 + struct pci_bus_resource *bus_res, *tmp; 82 + int i; 83 + 84 + for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) { 85 + if (bus->resource[i] == res) { 86 + bus->resource[i] = NULL; 87 + return; 88 + } 89 + } 90 + 91 + list_for_each_entry_safe(bus_res, tmp, &bus->resources, list) { 92 + if (bus_res->res == res) { 93 + list_del(&bus_res->list); 94 + kfree(bus_res); 95 + return; 96 + } 97 + } 98 + } 99 + 79 100 void pci_bus_remove_resources(struct pci_bus *bus) 80 101 { 81 102 int i;
+1
include/linux/pci.h
··· 1438 1438 unsigned int flags); 1439 1439 struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); 1440 1440 void pci_bus_remove_resources(struct pci_bus *bus); 1441 + void pci_bus_remove_resource(struct pci_bus *bus, struct resource *res); 1441 1442 int devm_request_pci_bus_resources(struct device *dev, 1442 1443 struct list_head *resources); 1443 1444