| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/10 13:19 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "All modified files are located in arch/s390/ and drivers/s390/cio/, which are exclusive to the s390 architecture (CONFIG_S390) and not compiled or reachable on the target architecture (amd64).",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/10 13:19 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 589de605e43b316ce04ab692923c053bde6880de\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Thu Sep 10 13:19:35 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h\nindex 06e1ec2afd5af..213f430a8d33a 100644\n--- a/arch/s390/include/asm/idals.h\n+++ b/arch/s390/include/asm/idals.h\n@@ -18,6 +18,7 @@\n #include \u003clinux/types.h\u003e\n #include \u003clinux/slab.h\u003e\n #include \u003clinux/uaccess.h\u003e\n+#include \u003clinux/kmemleak.h\u003e\n #include \u003casm/dma-types.h\u003e\n #include \u003casm/cio.h\u003e\n \n@@ -147,9 +148,11 @@ static inline struct idal_buffer *idal_buffer_alloc(size_t size, int page_order)\n \t\t\tib-\u003edata[i] = dma64_add(ib-\u003edata[i - 1], IDA_BLOCK_SIZE);\n \t\t\tcontinue;\n \t\t}\n-\t\tvaddr = (void *)__get_free_pages(GFP_KERNEL, page_order);\n+\t\tvaddr = kmalloc(PAGE_SIZE \u003c\u003c page_order, GFP_KERNEL);\n \t\tif (!vaddr)\n \t\t\tgoto error;\n+\t\t/* Only DMA addresses are retained in ib-\u003edata. */\n+\t\tkmemleak_ignore(vaddr);\n \t\tib-\u003edata[i] = virt_to_dma64(vaddr);\n \t}\n \treturn ib;\n@@ -157,7 +160,7 @@ static inline struct idal_buffer *idal_buffer_alloc(size_t size, int page_order)\n \twhile (i \u003e= nr_chunks) {\n \t\ti -= nr_chunks;\n \t\tvaddr = dma64_to_virt(ib-\u003edata[i]);\n-\t\tfree_pages((unsigned long)vaddr, ib-\u003epage_order);\n+\t\tkfree(vaddr);\n \t}\n \tkfree(ib);\n \treturn ERR_PTR(-ENOMEM);\n@@ -175,7 +178,7 @@ static inline void idal_buffer_free(struct idal_buffer *ib)\n \tnr_chunks = (PAGE_SIZE \u003c\u003c ib-\u003epage_order) \u003e\u003e IDA_SIZE_SHIFT;\n \tfor (i = 0; i \u003c nr_ptrs; i += nr_chunks) {\n \t\tvaddr = dma64_to_virt(ib-\u003edata[i]);\n-\t\tfree_pages((unsigned long)vaddr, ib-\u003epage_order);\n+\t\tkfree(vaddr);\n \t}\n \tkfree(ib);\n }\ndiff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c\nindex 9689f722c863c..d98f629e89295 100644\n--- a/drivers/s390/cio/chsc.c\n+++ b/drivers/s390/cio/chsc.c\n@@ -931,12 +931,12 @@ static int cub_alloc(struct channel_subsystem *css)\n \tint i;\n \n \tfor (i = 0; i \u003c CSS_NUM_CUB_PAGES; i++) {\n-\t\tcss-\u003ecub[i] = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\t\tcss-\u003ecub[i] = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \t\tif (!css-\u003ecub[i])\n \t\t\treturn -ENOMEM;\n \t}\n \tfor (i = 0; i \u003c CSS_NUM_ECUB_PAGES; i++) {\n-\t\tcss-\u003eecub[i] = (void *)get_zeroed_page(GFP_KERNEL);\n+\t\tcss-\u003eecub[i] = kzalloc(PAGE_SIZE, GFP_KERNEL);\n \t\tif (!css-\u003eecub[i])\n \t\t\treturn -ENOMEM;\n \t}\n@@ -949,11 +949,11 @@ static void cub_free(struct channel_subsystem *css)\n \tint i;\n \n \tfor (i = 0; i \u003c CSS_NUM_CUB_PAGES; i++) {\n-\t\tfree_page((unsigned long)css-\u003ecub[i]);\n+\t\tkfree(css-\u003ecub[i]);\n \t\tcss-\u003ecub[i] = NULL;\n \t}\n \tfor (i = 0; i \u003c CSS_NUM_ECUB_PAGES; i++) {\n-\t\tfree_page((unsigned long)css-\u003eecub[i]);\n+\t\tkfree(css-\u003eecub[i]);\n \t\tcss-\u003eecub[i] = NULL;\n \t}\n }\n@@ -1142,8 +1142,8 @@ int __init chsc_init(void)\n {\n \tint ret;\n \n-\tsei_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n-\tchsc_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tsei_page = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n+\tchsc_page = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!sei_page || !chsc_page) {\n \t\tret = -ENOMEM;\n \t\tgoto out_err;\n@@ -1153,16 +1153,16 @@ int __init chsc_init(void)\n \t\tgoto out_err;\n \treturn ret;\n out_err:\n-\tfree_page((unsigned long)chsc_page);\n-\tfree_page((unsigned long)sei_page);\n+\tkfree(chsc_page);\n+\tkfree(sei_page);\n \treturn ret;\n }\n \n void __init chsc_init_cleanup(void)\n {\n \tcrw_unregister_handler(CRW_RSC_CSS);\n-\tfree_page((unsigned long)chsc_page);\n-\tfree_page((unsigned long)sei_page);\n+\tkfree(chsc_page);\n+\tkfree(sei_page);\n }\n \n int __chsc_enable_facility(struct chsc_sda_area *sda_area, int operation_code)\ndiff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c\nindex b6cb8bb8bcc4b..225aaac7dd309 100644\n--- a/drivers/s390/cio/chsc_sch.c\n+++ b/drivers/s390/cio/chsc_sch.c\n@@ -15,6 +15,7 @@\n #include \u003clinux/uaccess.h\u003e\n #include \u003clinux/miscdevice.h\u003e\n #include \u003clinux/kernel_stat.h\u003e\n+#include \u003clinux/cleanup.h\u003e\n \n #include \u003casm/cio.h\u003e\n #include \u003casm/chsc.h\u003e\n@@ -292,7 +293,7 @@ static int chsc_ioctl_start(void __user *user_area)\n \tif (!css_general_characteristics.dynio)\n \t\t/* It makes no sense to try. */\n \t\treturn -EOPNOTSUPP;\n-\tchsc_area = (void *)get_zeroed_page(GFP_DMA | GFP_KERNEL);\n+\tchsc_area = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);\n \tif (!chsc_area)\n \t\treturn -ENOMEM;\n \trequest = kzalloc_obj(*request);\n@@ -321,7 +322,7 @@ static int chsc_ioctl_start(void __user *user_area)\n \tsnprintf(dbf, sizeof(dbf), \"ret:%d\", ret);\n \tCHSC_LOG(0, dbf);\n \tkfree(request);\n-\tfree_page((unsigned long)chsc_area);\n+\tkfree(chsc_area);\n \treturn ret;\n }\n \n@@ -340,7 +341,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area)\n \t\tret = -ENOMEM;\n \t\tgoto out_unlock;\n \t}\n-\ton_close_chsc_area = (void *)get_zeroed_page(GFP_DMA | GFP_KERNEL);\n+\ton_close_chsc_area = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);\n \tif (!on_close_chsc_area) {\n \t\tret = -ENOMEM;\n \t\tgoto out_free_request;\n@@ -353,7 +354,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area)\n \tgoto out_unlock;\n \n out_free_chsc:\n-\tfree_page((unsigned long)on_close_chsc_area);\n+\tkfree(on_close_chsc_area);\n \ton_close_chsc_area = NULL;\n out_free_request:\n \tkfree(on_close_request);\n@@ -375,7 +376,7 @@ static int chsc_ioctl_on_close_remove(void)\n \t\tret = -ENOENT;\n \t\tgoto out_unlock;\n \t}\n-\tfree_page((unsigned long)on_close_chsc_area);\n+\tkfree(on_close_chsc_area);\n \ton_close_chsc_area = NULL;\n \tkfree(on_close_request);\n \ton_close_request = NULL;\n@@ -389,39 +390,29 @@ static int chsc_ioctl_on_close_remove(void)\n \n static int chsc_ioctl_start_sync(void __user *user_area)\n {\n-\tstruct chsc_sync_area *chsc_area;\n-\tint ret, ccode;\n+\tstruct chsc_sync_area *chsc_area __free(kfree) = NULL;\n+\tint ccode;\n \n-\tchsc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tchsc_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!chsc_area)\n \t\treturn -ENOMEM;\n-\tif (copy_from_user(chsc_area, user_area, PAGE_SIZE)) {\n-\t\tret = -EFAULT;\n-\t\tgoto out_free;\n-\t}\n-\tif (chsc_area-\u003eheader.code \u0026 0x4000) {\n-\t\tret = -EINVAL;\n-\t\tgoto out_free;\n-\t}\n+\tif (copy_from_user(chsc_area, user_area, PAGE_SIZE))\n+\t\treturn -EFAULT;\n+\tif (chsc_area-\u003eheader.code \u0026 0x4000)\n+\t\treturn -EINVAL;\n \tchsc_log_command(chsc_area);\n \tccode = chsc(chsc_area);\n-\tif (ccode != 0) {\n-\t\tret = -EIO;\n-\t\tgoto out_free;\n-\t}\n+\tif (ccode != 0)\n+\t\treturn -EIO;\n \tif (copy_to_user(user_area, chsc_area, PAGE_SIZE))\n-\t\tret = -EFAULT;\n-\telse\n-\t\tret = 0;\n-out_free:\n-\tfree_page((unsigned long)chsc_area);\n-\treturn ret;\n+\t\treturn -EFAULT;\n+\treturn 0;\n }\n \n static int chsc_ioctl_info_channel_path(void __user *user_cd)\n {\n-\tstruct chsc_chp_cd *cd;\n-\tint ret, ccode;\n+\tstruct chsc_chp_cd *cd __free(kfree) = NULL;\n+\tint ccode;\n \tstruct {\n \t\tstruct chsc_header request;\n \t\tu32 : 2;\n@@ -436,20 +427,16 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd)\n \t\tu32 : 32;\n \t\tstruct chsc_header response;\n \t\tu8 data[PAGE_SIZE - 20];\n-\t} __attribute__ ((packed)) *scpcd_area;\n+\t} __attribute__ ((packed)) *scpcd_area __free(kfree) = NULL;\n \n-\tscpcd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tscpcd_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!scpcd_area)\n \t\treturn -ENOMEM;\n \tcd = kzalloc_obj(*cd);\n-\tif (!cd) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out_free;\n-\t}\n-\tif (copy_from_user(cd, user_cd, sizeof(*cd))) {\n-\t\tret = -EFAULT;\n-\t\tgoto out_free;\n-\t}\n+\tif (!cd)\n+\t\treturn -ENOMEM;\n+\tif (copy_from_user(cd, user_cd, sizeof(*cd)))\n+\t\treturn -EFAULT;\n \tscpcd_area-\u003erequest.length = 0x0010;\n \tscpcd_area-\u003erequest.code = 0x0028;\n \tscpcd_area-\u003em = cd-\u003em;\n@@ -459,31 +446,23 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd)\n \tscpcd_area-\u003elast_chpid = cd-\u003echpid.id;\n \n \tccode = chsc(scpcd_area);\n-\tif (ccode != 0) {\n-\t\tret = -EIO;\n-\t\tgoto out_free;\n-\t}\n+\tif (ccode != 0)\n+\t\treturn -EIO;\n \tif (scpcd_area-\u003eresponse.code != 0x0001) {\n-\t\tret = -EIO;\n \t\tCHSC_MSG(0, \"scpcd: response code=%x\\n\",\n \t\t\t scpcd_area-\u003eresponse.code);\n-\t\tgoto out_free;\n+\t\treturn -EIO;\n \t}\n \tmemcpy(\u0026cd-\u003ecpcb, \u0026scpcd_area-\u003eresponse, scpcd_area-\u003eresponse.length);\n \tif (copy_to_user(user_cd, cd, sizeof(*cd)))\n-\t\tret = -EFAULT;\n-\telse\n-\t\tret = 0;\n-out_free:\n-\tkfree(cd);\n-\tfree_page((unsigned long)scpcd_area);\n-\treturn ret;\n+\t\treturn -EFAULT;\n+\treturn 0;\n }\n \n static int chsc_ioctl_info_cu(void __user *user_cd)\n {\n-\tstruct chsc_cu_cd *cd;\n-\tint ret, ccode;\n+\tstruct chsc_cu_cd *cd __free(kfree) = NULL;\n+\tint ccode;\n \tstruct {\n \t\tstruct chsc_header request;\n \t\tu32 : 2;\n@@ -498,20 +477,16 @@ static int chsc_ioctl_info_cu(void __user *user_cd)\n \t\tu32 : 32;\n \t\tstruct chsc_header response;\n \t\tu8 data[PAGE_SIZE - 20];\n-\t} __attribute__ ((packed)) *scucd_area;\n+\t} __attribute__ ((packed)) *scucd_area __free(kfree) = NULL;\n \n-\tscucd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tscucd_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!scucd_area)\n \t\treturn -ENOMEM;\n \tcd = kzalloc_obj(*cd);\n-\tif (!cd) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out_free;\n-\t}\n-\tif (copy_from_user(cd, user_cd, sizeof(*cd))) {\n-\t\tret = -EFAULT;\n-\t\tgoto out_free;\n-\t}\n+\tif (!cd)\n+\t\treturn -ENOMEM;\n+\tif (copy_from_user(cd, user_cd, sizeof(*cd)))\n+\t\treturn -EFAULT;\n \tscucd_area-\u003erequest.length = 0x0010;\n \tscucd_area-\u003erequest.code = 0x0026;\n \tscucd_area-\u003em = cd-\u003em;\n@@ -521,31 +496,23 @@ static int chsc_ioctl_info_cu(void __user *user_cd)\n \tscucd_area-\u003elast_cun = cd-\u003ecun;\n \n \tccode = chsc(scucd_area);\n-\tif (ccode != 0) {\n-\t\tret = -EIO;\n-\t\tgoto out_free;\n-\t}\n+\tif (ccode != 0)\n+\t\treturn -EIO;\n \tif (scucd_area-\u003eresponse.code != 0x0001) {\n-\t\tret = -EIO;\n \t\tCHSC_MSG(0, \"scucd: response code=%x\\n\",\n \t\t\t scucd_area-\u003eresponse.code);\n-\t\tgoto out_free;\n+\t\treturn -EIO;\n \t}\n \tmemcpy(\u0026cd-\u003ecucb, \u0026scucd_area-\u003eresponse, scucd_area-\u003eresponse.length);\n \tif (copy_to_user(user_cd, cd, sizeof(*cd)))\n-\t\tret = -EFAULT;\n-\telse\n-\t\tret = 0;\n-out_free:\n-\tkfree(cd);\n-\tfree_page((unsigned long)scucd_area);\n-\treturn ret;\n+\t\treturn -EFAULT;\n+\treturn 0;\n }\n \n static int chsc_ioctl_info_sch_cu(void __user *user_cud)\n {\n-\tstruct chsc_sch_cud *cud;\n-\tint ret, ccode;\n+\tstruct chsc_sch_cud *cud __free(kfree) = NULL;\n+\tint ccode;\n \tstruct {\n \t\tstruct chsc_header request;\n \t\tu32 : 2;\n@@ -561,20 +528,16 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud)\n \t\tu32 : 32;\n \t\tstruct chsc_header response;\n \t\tu8 data[PAGE_SIZE - 20];\n-\t} __attribute__ ((packed)) *sscud_area;\n+\t} __attribute__ ((packed)) *sscud_area __free(kfree) = NULL;\n \n-\tsscud_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tsscud_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!sscud_area)\n \t\treturn -ENOMEM;\n \tcud = kzalloc_obj(*cud);\n-\tif (!cud) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out_free;\n-\t}\n-\tif (copy_from_user(cud, user_cud, sizeof(*cud))) {\n-\t\tret = -EFAULT;\n-\t\tgoto out_free;\n-\t}\n+\tif (!cud)\n+\t\treturn -ENOMEM;\n+\tif (copy_from_user(cud, user_cud, sizeof(*cud)))\n+\t\treturn -EFAULT;\n \tsscud_area-\u003erequest.length = 0x0010;\n \tsscud_area-\u003erequest.code = 0x0006;\n \tsscud_area-\u003em = cud-\u003eschid.m;\n@@ -585,31 +548,23 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud)\n \tsscud_area-\u003elast_sch = cud-\u003eschid.sch_no;\n \n \tccode = chsc(sscud_area);\n-\tif (ccode != 0) {\n-\t\tret = -EIO;\n-\t\tgoto out_free;\n-\t}\n+\tif (ccode != 0)\n+\t\treturn -EIO;\n \tif (sscud_area-\u003eresponse.code != 0x0001) {\n-\t\tret = -EIO;\n \t\tCHSC_MSG(0, \"sscud: response code=%x\\n\",\n \t\t\t sscud_area-\u003eresponse.code);\n-\t\tgoto out_free;\n+\t\treturn -EIO;\n \t}\n \tmemcpy(\u0026cud-\u003escub, \u0026sscud_area-\u003eresponse, sscud_area-\u003eresponse.length);\n \tif (copy_to_user(user_cud, cud, sizeof(*cud)))\n-\t\tret = -EFAULT;\n-\telse\n-\t\tret = 0;\n-out_free:\n-\tkfree(cud);\n-\tfree_page((unsigned long)sscud_area);\n-\treturn ret;\n+\t\treturn -EFAULT;\n+\treturn 0;\n }\n \n static int chsc_ioctl_conf_info(void __user *user_ci)\n {\n-\tstruct chsc_conf_info *ci;\n-\tint ret, ccode;\n+\tstruct chsc_conf_info *ci __free(kfree) = NULL;\n+\tint ccode;\n \tstruct {\n \t\tstruct chsc_header request;\n \t\tu32 : 2;\n@@ -623,20 +578,16 @@ static int chsc_ioctl_conf_info(void __user *user_ci)\n \t\tu64 : 64;\n \t\tstruct chsc_header response;\n \t\tu8 data[PAGE_SIZE - 20];\n-\t} __attribute__ ((packed)) *sci_area;\n+\t} __attribute__ ((packed)) *sci_area __free(kfree) = NULL;\n \n-\tsci_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tsci_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!sci_area)\n \t\treturn -ENOMEM;\n \tci = kzalloc_obj(*ci);\n-\tif (!ci) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out_free;\n-\t}\n-\tif (copy_from_user(ci, user_ci, sizeof(*ci))) {\n-\t\tret = -EFAULT;\n-\t\tgoto out_free;\n-\t}\n+\tif (!ci)\n+\t\treturn -ENOMEM;\n+\tif (copy_from_user(ci, user_ci, sizeof(*ci)))\n+\t\treturn -EFAULT;\n \tsci_area-\u003erequest.length = 0x0010;\n \tsci_area-\u003erequest.code = 0x0012;\n \tsci_area-\u003em = ci-\u003eid.m;\n@@ -645,31 +596,23 @@ static int chsc_ioctl_conf_info(void __user *user_ci)\n \tsci_area-\u003essid = ci-\u003eid.ssid;\n \n \tccode = chsc(sci_area);\n-\tif (ccode != 0) {\n-\t\tret = -EIO;\n-\t\tgoto out_free;\n-\t}\n+\tif (ccode != 0)\n+\t\treturn -EIO;\n \tif (sci_area-\u003eresponse.code != 0x0001) {\n-\t\tret = -EIO;\n \t\tCHSC_MSG(0, \"sci: response code=%x\\n\",\n \t\t\t sci_area-\u003eresponse.code);\n-\t\tgoto out_free;\n+\t\treturn -EIO;\n \t}\n \tmemcpy(\u0026ci-\u003escid, \u0026sci_area-\u003eresponse, sci_area-\u003eresponse.length);\n \tif (copy_to_user(user_ci, ci, sizeof(*ci)))\n-\t\tret = -EFAULT;\n-\telse\n-\t\tret = 0;\n-out_free:\n-\tkfree(ci);\n-\tfree_page((unsigned long)sci_area);\n-\treturn ret;\n+\t\treturn -EFAULT;\n+\treturn 0;\n }\n \n static int chsc_ioctl_conf_comp_list(void __user *user_ccl)\n {\n-\tstruct chsc_comp_list *ccl;\n-\tint ret, ccode;\n+\tstruct chsc_comp_list *ccl __free(kfree) = NULL;\n+\tint ccode;\n \tstruct {\n \t\tstruct chsc_header request;\n \t\tu32 ctype : 8;\n@@ -681,7 +624,7 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)\n \t\tu64 : 64;\n \t\tstruct chsc_header response;\n \t\tu8 data[PAGE_SIZE - 36];\n-\t} __attribute__ ((packed)) *sccl_area;\n+\t} __attribute__ ((packed)) *sccl_area __free(kfree) = NULL;\n \tstruct {\n \t\tu32 m : 1;\n \t\tu32 : 31;\n@@ -696,18 +639,14 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)\n \t\tu32 res;\n \t} __attribute__ ((packed)) *cssids_parm;\n \n-\tsccl_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tsccl_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!sccl_area)\n \t\treturn -ENOMEM;\n \tccl = kzalloc_obj(*ccl);\n-\tif (!ccl) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out_free;\n-\t}\n-\tif (copy_from_user(ccl, user_ccl, sizeof(*ccl))) {\n-\t\tret = -EFAULT;\n-\t\tgoto out_free;\n-\t}\n+\tif (!ccl)\n+\t\treturn -ENOMEM;\n+\tif (copy_from_user(ccl, user_ccl, sizeof(*ccl)))\n+\t\treturn -EFAULT;\n \tsccl_area-\u003erequest.length = 0x0020;\n \tsccl_area-\u003erequest.code = 0x0030;\n \tsccl_area-\u003efmt = ccl-\u003ereq.fmt;\n@@ -728,61 +667,46 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)\n \t\tbreak;\n \t}\n \tccode = chsc(sccl_area);\n-\tif (ccode != 0) {\n-\t\tret = -EIO;\n-\t\tgoto out_free;\n-\t}\n+\tif (ccode != 0)\n+\t\treturn -EIO;\n \tif (sccl_area-\u003eresponse.code != 0x0001) {\n-\t\tret = -EIO;\n \t\tCHSC_MSG(0, \"sccl: response code=%x\\n\",\n \t\t\t sccl_area-\u003eresponse.code);\n-\t\tgoto out_free;\n+\t\treturn -EIO;\n \t}\n \tmemcpy(\u0026ccl-\u003esccl, \u0026sccl_area-\u003eresponse, sccl_area-\u003eresponse.length);\n \tif (copy_to_user(user_ccl, ccl, sizeof(*ccl)))\n-\t\tret = -EFAULT;\n-\telse\n-\t\tret = 0;\n-out_free:\n-\tkfree(ccl);\n-\tfree_page((unsigned long)sccl_area);\n-\treturn ret;\n+\t\treturn -EFAULT;\n+\treturn 0;\n }\n \n static int chsc_ioctl_chpd(void __user *user_chpd)\n {\n-\tstruct chsc_scpd *scpd_area;\n-\tstruct chsc_cpd_info *chpd;\n+\tstruct chsc_scpd *scpd_area __free(kfree) = NULL;\n+\tstruct chsc_cpd_info *chpd __free(kfree) = NULL;\n \tint ret;\n \n \tchpd = kzalloc_obj(*chpd);\n-\tscpd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n-\tif (!scpd_area || !chpd) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out_free;\n-\t}\n-\tif (copy_from_user(chpd, user_chpd, sizeof(*chpd))) {\n-\t\tret = -EFAULT;\n-\t\tgoto out_free;\n-\t}\n+\tscpd_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n+\tif (!scpd_area || !chpd)\n+\t\treturn -ENOMEM;\n+\tif (copy_from_user(chpd, user_chpd, sizeof(*chpd)))\n+\t\treturn -EFAULT;\n \tret = chsc_determine_channel_path_desc(chpd-\u003echpid, chpd-\u003efmt,\n \t\t\t\t\t chpd-\u003erfmt, chpd-\u003ec, chpd-\u003em,\n \t\t\t\t\t scpd_area);\n \tif (ret)\n-\t\tgoto out_free;\n+\t\treturn ret;\n \tmemcpy(\u0026chpd-\u003echpdb, \u0026scpd_area-\u003eresponse, scpd_area-\u003eresponse.length);\n \tif (copy_to_user(user_chpd, chpd, sizeof(*chpd)))\n-\t\tret = -EFAULT;\n-out_free:\n-\tkfree(chpd);\n-\tfree_page((unsigned long)scpd_area);\n-\treturn ret;\n+\t\treturn -EFAULT;\n+\treturn 0;\n }\n \n static int chsc_ioctl_dcal(void __user *user_dcal)\n {\n-\tstruct chsc_dcal *dcal;\n-\tint ret, ccode;\n+\tstruct chsc_dcal *dcal __free(kfree) = NULL;\n+\tint ccode;\n \tstruct {\n \t\tstruct chsc_header request;\n \t\tu32 atype : 8;\n@@ -794,20 +718,16 @@ static int chsc_ioctl_dcal(void __user *user_dcal)\n \t\tu32 res1[2];\n \t\tstruct chsc_header response;\n \t\tu8 data[PAGE_SIZE - 36];\n-\t} __attribute__ ((packed)) *sdcal_area;\n+\t} __attribute__ ((packed)) *sdcal_area __free(kfree) = NULL;\n \n-\tsdcal_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tsdcal_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!sdcal_area)\n \t\treturn -ENOMEM;\n \tdcal = kzalloc_obj(*dcal);\n-\tif (!dcal) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out_free;\n-\t}\n-\tif (copy_from_user(dcal, user_dcal, sizeof(*dcal))) {\n-\t\tret = -EFAULT;\n-\t\tgoto out_free;\n-\t}\n+\tif (!dcal)\n+\t\treturn -ENOMEM;\n+\tif (copy_from_user(dcal, user_dcal, sizeof(*dcal)))\n+\t\treturn -EFAULT;\n \tsdcal_area-\u003erequest.length = 0x0020;\n \tsdcal_area-\u003erequest.code = 0x0034;\n \tsdcal_area-\u003eatype = dcal-\u003ereq.atype;\n@@ -816,26 +736,18 @@ static int chsc_ioctl_dcal(void __user *user_dcal)\n \t sizeof(sdcal_area-\u003elist_parm));\n \n \tccode = chsc(sdcal_area);\n-\tif (ccode != 0) {\n-\t\tret = -EIO;\n-\t\tgoto out_free;\n-\t}\n+\tif (ccode != 0)\n+\t\treturn -EIO;\n \tif (sdcal_area-\u003eresponse.code != 0x0001) {\n-\t\tret = -EIO;\n \t\tCHSC_MSG(0, \"sdcal: response code=%x\\n\",\n \t\t\t sdcal_area-\u003eresponse.code);\n-\t\tgoto out_free;\n+\t\treturn -EIO;\n \t}\n \tmemcpy(\u0026dcal-\u003esdcal, \u0026sdcal_area-\u003eresponse,\n \t sdcal_area-\u003eresponse.length);\n \tif (copy_to_user(user_dcal, dcal, sizeof(*dcal)))\n-\t\tret = -EFAULT;\n-\telse\n-\t\tret = 0;\n-out_free:\n-\tkfree(dcal);\n-\tfree_page((unsigned long)sdcal_area);\n-\treturn ret;\n+\t\treturn -EFAULT;\n+\treturn 0;\n }\n \n static long chsc_ioctl(struct file *filp, unsigned int cmd,\n@@ -904,7 +816,7 @@ static int chsc_release(struct inode *inode, struct file *filp)\n \t}\n \tsnprintf(dbf, sizeof(dbf), \"relret:%d\", ret);\n \tCHSC_LOG(0, dbf);\n-\tfree_page((unsigned long)on_close_chsc_area);\n+\tkfree(on_close_chsc_area);\n \ton_close_chsc_area = NULL;\n \tkfree(on_close_request);\n \ton_close_request = NULL;\ndiff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c\nindex 92ab3d546fe47..8fd41a7dfc20b 100644\n--- a/drivers/s390/cio/cmf.c\n+++ b/drivers/s390/cio/cmf.c\n@@ -482,6 +482,9 @@ static int alloc_cmb(struct ccw_device *cdev)\n \tssize_t size;\n \tstruct cmb_data *cmb_data;\n \n+\tif (cmb_area.num_channels \u003c= 0)\n+\t\treturn -ENOMEM;\n+\n \t/* Allocate private cmb_data. */\n \tcmb_data = kzalloc_obj(struct cmb_data);\n \tif (!cmb_data)\n@@ -501,12 +504,12 @@ static int alloc_cmb(struct ccw_device *cdev)\n \t\tWARN_ON(!list_empty(\u0026cmb_area.list));\n \n \t\tspin_unlock(\u0026cmb_area.lock);\n-\t\tmem = (void *)__get_free_pages(GFP_KERNEL, get_order(size));\n+\t\tmem = kmalloc(size, GFP_KERNEL);\n \t\tspin_lock(\u0026cmb_area.lock);\n \n \t\tif (cmb_area.mem) {\n \t\t\t/* ok, another thread was faster */\n-\t\t\tfree_pages((unsigned long)mem, get_order(size));\n+\t\t\tkfree(mem);\n \t\t} else if (!mem) {\n \t\t\t/* no luck */\n \t\t\tret = -ENOMEM;\n@@ -547,10 +550,8 @@ static void free_cmb(struct ccw_device *cdev)\n \tlist_del_init(\u0026priv-\u003ecmb_list);\n \n \tif (list_empty(\u0026cmb_area.list)) {\n-\t\tssize_t size;\n-\t\tsize = sizeof(struct cmb) * cmb_area.num_channels;\n \t\tcmf_activate(NULL, CMF_OFF);\n-\t\tfree_pages((unsigned long)cmb_area.mem, get_order(size));\n+\t\tkfree(cmb_area.mem);\n \t\tcmb_area.mem = NULL;\n \t}\n \tspin_unlock_irq(cdev-\u003eccwlock);\ndiff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h\nindex 4bd4c00c9c0ca..dff5f53a8795d 100644\n--- a/drivers/s390/cio/qdio.h\n+++ b/drivers/s390/cio/qdio.h\n@@ -244,7 +244,7 @@ struct qdio_irq {\n \tint perf_stat_enabled;\n \n \tstruct qdr *qdr;\n-\tunsigned long chsc_page;\n+\tvoid *chsc_page;\n \n \tstruct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ];\n \tstruct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ];\ndiff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c\nindex c1e09fa34e774..889f63f94a4a7 100644\n--- a/drivers/s390/cio/qdio_main.c\n+++ b/drivers/s390/cio/qdio_main.c\n@@ -12,11 +12,11 @@\n #include \u003clinux/module.h\u003e\n #include \u003clinux/init.h\u003e\n #include \u003clinux/kernel.h\u003e\n-#include \u003clinux/kmemleak.h\u003e\n #include \u003clinux/delay.h\u003e\n #include \u003clinux/gfp.h\u003e\n #include \u003clinux/io.h\u003e\n #include \u003clinux/atomic.h\u003e\n+#include \u003clinux/slab.h\u003e\n #include \u003casm/debug.h\u003e\n #include \u003casm/qdio.h\u003e\n #include \u003casm/asm.h\u003e\n@@ -933,10 +933,10 @@ int qdio_free(struct ccw_device *cdev)\n \tmutex_unlock(\u0026irq_ptr-\u003esetup_mutex);\n \n \tqdio_free_queues(irq_ptr);\n-\tfree_page((unsigned long) irq_ptr-\u003eqdr);\n-\tfree_page(irq_ptr-\u003echsc_page);\n+\tkfree(irq_ptr-\u003eqdr);\n+\tkfree(irq_ptr-\u003echsc_page);\n \tkfree(irq_ptr-\u003eccw);\n-\tfree_page((unsigned long) irq_ptr);\n+\tkfree(irq_ptr);\n \treturn 0;\n }\n EXPORT_SYMBOL_GPL(qdio_free);\n@@ -961,7 +961,7 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs,\n \t no_output_qs \u003e QDIO_MAX_QUEUES_PER_IRQ)\n \t\treturn -EINVAL;\n \n-\tirq_ptr = (void *) get_zeroed_page(GFP_KERNEL);\n+\tirq_ptr = kzalloc(PAGE_SIZE, GFP_KERNEL);\n \tif (!irq_ptr)\n \t\treturn -ENOMEM;\n \n@@ -969,9 +969,6 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs,\n \tif (!irq_ptr-\u003eccw)\n \t\tgoto err_ccw;\n \n-\t/* kmemleak doesn't scan the page-allocated irq_ptr: */\n-\tkmemleak_not_leak(irq_ptr-\u003eccw);\n-\n \tirq_ptr-\u003ecdev = cdev;\n \tmutex_init(\u0026irq_ptr-\u003esetup_mutex);\n \tif (qdio_allocate_dbf(irq_ptr))\n@@ -986,12 +983,12 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs,\n \t * qdio_establish. In case of low memory and swap on a zfcp disk\n \t * we may not be able to allocate memory otherwise.\n \t */\n-\tirq_ptr-\u003echsc_page = get_zeroed_page(GFP_KERNEL);\n+\tirq_ptr-\u003echsc_page = kzalloc(PAGE_SIZE, GFP_KERNEL);\n \tif (!irq_ptr-\u003echsc_page)\n \t\tgoto err_chsc;\n \n \t/* qdr is used in ccw1.cda which is u32 */\n-\tirq_ptr-\u003eqdr = (struct qdr *) get_zeroed_page(GFP_KERNEL | GFP_DMA);\n+\tirq_ptr-\u003eqdr = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!irq_ptr-\u003eqdr)\n \t\tgoto err_qdr;\n \n@@ -1004,14 +1001,14 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs,\n \treturn 0;\n \n err_queues:\n-\tfree_page((unsigned long) irq_ptr-\u003eqdr);\n+\tkfree(irq_ptr-\u003eqdr);\n err_qdr:\n-\tfree_page(irq_ptr-\u003echsc_page);\n+\tkfree(irq_ptr-\u003echsc_page);\n err_chsc:\n err_dbf:\n \tkfree(irq_ptr-\u003eccw);\n err_ccw:\n-\tfree_page((unsigned long) irq_ptr);\n+\tkfree(irq_ptr);\n \treturn rc;\n }\n EXPORT_SYMBOL_GPL(qdio_allocate);\ndiff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c\nindex ea09aadaae4ec..c0215a7d29a81 100644\n--- a/drivers/s390/cio/qdio_setup.c\n+++ b/drivers/s390/cio/qdio_setup.c\n@@ -35,7 +35,7 @@ void qdio_free_buffers(struct qdio_buffer **buf, unsigned int count)\n \tint pos;\n \n \tfor (pos = 0; pos \u003c count; pos += QBUFF_PER_PAGE)\n-\t\tfree_page((unsigned long) buf[pos]);\n+\t\tkfree(buf[pos]);\n }\n EXPORT_SYMBOL_GPL(qdio_free_buffers);\n \n@@ -49,7 +49,7 @@ int qdio_alloc_buffers(struct qdio_buffer **buf, unsigned int count)\n \tint pos;\n \n \tfor (pos = 0; pos \u003c count; pos += QBUFF_PER_PAGE) {\n-\t\tbuf[pos] = (void *) get_zeroed_page(GFP_KERNEL);\n+\t\tbuf[pos] = kzalloc(PAGE_SIZE, GFP_KERNEL);\n \t\tif (!buf[pos]) {\n \t\t\tqdio_free_buffers(buf, count);\n \t\t\treturn -ENOMEM;\n@@ -83,7 +83,7 @@ static void __qdio_free_queues(struct qdio_q **queues, unsigned int count)\n \n \tfor (i = 0; i \u003c count; i++) {\n \t\tq = queues[i];\n-\t\tfree_page((unsigned long)q-\u003esl_page);\n+\t\tkfree(q-\u003esl_page);\n \t\tkmem_cache_free(qdio_q_cache, q);\n \t}\n }\n@@ -109,7 +109,7 @@ static int __qdio_allocate_qs(struct qdio_q **irq_ptr_qs, int nr_queues)\n \t\t\treturn -ENOMEM;\n \t\t}\n \n-\t\tq-\u003esl_page = (void *)__get_free_page(GFP_KERNEL);\n+\t\tq-\u003esl_page = kzalloc(PAGE_SIZE, GFP_KERNEL);\n \t\tif (!q-\u003esl_page) {\n \t\t\tkmem_cache_free(qdio_q_cache, q);\n \t\t\t__qdio_free_queues(irq_ptr_qs, i);\n@@ -249,11 +249,11 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,\n \n \tDBF_EVENT(\"getssqd:%4x\", schid-\u003esch_no);\n \tif (!irq_ptr) {\n-\t\tssqd = (struct chsc_ssqd_area *)__get_free_page(GFP_KERNEL);\n+\t\tssqd = kzalloc(PAGE_SIZE, GFP_KERNEL);\n \t\tif (!ssqd)\n \t\t\treturn -ENOMEM;\n \t} else {\n-\t\tssqd = (struct chsc_ssqd_area *)irq_ptr-\u003echsc_page;\n+\t\tssqd = irq_ptr-\u003echsc_page;\n \t}\n \n \trc = chsc_ssqd(*schid, ssqd);\n@@ -270,7 +270,7 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,\n \n out:\n \tif (!irq_ptr)\n-\t\tfree_page((unsigned long)ssqd);\n+\t\tkfree(ssqd);\n \n \treturn rc;\n }\ndiff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c\nindex e167aa75c3dff..a2ff51887537f 100644\n--- a/drivers/s390/cio/qdio_thinint.c\n+++ b/drivers/s390/cio/qdio_thinint.c\n@@ -136,7 +136,7 @@ static struct airq_struct tiqdio_airq = {\n \n static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset)\n {\n-\tstruct chsc_scssc_area *scssc = (void *)irq_ptr-\u003echsc_page;\n+\tstruct chsc_scssc_area *scssc = irq_ptr-\u003echsc_page;\n \tdma64_t summary_indicator_addr, subchannel_indicator_addr;\n \tint rc;\n \ndiff --git a/drivers/s390/cio/scm.c b/drivers/s390/cio/scm.c\nindex 171212a6d2d9c..b79fe023ab8d1 100644\n--- a/drivers/s390/cio/scm.c\n+++ b/drivers/s390/cio/scm.c\n@@ -13,6 +13,7 @@\n #include \u003clinux/slab.h\u003e\n #include \u003clinux/init.h\u003e\n #include \u003clinux/err.h\u003e\n+#include \u003clinux/cleanup.h\u003e\n #include \u003casm/eadm.h\u003e\n #include \"chsc.h\"\n \n@@ -224,12 +225,12 @@ static int scm_add(struct chsc_scm_info *scm_info, size_t num)\n \n int scm_update_information(void)\n {\n-\tstruct chsc_scm_info *scm_info;\n+\tstruct chsc_scm_info *scm_info __free(kfree) = NULL;\n \tu64 token = 0;\n \tsize_t num;\n \tint ret;\n \n-\tscm_info = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);\n+\tscm_info = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);\n \tif (!scm_info)\n \t\treturn -ENOMEM;\n \n@@ -250,8 +251,6 @@ int scm_update_information(void)\n \t\ttoken = scm_info-\u003erestok;\n \t} while (token);\n \n-\tfree_page((unsigned long)scm_info);\n-\n \treturn ret;\n }\n \n"
} |
| 2/1 | 2026/09/10 13:19 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "All modified files are located in arch/s390/ and drivers/s390/cio/, which are exclusive to the s390 architecture (CONFIG_S390) and not compiled or reachable on the target architecture (amd64).",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 589de605e43b316ce04ab692923c053bde6880de
Author: syz-cluster <triage@syzkaller.com>
Date: Thu Sep 10 13:19:35 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h
index 06e1ec2afd5af..213f430a8d33a 100644
--- a/arch/s390/include/asm/idals.h
+++ b/arch/s390/include/asm/idals.h
@@ -18,6 +18,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
+#include <linux/kmemleak.h>
#include <asm/dma-types.h>
#include <asm/cio.h>
@@ -147,9 +148,11 @@ static inline struct idal_buffer *idal_buffer_alloc(size_t size, int page_order)
ib->data[i] = dma64_add(ib->data[i - 1], IDA_BLOCK_SIZE);
continue;
}
- vaddr = (void *)__get_free_pages(GFP_KERNEL, page_order);
+ vaddr = kmalloc(PAGE_SIZE << page_order, GFP_KERNEL);
if (!vaddr)
goto error;
+ /* Only DMA addresses are retained in ib->data. */
+ kmemleak_ignore(vaddr);
ib->data[i] = virt_to_dma64(vaddr);
}
return ib;
@@ -157,7 +160,7 @@ static inline struct idal_buffer *idal_buffer_alloc(size_t size, int page_order)
while (i >= nr_chunks) {
i -= nr_chunks;
vaddr = dma64_to_virt(ib->data[i]);
- free_pages((unsigned long)vaddr, ib->page_order);
+ kfree(vaddr);
}
kfree(ib);
return ERR_PTR(-ENOMEM);
@@ -175,7 +178,7 @@ static inline void idal_buffer_free(struct idal_buffer *ib)
nr_chunks = (PAGE_SIZE << ib->page_order) >> IDA_SIZE_SHIFT;
for (i = 0; i < nr_ptrs; i += nr_chunks) {
vaddr = dma64_to_virt(ib->data[i]);
- free_pages((unsigned long)vaddr, ib->page_order);
+ kfree(vaddr);
}
kfree(ib);
}
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 9689f722c863c..d98f629e89295 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -931,12 +931,12 @@ static int cub_alloc(struct channel_subsystem *css)
int i;
for (i = 0; i < CSS_NUM_CUB_PAGES; i++) {
- css->cub[i] = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ css->cub[i] = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!css->cub[i])
return -ENOMEM;
}
for (i = 0; i < CSS_NUM_ECUB_PAGES; i++) {
- css->ecub[i] = (void *)get_zeroed_page(GFP_KERNEL);
+ css->ecub[i] = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!css->ecub[i])
return -ENOMEM;
}
@@ -949,11 +949,11 @@ static void cub_free(struct channel_subsystem *css)
int i;
for (i = 0; i < CSS_NUM_CUB_PAGES; i++) {
- free_page((unsigned long)css->cub[i]);
+ kfree(css->cub[i]);
css->cub[i] = NULL;
}
for (i = 0; i < CSS_NUM_ECUB_PAGES; i++) {
- free_page((unsigned long)css->ecub[i]);
+ kfree(css->ecub[i]);
css->ecub[i] = NULL;
}
}
@@ -1142,8 +1142,8 @@ int __init chsc_init(void)
{
int ret;
- sei_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
- chsc_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ sei_page = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
+ chsc_page = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!sei_page || !chsc_page) {
ret = -ENOMEM;
goto out_err;
@@ -1153,16 +1153,16 @@ int __init chsc_init(void)
goto out_err;
return ret;
out_err:
- free_page((unsigned long)chsc_page);
- free_page((unsigned long)sei_page);
+ kfree(chsc_page);
+ kfree(sei_page);
return ret;
}
void __init chsc_init_cleanup(void)
{
crw_unregister_handler(CRW_RSC_CSS);
- free_page((unsigned long)chsc_page);
- free_page((unsigned long)sei_page);
+ kfree(chsc_page);
+ kfree(sei_page);
}
int __chsc_enable_facility(struct chsc_sda_area *sda_area, int operation_code)
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index b6cb8bb8bcc4b..225aaac7dd309 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -15,6 +15,7 @@
#include <linux/uaccess.h>
#include <linux/miscdevice.h>
#include <linux/kernel_stat.h>
+#include <linux/cleanup.h>
#include <asm/cio.h>
#include <asm/chsc.h>
@@ -292,7 +293,7 @@ static int chsc_ioctl_start(void __user *user_area)
if (!css_general_characteristics.dynio)
/* It makes no sense to try. */
return -EOPNOTSUPP;
- chsc_area = (void *)get_zeroed_page(GFP_DMA | GFP_KERNEL);
+ chsc_area = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);
if (!chsc_area)
return -ENOMEM;
request = kzalloc_obj(*request);
@@ -321,7 +322,7 @@ static int chsc_ioctl_start(void __user *user_area)
snprintf(dbf, sizeof(dbf), "ret:%d", ret);
CHSC_LOG(0, dbf);
kfree(request);
- free_page((unsigned long)chsc_area);
+ kfree(chsc_area);
return ret;
}
@@ -340,7 +341,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area)
ret = -ENOMEM;
goto out_unlock;
}
- on_close_chsc_area = (void *)get_zeroed_page(GFP_DMA | GFP_KERNEL);
+ on_close_chsc_area = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);
if (!on_close_chsc_area) {
ret = -ENOMEM;
goto out_free_request;
@@ -353,7 +354,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area)
goto out_unlock;
out_free_chsc:
- free_page((unsigned long)on_close_chsc_area);
+ kfree(on_close_chsc_area);
on_close_chsc_area = NULL;
out_free_request:
kfree(on_close_request);
@@ -375,7 +376,7 @@ static int chsc_ioctl_on_close_remove(void)
ret = -ENOENT;
goto out_unlock;
}
- free_page((unsigned long)on_close_chsc_area);
+ kfree(on_close_chsc_area);
on_close_chsc_area = NULL;
kfree(on_close_request);
on_close_request = NULL;
@@ -389,39 +390,29 @@ static int chsc_ioctl_on_close_remove(void)
static int chsc_ioctl_start_sync(void __user *user_area)
{
- struct chsc_sync_area *chsc_area;
- int ret, ccode;
+ struct chsc_sync_area *chsc_area __free(kfree) = NULL;
+ int ccode;
- chsc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ chsc_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!chsc_area)
return -ENOMEM;
- if (copy_from_user(chsc_area, user_area, PAGE_SIZE)) {
- ret = -EFAULT;
- goto out_free;
- }
- if (chsc_area->header.code & 0x4000) {
- ret = -EINVAL;
- goto out_free;
- }
+ if (copy_from_user(chsc_area, user_area, PAGE_SIZE))
+ return -EFAULT;
+ if (chsc_area->header.code & 0x4000)
+ return -EINVAL;
chsc_log_command(chsc_area);
ccode = chsc(chsc_area);
- if (ccode != 0) {
- ret = -EIO;
- goto out_free;
- }
+ if (ccode != 0)
+ return -EIO;
if (copy_to_user(user_area, chsc_area, PAGE_SIZE))
- ret = -EFAULT;
- else
- ret = 0;
-out_free:
- free_page((unsigned long)chsc_area);
- return ret;
+ return -EFAULT;
+ return 0;
}
static int chsc_ioctl_info_channel_path(void __user *user_cd)
{
- struct chsc_chp_cd *cd;
- int ret, ccode;
+ struct chsc_chp_cd *cd __free(kfree) = NULL;
+ int ccode;
struct {
struct chsc_header request;
u32 : 2;
@@ -436,20 +427,16 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd)
u32 : 32;
struct chsc_header response;
u8 data[PAGE_SIZE - 20];
- } __attribute__ ((packed)) *scpcd_area;
+ } __attribute__ ((packed)) *scpcd_area __free(kfree) = NULL;
- scpcd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ scpcd_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!scpcd_area)
return -ENOMEM;
cd = kzalloc_obj(*cd);
- if (!cd) {
- ret = -ENOMEM;
- goto out_free;
- }
- if (copy_from_user(cd, user_cd, sizeof(*cd))) {
- ret = -EFAULT;
- goto out_free;
- }
+ if (!cd)
+ return -ENOMEM;
+ if (copy_from_user(cd, user_cd, sizeof(*cd)))
+ return -EFAULT;
scpcd_area->request.length = 0x0010;
scpcd_area->request.code = 0x0028;
scpcd_area->m = cd->m;
@@ -459,31 +446,23 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd)
scpcd_area->last_chpid = cd->chpid.id;
ccode = chsc(scpcd_area);
- if (ccode != 0) {
- ret = -EIO;
- goto out_free;
- }
+ if (ccode != 0)
+ return -EIO;
if (scpcd_area->response.code != 0x0001) {
- ret = -EIO;
CHSC_MSG(0, "scpcd: response code=%x\n",
scpcd_area->response.code);
- goto out_free;
+ return -EIO;
}
memcpy(&cd->cpcb, &scpcd_area->response, scpcd_area->response.length);
if (copy_to_user(user_cd, cd, sizeof(*cd)))
- ret = -EFAULT;
- else
- ret = 0;
-out_free:
- kfree(cd);
- free_page((unsigned long)scpcd_area);
- return ret;
+ return -EFAULT;
+ return 0;
}
static int chsc_ioctl_info_cu(void __user *user_cd)
{
- struct chsc_cu_cd *cd;
- int ret, ccode;
+ struct chsc_cu_cd *cd __free(kfree) = NULL;
+ int ccode;
struct {
struct chsc_header request;
u32 : 2;
@@ -498,20 +477,16 @@ static int chsc_ioctl_info_cu(void __user *user_cd)
u32 : 32;
struct chsc_header response;
u8 data[PAGE_SIZE - 20];
- } __attribute__ ((packed)) *scucd_area;
+ } __attribute__ ((packed)) *scucd_area __free(kfree) = NULL;
- scucd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ scucd_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!scucd_area)
return -ENOMEM;
cd = kzalloc_obj(*cd);
- if (!cd) {
- ret = -ENOMEM;
- goto out_free;
- }
- if (copy_from_user(cd, user_cd, sizeof(*cd))) {
- ret = -EFAULT;
- goto out_free;
- }
+ if (!cd)
+ return -ENOMEM;
+ if (copy_from_user(cd, user_cd, sizeof(*cd)))
+ return -EFAULT;
scucd_area->request.length = 0x0010;
scucd_area->request.code = 0x0026;
scucd_area->m = cd->m;
@@ -521,31 +496,23 @@ static int chsc_ioctl_info_cu(void __user *user_cd)
scucd_area->last_cun = cd->cun;
ccode = chsc(scucd_area);
- if (ccode != 0) {
- ret = -EIO;
- goto out_free;
- }
+ if (ccode != 0)
+ return -EIO;
if (scucd_area->response.code != 0x0001) {
- ret = -EIO;
CHSC_MSG(0, "scucd: response code=%x\n",
scucd_area->response.code);
- goto out_free;
+ return -EIO;
}
memcpy(&cd->cucb, &scucd_area->response, scucd_area->response.length);
if (copy_to_user(user_cd, cd, sizeof(*cd)))
- ret = -EFAULT;
- else
- ret = 0;
-out_free:
- kfree(cd);
- free_page((unsigned long)scucd_area);
- return ret;
+ return -EFAULT;
+ return 0;
}
static int chsc_ioctl_info_sch_cu(void __user *user_cud)
{
- struct chsc_sch_cud *cud;
- int ret, ccode;
+ struct chsc_sch_cud *cud __free(kfree) = NULL;
+ int ccode;
struct {
struct chsc_header request;
u32 : 2;
@@ -561,20 +528,16 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud)
u32 : 32;
struct chsc_header response;
u8 data[PAGE_SIZE - 20];
- } __attribute__ ((packed)) *sscud_area;
+ } __attribute__ ((packed)) *sscud_area __free(kfree) = NULL;
- sscud_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ sscud_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!sscud_area)
return -ENOMEM;
cud = kzalloc_obj(*cud);
- if (!cud) {
- ret = -ENOMEM;
- goto out_free;
- }
- if (copy_from_user(cud, user_cud, sizeof(*cud))) {
- ret = -EFAULT;
- goto out_free;
- }
+ if (!cud)
+ return -ENOMEM;
+ if (copy_from_user(cud, user_cud, sizeof(*cud)))
+ return -EFAULT;
sscud_area->request.length = 0x0010;
sscud_area->request.code = 0x0006;
sscud_area->m = cud->schid.m;
@@ -585,31 +548,23 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud)
sscud_area->last_sch = cud->schid.sch_no;
ccode = chsc(sscud_area);
- if (ccode != 0) {
- ret = -EIO;
- goto out_free;
- }
+ if (ccode != 0)
+ return -EIO;
if (sscud_area->response.code != 0x0001) {
- ret = -EIO;
CHSC_MSG(0, "sscud: response code=%x\n",
sscud_area->response.code);
- goto out_free;
+ return -EIO;
}
memcpy(&cud->scub, &sscud_area->response, sscud_area->response.length);
if (copy_to_user(user_cud, cud, sizeof(*cud)))
- ret = -EFAULT;
- else
- ret = 0;
-out_free:
- kfree(cud);
- free_page((unsigned long)sscud_area);
- return ret;
+ return -EFAULT;
+ return 0;
}
static int chsc_ioctl_conf_info(void __user *user_ci)
{
- struct chsc_conf_info *ci;
- int ret, ccode;
+ struct chsc_conf_info *ci __free(kfree) = NULL;
+ int ccode;
struct {
struct chsc_header request;
u32 : 2;
@@ -623,20 +578,16 @@ static int chsc_ioctl_conf_info(void __user *user_ci)
u64 : 64;
struct chsc_header response;
u8 data[PAGE_SIZE - 20];
- } __attribute__ ((packed)) *sci_area;
+ } __attribute__ ((packed)) *sci_area __free(kfree) = NULL;
- sci_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ sci_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!sci_area)
return -ENOMEM;
ci = kzalloc_obj(*ci);
- if (!ci) {
- ret = -ENOMEM;
- goto out_free;
- }
- if (copy_from_user(ci, user_ci, sizeof(*ci))) {
- ret = -EFAULT;
- goto out_free;
- }
+ if (!ci)
+ return -ENOMEM;
+ if (copy_from_user(ci, user_ci, sizeof(*ci)))
+ return -EFAULT;
sci_area->request.length = 0x0010;
sci_area->request.code = 0x0012;
sci_area->m = ci->id.m;
@@ -645,31 +596,23 @@ static int chsc_ioctl_conf_info(void __user *user_ci)
sci_area->ssid = ci->id.ssid;
ccode = chsc(sci_area);
- if (ccode != 0) {
- ret = -EIO;
- goto out_free;
- }
+ if (ccode != 0)
+ return -EIO;
if (sci_area->response.code != 0x0001) {
- ret = -EIO;
CHSC_MSG(0, "sci: response code=%x\n",
sci_area->response.code);
- goto out_free;
+ return -EIO;
}
memcpy(&ci->scid, &sci_area->response, sci_area->response.length);
if (copy_to_user(user_ci, ci, sizeof(*ci)))
- ret = -EFAULT;
- else
- ret = 0;
-out_free:
- kfree(ci);
- free_page((unsigned long)sci_area);
- return ret;
+ return -EFAULT;
+ return 0;
}
static int chsc_ioctl_conf_comp_list(void __user *user_ccl)
{
- struct chsc_comp_list *ccl;
- int ret, ccode;
+ struct chsc_comp_list *ccl __free(kfree) = NULL;
+ int ccode;
struct {
struct chsc_header request;
u32 ctype : 8;
@@ -681,7 +624,7 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)
u64 : 64;
struct chsc_header response;
u8 data[PAGE_SIZE - 36];
- } __attribute__ ((packed)) *sccl_area;
+ } __attribute__ ((packed)) *sccl_area __free(kfree) = NULL;
struct {
u32 m : 1;
u32 : 31;
@@ -696,18 +639,14 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)
u32 res;
} __attribute__ ((packed)) *cssids_parm;
- sccl_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ sccl_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!sccl_area)
return -ENOMEM;
ccl = kzalloc_obj(*ccl);
- if (!ccl) {
- ret = -ENOMEM;
- goto out_free;
- }
- if (copy_from_user(ccl, user_ccl, sizeof(*ccl))) {
- ret = -EFAULT;
- goto out_free;
- }
+ if (!ccl)
+ return -ENOMEM;
+ if (copy_from_user(ccl, user_ccl, sizeof(*ccl)))
+ return -EFAULT;
sccl_area->request.length = 0x0020;
sccl_area->request.code = 0x0030;
sccl_area->fmt = ccl->req.fmt;
@@ -728,61 +667,46 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)
break;
}
ccode = chsc(sccl_area);
- if (ccode != 0) {
- ret = -EIO;
- goto out_free;
- }
+ if (ccode != 0)
+ return -EIO;
if (sccl_area->response.code != 0x0001) {
- ret = -EIO;
CHSC_MSG(0, "sccl: response code=%x\n",
sccl_area->response.code);
- goto out_free;
+ return -EIO;
}
memcpy(&ccl->sccl, &sccl_area->response, sccl_area->response.length);
if (copy_to_user(user_ccl, ccl, sizeof(*ccl)))
- ret = -EFAULT;
- else
- ret = 0;
-out_free:
- kfree(ccl);
- free_page((unsigned long)sccl_area);
- return ret;
+ return -EFAULT;
+ return 0;
}
static int chsc_ioctl_chpd(void __user *user_chpd)
{
- struct chsc_scpd *scpd_area;
- struct chsc_cpd_info *chpd;
+ struct chsc_scpd *scpd_area __free(kfree) = NULL;
+ struct chsc_cpd_info *chpd __free(kfree) = NULL;
int ret;
chpd = kzalloc_obj(*chpd);
- scpd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
- if (!scpd_area || !chpd) {
- ret = -ENOMEM;
- goto out_free;
- }
- if (copy_from_user(chpd, user_chpd, sizeof(*chpd))) {
- ret = -EFAULT;
- goto out_free;
- }
+ scpd_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
+ if (!scpd_area || !chpd)
+ return -ENOMEM;
+ if (copy_from_user(chpd, user_chpd, sizeof(*chpd)))
+ return -EFAULT;
ret = chsc_determine_channel_path_desc(chpd->chpid, chpd->fmt,
chpd->rfmt, chpd->c, chpd->m,
scpd_area);
if (ret)
- goto out_free;
+ return ret;
memcpy(&chpd->chpdb, &scpd_area->response, scpd_area->response.length);
if (copy_to_user(user_chpd, chpd, sizeof(*chpd)))
- ret = -EFAULT;
-out_free:
- kfree(chpd);
- free_page((unsigned long)scpd_area);
- return ret;
+ return -EFAULT;
+ return 0;
}
static int chsc_ioctl_dcal(void __user *user_dcal)
{
- struct chsc_dcal *dcal;
- int ret, ccode;
+ struct chsc_dcal *dcal __free(kfree) = NULL;
+ int ccode;
struct {
struct chsc_header request;
u32 atype : 8;
@@ -794,20 +718,16 @@ static int chsc_ioctl_dcal(void __user *user_dcal)
u32 res1[2];
struct chsc_header response;
u8 data[PAGE_SIZE - 36];
- } __attribute__ ((packed)) *sdcal_area;
+ } __attribute__ ((packed)) *sdcal_area __free(kfree) = NULL;
- sdcal_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ sdcal_area = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!sdcal_area)
return -ENOMEM;
dcal = kzalloc_obj(*dcal);
- if (!dcal) {
- ret = -ENOMEM;
- goto out_free;
- }
- if (copy_from_user(dcal, user_dcal, sizeof(*dcal))) {
- ret = -EFAULT;
- goto out_free;
- }
+ if (!dcal)
+ return -ENOMEM;
+ if (copy_from_user(dcal, user_dcal, sizeof(*dcal)))
+ return -EFAULT;
sdcal_area->request.length = 0x0020;
sdcal_area->request.code = 0x0034;
sdcal_area->atype = dcal->req.atype;
@@ -816,26 +736,18 @@ static int chsc_ioctl_dcal(void __user *user_dcal)
sizeof(sdcal_area->list_parm));
ccode = chsc(sdcal_area);
- if (ccode != 0) {
- ret = -EIO;
- goto out_free;
- }
+ if (ccode != 0)
+ return -EIO;
if (sdcal_area->response.code != 0x0001) {
- ret = -EIO;
CHSC_MSG(0, "sdcal: response code=%x\n",
sdcal_area->response.code);
- goto out_free;
+ return -EIO;
}
memcpy(&dcal->sdcal, &sdcal_area->response,
sdcal_area->response.length);
if (copy_to_user(user_dcal, dcal, sizeof(*dcal)))
- ret = -EFAULT;
- else
- ret = 0;
-out_free:
- kfree(dcal);
- free_page((unsigned long)sdcal_area);
- return ret;
+ return -EFAULT;
+ return 0;
}
static long chsc_ioctl(struct file *filp, unsigned int cmd,
@@ -904,7 +816,7 @@ static int chsc_release(struct inode *inode, struct file *filp)
}
snprintf(dbf, sizeof(dbf), "relret:%d", ret);
CHSC_LOG(0, dbf);
- free_page((unsigned long)on_close_chsc_area);
+ kfree(on_close_chsc_area);
on_close_chsc_area = NULL;
kfree(on_close_request);
on_close_request = NULL;
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index 92ab3d546fe47..8fd41a7dfc20b 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -482,6 +482,9 @@ static int alloc_cmb(struct ccw_device *cdev)
ssize_t size;
struct cmb_data *cmb_data;
+ if (cmb_area.num_channels <= 0)
+ return -ENOMEM;
+
/* Allocate private cmb_data. */
cmb_data = kzalloc_obj(struct cmb_data);
if (!cmb_data)
@@ -501,12 +504,12 @@ static int alloc_cmb(struct ccw_device *cdev)
WARN_ON(!list_empty(&cmb_area.list));
spin_unlock(&cmb_area.lock);
- mem = (void *)__get_free_pages(GFP_KERNEL, get_order(size));
+ mem = kmalloc(size, GFP_KERNEL);
spin_lock(&cmb_area.lock);
if (cmb_area.mem) {
/* ok, another thread was faster */
- free_pages((unsigned long)mem, get_order(size));
+ kfree(mem);
} else if (!mem) {
/* no luck */
ret = -ENOMEM;
@@ -547,10 +550,8 @@ static void free_cmb(struct ccw_device *cdev)
list_del_init(&priv->cmb_list);
if (list_empty(&cmb_area.list)) {
- ssize_t size;
- size = sizeof(struct cmb) * cmb_area.num_channels;
cmf_activate(NULL, CMF_OFF);
- free_pages((unsigned long)cmb_area.mem, get_order(size));
+ kfree(cmb_area.mem);
cmb_area.mem = NULL;
}
spin_unlock_irq(cdev->ccwlock);
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 4bd4c00c9c0ca..dff5f53a8795d 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -244,7 +244,7 @@ struct qdio_irq {
int perf_stat_enabled;
struct qdr *qdr;
- unsigned long chsc_page;
+ void *chsc_page;
struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ];
struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ];
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index c1e09fa34e774..889f63f94a4a7 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -12,11 +12,11 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
-#include <linux/kmemleak.h>
#include <linux/delay.h>
#include <linux/gfp.h>
#include <linux/io.h>
#include <linux/atomic.h>
+#include <linux/slab.h>
#include <asm/debug.h>
#include <asm/qdio.h>
#include <asm/asm.h>
@@ -933,10 +933,10 @@ int qdio_free(struct ccw_device *cdev)
mutex_unlock(&irq_ptr->setup_mutex);
qdio_free_queues(irq_ptr);
- free_page((unsigned long) irq_ptr->qdr);
- free_page(irq_ptr->chsc_page);
+ kfree(irq_ptr->qdr);
+ kfree(irq_ptr->chsc_page);
kfree(irq_ptr->ccw);
- free_page((unsigned long) irq_ptr);
+ kfree(irq_ptr);
return 0;
}
EXPORT_SYMBOL_GPL(qdio_free);
@@ -961,7 +961,7 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs,
no_output_qs > QDIO_MAX_QUEUES_PER_IRQ)
return -EINVAL;
- irq_ptr = (void *) get_zeroed_page(GFP_KERNEL);
+ irq_ptr = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!irq_ptr)
return -ENOMEM;
@@ -969,9 +969,6 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs,
if (!irq_ptr->ccw)
goto err_ccw;
- /* kmemleak doesn't scan the page-allocated irq_ptr: */
- kmemleak_not_leak(irq_ptr->ccw);
-
irq_ptr->cdev = cdev;
mutex_init(&irq_ptr->setup_mutex);
if (qdio_allocate_dbf(irq_ptr))
@@ -986,12 +983,12 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs,
* qdio_establish. In case of low memory and swap on a zfcp disk
* we may not be able to allocate memory otherwise.
*/
- irq_ptr->chsc_page = get_zeroed_page(GFP_KERNEL);
+ irq_ptr->chsc_page = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!irq_ptr->chsc_page)
goto err_chsc;
/* qdr is used in ccw1.cda which is u32 */
- irq_ptr->qdr = (struct qdr *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
+ irq_ptr->qdr = kzalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!irq_ptr->qdr)
goto err_qdr;
@@ -1004,14 +1001,14 @@ int qdio_allocate(struct ccw_device *cdev, unsigned int no_input_qs,
return 0;
err_queues:
- free_page((unsigned long) irq_ptr->qdr);
+ kfree(irq_ptr->qdr);
err_qdr:
- free_page(irq_ptr->chsc_page);
+ kfree(irq_ptr->chsc_page);
err_chsc:
err_dbf:
kfree(irq_ptr->ccw);
err_ccw:
- free_page((unsigned long) irq_ptr);
+ kfree(irq_ptr);
return rc;
}
EXPORT_SYMBOL_GPL(qdio_allocate);
diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c
index ea09aadaae4ec..c0215a7d29a81 100644
--- a/drivers/s390/cio/qdio_setup.c
+++ b/drivers/s390/cio/qdio_setup.c
@@ -35,7 +35,7 @@ void qdio_free_buffers(struct qdio_buffer **buf, unsigned int count)
int pos;
for (pos = 0; pos < count; pos += QBUFF_PER_PAGE)
- free_page((unsigned long) buf[pos]);
+ kfree(buf[pos]);
}
EXPORT_SYMBOL_GPL(qdio_free_buffers);
@@ -49,7 +49,7 @@ int qdio_alloc_buffers(struct qdio_buffer **buf, unsigned int count)
int pos;
for (pos = 0; pos < count; pos += QBUFF_PER_PAGE) {
- buf[pos] = (void *) get_zeroed_page(GFP_KERNEL);
+ buf[pos] = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!buf[pos]) {
qdio_free_buffers(buf, count);
return -ENOMEM;
@@ -83,7 +83,7 @@ static void __qdio_free_queues(struct qdio_q **queues, unsigned int count)
for (i = 0; i < count; i++) {
q = queues[i];
- free_page((unsigned long)q->sl_page);
+ kfree(q->sl_page);
kmem_cache_free(qdio_q_cache, q);
}
}
@@ -109,7 +109,7 @@ static int __qdio_allocate_qs(struct qdio_q **irq_ptr_qs, int nr_queues)
return -ENOMEM;
}
- q->sl_page = (void *)__get_free_page(GFP_KERNEL);
+ q->sl_page = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!q->sl_page) {
kmem_cache_free(qdio_q_cache, q);
__qdio_free_queues(irq_ptr_qs, i);
@@ -249,11 +249,11 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
DBF_EVENT("getssqd:%4x", schid->sch_no);
if (!irq_ptr) {
- ssqd = (struct chsc_ssqd_area *)__get_free_page(GFP_KERNEL);
+ ssqd = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!ssqd)
return -ENOMEM;
} else {
- ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page;
+ ssqd = irq_ptr->chsc_page;
}
rc = chsc_ssqd(*schid, ssqd);
@@ -270,7 +270,7 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
out:
if (!irq_ptr)
- free_page((unsigned long)ssqd);
+ kfree(ssqd);
return rc;
}
diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c
index e167aa75c3dff..a2ff51887537f 100644
--- a/drivers/s390/cio/qdio_thinint.c
+++ b/drivers/s390/cio/qdio_thinint.c
@@ -136,7 +136,7 @@ static struct airq_struct tiqdio_airq = {
static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset)
{
- struct chsc_scssc_area *scssc = (void *)irq_ptr->chsc_page;
+ struct chsc_scssc_area *scssc = irq_ptr->chsc_page;
dma64_t summary_indicator_addr, subchannel_indicator_addr;
int rc;
diff --git a/drivers/s390/cio/scm.c b/drivers/s390/cio/scm.c
index 171212a6d2d9c..b79fe023ab8d1 100644
--- a/drivers/s390/cio/scm.c
+++ b/drivers/s390/cio/scm.c
@@ -13,6 +13,7 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/err.h>
+#include <linux/cleanup.h>
#include <asm/eadm.h>
#include "chsc.h"
@@ -224,12 +225,12 @@ static int scm_add(struct chsc_scm_info *scm_info, size_t num)
int scm_update_information(void)
{
- struct chsc_scm_info *scm_info;
+ struct chsc_scm_info *scm_info __free(kfree) = NULL;
u64 token = 0;
size_t num;
int ret;
- scm_info = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
+ scm_info = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!scm_info)
return -ENOMEM;
@@ -250,8 +251,6 @@ int scm_update_information(void)
token = scm_info->restok;
} while (token);
- free_page((unsigned long)scm_info);
-
return ret;
}
|
| 3/2 | 2026/09/10 13:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 14770 output: 30 thoughts: 470 Thoughts: **Worth Fuzzing Decision: Patch Series Analysis** Okay, so I'm looking at this patch series and need to decide if it's worth the effort of throwing it at syzkaller. The target architecture is amd64, so that's the key. First, let's break down the changes. The diff touches a bunch of files: `arch/s390/include/asm/idals.h`, `drivers/s390/cio/chsc.c`, `drivers/s390/cio/chsc_sch.c`, `drivers/s390/cio/cmf.c`, `drivers/s390/cio/qdio.h`, `drivers/s390/cio/qdio_main.c`, `drivers/s390/cio/qdio_setup.c`, `drivers/s390/cio/qdio_thinint.c`, and `drivers/s390/cio/scm.c`. The pattern is clear: all of them are within the `arch/s390/` and `drivers/s390/` directories. Now, the question is whether any of this code is *reachable* on amd64. That's where the "NEGATIVE CRITERIA" in the prompt comes in. Specifically, the bit about returning `WorthFuzzing=false` if the code falls into unreachable execution paths, and the most relevant point here is: code paths exclusive to architectures other than the target architecture. So, I need to verify that this code *isn't* compiled or reachable on amd64. I'll need to check the Kconfig files, starting with `drivers/s390/Kconfig` or maybe `drivers/s390/cio/Kconfig` or even `arch/s390/` to confirm that `drivers/s390/cio` or `arch/s390/` are *not* included in amd64 builds. I'll run a quick grep or Kconfig check to be sure, because if that's the case, then fuzzing would be a waste of time. |
| 4/2 | 2026/09/10 13:19 | tool | grepper |
0mArgs:{
"Expression": "obj-.*cio",
"PathPrefix": "drivers/s390"
}Results: {
"Output": "drivers/s390/Makefile-5-\ndrivers/s390/Makefile:6:obj-y += cio/ block/ char/ crypto/ net/ scsi/ virtio/\n--\ndrivers/s390/cio/Makefile=10=CFLAGS_vfio_ccw_trace.o := -I$(src)\ndrivers/s390/cio/Makefile-11-\ndrivers/s390/cio/Makefile:12:obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o \\\ndrivers/s390/cio/Makefile-13-\tfcx.o itcw.o crw.o ccwreq.o trace.o ioasm.o cio_debugfs.o\n--\ndrivers/s390/cio/Makefile=27=obj-$(CONFIG_VFIO_CCW) += vfio_ccw.o\ndrivers/s390/cio/Makefile-28-\ndrivers/s390/cio/Makefile:29:obj-$(CONFIG_CIO_INJECT) += cio_inject.o\n"
} |
| 5/2 | 2026/09/10 13:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 16024 output: 28 thoughts: 23 Thoughts: Here's my thought process, as requested: **Navigating the Driver Inclusion Landscape** Alright, let's dive into this driver configuration. My initial approach, as always, is to follow the breadcrumbs. Given the task at hand, I'm thinking I should start with the `drivers/Makefile`. This is the central control point for how drivers are built and incorporated into the kernel. The goal is to see exactly *how* the `drivers/s390` directory and its related components are brought into the build process. I need to understand the dependencies and conditional logic at play here. This will let me see where this part of the project fits in with the bigger picture and what influence I might have on its development. |
| 6/2 | 2026/09/10 13:19 | tool | grepper |
0mArgs:{
"Expression": "drivers/s390",
"PathPrefix": "drivers/"
}Results: {
"Output": "drivers/block/Kconfig=267=config SUNVDC\n--\ndrivers/block/Kconfig-273-\ndrivers/block/Kconfig:274:source \"drivers/s390/block/Kconfig\"\ndrivers/block/Kconfig-275-\n--\ndrivers/char/Kconfig=345=config TELCLOCK\n--\ndrivers/char/Kconfig-357-\ndrivers/char/Kconfig:358:source \"drivers/s390/char/Kconfig\"\ndrivers/char/Kconfig-359-\n--\ndrivers/net/Kconfig=530=source \"drivers/net/slip/Kconfig\"\ndrivers/net/Kconfig-531-\ndrivers/net/Kconfig:532:source \"drivers/s390/net/Kconfig\"\ndrivers/net/Kconfig-533-\n--\ndrivers/s390/block/dasd_diag.c-3- * Author(s)......: Holger Smolinski \u003cHolger.Smolinski@de.ibm.com\u003e\ndrivers/s390/block/dasd_diag.c:4: * Based on.......: linux/drivers/s390/block/mdisk.c\ndrivers/s390/block/dasd_diag.c-5- * ...............: by Hartmunt Penner \u003chpenner@de.ibm.com\u003e\n--\ndrivers/s390/block/dasd_diag.h-3- * Author(s)......: Holger Smolinski \u003cHolger.Smolinski@de.ibm.com\u003e\ndrivers/s390/block/dasd_diag.h:4: * Based on.......: linux/drivers/s390/block/mdisk.h\ndrivers/s390/block/dasd_diag.h-5- * ...............: by Hartmunt Penner \u003chpenner@de.ibm.com\u003e\n"
} |
| 7/2 | 2026/09/10 13:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 16702 output: 27 thoughts: 11 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Diving Directly into the Makefiles** Alright, let's cut the fluff and get straight to the heart of the matter. I'm going to bypass any potential abstraction layers or higher-level build system documentation for now. Instead, I'm going to immediately examine the `drivers/Makefile`. This is often the most direct path to understanding how drivers are compiled, linked, and integrated into the overall kernel build process. I need to see the dependencies, compilation flags, object file generation, and any special handling specific to this driver subsystem. This bottom-up approach usually provides the granularity I'm looking for to understand potential issues or optimizations. Let's see what secrets it holds. |
| 8/2 | 2026/09/10 13:19 | tool | grepper |
0mArgs:{
"Expression": "s390",
"PathPrefix": "drivers/Makefile"
}Results: {
"Output": "drivers/Makefile=199=obj-$(CONFIG_DIBS)\t\t+= dibs/\ndrivers/Makefile:200:obj-$(CONFIG_S390)\t\t+= s390/\n"
} |
| 9/2 | 2026/09/10 13:19 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 16961 output: 86 thoughts: 352 Thoughts: **My Analysis of this Patch** Okay, let's break this down. Line 200 of `drivers/Makefile` conditionally includes the `s390/` directory based on the `CONFIG_S390` setting. I immediately recall that `CONFIG_S390` is exclusively defined within `arch/s390/Kconfig`, meaning it's tied to the s390 architecture. Given the target architecture is amd64, that config will *never* be set. Furthermore, I'm noting the modification of `arch/s390/include/asm/idals.h`. The "asm" in the path is a big red flag – this is assembly language, specific to the s390 architecture. Combined with the other changed files being in `drivers/s390/cio/`, it's all pointing to an exclusive s390 context. Therefore, this entire patch series is unequivocally s390-specific. These changes will not compile or be reached on an amd64 system. This directly aligns with the "Unreachable execution paths" section of the assessment criteria: code paths exclusive to architectures other than the target. Given this, the analysis is straightforward: `WorthFuzzing` should be `false`, and the `EnableConfigs` and `FocusSymbols` arrays should be empty. My reasoning is solid: the patch modifies s390-specific code that is structurally unreachable on the amd64 architecture. I've double-checked all the requirements, and my assessment is complete. |
| 10/2 | 2026/09/10 13:20 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "All modified files are located in arch/s390/ and drivers/s390/cio/, which are exclusive to the s390 architecture (CONFIG_S390) and not compiled or reachable on the target architecture (amd64).",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "All modified files are located in arch/s390/ and drivers/s390/cio/, which are exclusive to the s390 architecture (CONFIG_S390) and not compiled or reachable on the target architecture (amd64).",
"WorthFuzzing": false
} |
| 11/1 | 2026/09/10 13:20 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|