From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590913; cv=none; d=zohomail.com; s=zohoarc; b=c1BMJ7G9IqqIIF8wEjPYipVUQTLbTfN4EN9Ib3TlAgCGFqVciYjoisdulvFup+1tl9pkeTBysLsJWLMvWrS9ccMgNHwJ4xIjqL1yRSkiTpwDVPc0mdgyK5uHI+Kbm5kw+8QGjkTCjyax9UlrLAialDV+FloNH5mpNspWf9CEaXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590913; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ILf5TJe9Y2znuxk+OdFiNFiXdAyidaqWCS+8QOenYOA=; b=VBVwwJwTgV1yWKCaCM80UE8SiulkZAbAcgAY0L+QXFZGYu0JdhLwawTWAQc8AX3uNUbEXgTvVTayYNOVwcxgvGr1ivyrkXQIyNiVooZ0rY7CRvfyFJS8rlmu9laHP5byb1FdTU7ZqehwKiMjFjA55FrlMpD/PTZgcHtCRnFangw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789590913616807.8646216904411; Wed, 16 Sep 2026 13:35:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJm-0007hd-5p; Wed, 16 Sep 2026 16:33:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJO-0007Zn-Sv; Wed, 16 Sep 2026 16:33:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJL-00030e-NA; Wed, 16 Sep 2026 16:32:58 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1huJ046034; Wed, 16 Sep 2026 20:32:51 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmxcv6enc-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:51 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GIwbWb1649282; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gq03c0b4a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWkPG35193120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:46 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA6912004D; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 902A520043; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 79521160DDE; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=ILf5TJe9Y2znuxk+O dFiNFiXdAyidaqWCS+8QOenYOA=; b=tNxSEKpe00NQZeXWsWNLTGhytAPfiGIsr rlE6zkwBUG+Fv4+9J7czZnEzOgyXOr8b/QMUu4Bn1cweSqk3qeZkRJHWbsJ9wx9K WPkJftFbDDV9YwvxB8xdsvNhUYurllAglYkMuydTBTeCdetIWUXO8IUzgVDcN9dA xP9OuVxXn9hhUWOokln+2mDhfdLjd3OeYs64AEqMU4xWKcdr4XhmtB/InVndeULz Q5+K2rSutvYx7rGm62IyRvHTMqubG76TOjAf/bMLWWllmXXvqNmxhfnrvxnM3y+A m0Bq467VOV1VQ0e1n+Rq3i6FOyZfhI+tygqXmRjVKP+k/i2Ojio+A== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman Subject: [PATCH 1/9] virtio-ccw: Limit ISC to MAX_ISC Date: Wed, 16 Sep 2026 22:32:33 +0200 Message-ID: <20260916203242.2509787-2-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX7ELlZb1Xsna7 uPVdbdgIiS27FJo/ad3oLb5bgHS7l6MwQ4NFsvzwChtrWLaL5HrhFLpDgoOcQpdAa8n2T6XLKCZ w76tq8fUNMiTvhC4U7ici63jLHXajhc= X-Proofpoint-ORIG-GUID: qg_JnJhkwD8PVcKEVEnK6bzJCaLXHxnI X-Proofpoint-GUID: qg_JnJhkwD8PVcKEVEnK6bzJCaLXHxnI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX5lZvmGKpVwAM WNwl/0LSq/mv6snFvE+H5sTeSEwbKKBtTn4El/XjrhrNHpssVh9Y9DgW6VZ37ZzrprztcMHlo3Y iktyNLW7HXqEovTfYCXu6td8qf38ZVqT0sODcPrppad/iZHU8OiIv5IKlUptAqgGbI/O9qq0Mre HTZ03fEOMh94WIU5yLxG/2TQSgIc72moUQAnZC4HDJoSBPWpVZ10i1mSBoegsHlvxedLeYXOZ47 FAxKi2aEtU/dTILrV+PMq7SJ1EUHJp6Pf+V/5+TIIK4n/VsnFbDn1qPgCJgHKHCqydaH+v1pcw1 ejsfGlXo5SucKAzZGdCcQtmTPSt0RtejgwHXZRAk46W2QgVMakEg5Tt+2eNXgKEc2DsSk5hfpuA KWa5wXju3g8oWcdMeIn5eV5cbDcKCpv727izmO+Jh7jrUxl7amy5zB3vu9XYWhYzSIgXY0HrYc2 BPBEgFmkaACFjBW5NLA== X-Authority-Analysis: v=2.4 cv=F+7C5ahN c=1 sm=1 tr=0 ts=6aaafcf3 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8 a=osxc_5YrPWMs37QBt84A:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 phishscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=farman@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590915187158500 Content-Type: text/plain; charset="utf-8" The interrupt subclass is often defined as a uint8, though in practice it will be within the range of just 0-7. Ensure that a guest-supplied subclass does not extend beyond its expected range, especially when used as an array index. Signed-off-by: Eric Farman Acked-by: Christian Borntraeger Reviewed-by: Matthew Rosato --- hw/s390x/css.c | 7 ++++++- hw/s390x/virtio-ccw.c | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 76dbca3bb9..9da9128d88 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -654,8 +654,13 @@ void css_adapter_interrupt(CssIoAdapterType type, uint= 8_t isc) S390FLICState *fs =3D s390_get_flic(); S390FLICStateClass *fsc =3D s390_get_flic_class(fs); uint32_t io_int_word =3D (isc << 27) | IO_INT_WORD_AI; - IoAdapter *adapter =3D channel_subsys.io_adapters[type][isc]; + IoAdapter *adapter; + + if (type >=3D CSS_IO_ADAPTER_TYPE_NUMS || isc > MAX_ISC) { + return; + } =20 + adapter =3D channel_subsys.io_adapters[type][isc]; if (!adapter) { return; } diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 30fb2c0681..eb6378ea4c 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -46,6 +46,10 @@ static int virtio_ccw_dev_post_load(void *opaque, int ve= rsion_id) CcwDevice *ccw_dev =3D CCW_DEVICE(dev); CCWDeviceClass *ck =3D CCW_DEVICE_GET_CLASS(ccw_dev); =20 + if (dev->thinint_isc > MAX_ISC) { + return -EINVAL; + } + ccw_dev->sch->driver_data =3D dev; if (ccw_dev->sch->thinint_active) { dev->routes.adapter.adapter_id =3D css_get_adapter_id( @@ -659,6 +663,8 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) } else { if (ccw_dstream_read(&sch->cds, thinint)) { ret =3D -EFAULT; + } else if (thinint.isc > MAX_ISC) { + ret =3D -ENOSYS; } else { thinint.ind_bit =3D be64_to_cpu(thinint.ind_bit); thinint.summary_indicator =3D --=20 2.53.0 From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590941; cv=none; d=zohomail.com; s=zohoarc; b=lxdygvkojun9pLBBgm6URjBdWZsiHLeVidsscu36MvwoKs8ZeBLXximVhougch16CPPZrdyxRMIue2JVp5xKT1iuR7q+v8ZYoeh1nelT9EBpsAgJWIJfG0JTAxva7XwmtPcalwWcHoDC3pcn5hqyeXer614JZovjBCHMxtRBbxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590941; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ycjpvrhm3Hk+/sjo2WGDZDV9uHNy/wRNVisP632dfzQ=; b=n5XHLwZq14kbiGVQxQ4/5mgWQcSs9IRHJiDhM9wiGUruP/8JM4DUmsAUXGdZsYYJx+f91H8fHSV+uJDSGai6OtjsxqawoGvjRCV+xNE+tKsiLPcOgWWmXgDdjrZ/gne7nLvzjONElj13eZ/WiEFdy+Uq3xGAAlAj37V/ccRbIpo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789590941533387.01166078628273; Wed, 16 Sep 2026 13:35:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJh-0007e7-CR; Wed, 16 Sep 2026 16:33:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJP-0007Zo-5r; Wed, 16 Sep 2026 16:33:00 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJL-00030q-EA; Wed, 16 Sep 2026 16:32:58 -0400 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1dIi2330029; Wed, 16 Sep 2026 20:32:51 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmxdqev64-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:51 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GIvlvS2599802; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gpw6d8wg8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWkXF43123058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:46 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA0B82004B; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9710D20043; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 7B590160EF5; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=Ycjpvrhm3Hk+/sjo2 WGDZDV9uHNy/wRNVisP632dfzQ=; b=bKJeDx4GJwteV0YvEgwm6z1k/+2IQOqhJ wgrv+m/ztvaGLtg+eGe1aH86SpkMaYechJWQiI/OAv9ySDhZyrc+43YbUG8q15Eg hiaSrzKW+z9gvS+VUeMYCux75wOOt4dop9CU0r/xDTGShZF7qW0Vv4zpoBP50FRg Fht/iRAWeqhByIO7QePXQXyc5g5M6tiVeuuPju0ump3WXPjKIz7o9ISgy2gAzmFA 3VTeXQqQeFVASWFW0it1f3c9ooKiuvP6Qjyb342LFd5u8+A4hbunAj/030EZ1vuH b+qRPhCLfjHqxCpSr4QKyd/jtW795dIJ5floYc7qsCQ1ps356Ge6A== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman Subject: [PATCH 2/9] virtio-ccw: Do not overwrite existing indicators Date: Wed, 16 Sep 2026 22:32:34 +0200 Message-ID: <20260916203242.2509787-3-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX3h/V4513s43o YqyxIvfFGfP1azTb8htIPLRWZVdT2p1d/X0Y6N3JLc2rnx33NlHbG9pHHxUByJna3rHP87FqvMn dwjI24faeWTEjjTzn29lYR21+lOAPFxYsdzY0BdLWpBf5JkW/EhucTSVxeup08DoDu+ZvWOrQYB 7VkgH/yAWZKG/IuL/So1PkhBxX3nUMw0/eh+KWcd41fSLDXh2d2tTztpVO/UkqtdZGTSSkNFZqW 1Z5H/aoby5PFJ0ARvv11bnZEh/G1njyjiuxK1zXfjdrWmS7LCo9O2/ytO7GAa/vdicAhY/gU+is GojsgBztKIQc9r9evdNpm7NrBk5+EPZGA3pAFCdpN55Wf0vWihFykkz2p5Tcnga2R55ilL55pWt VQAfw+uT1DziMzWVpymk7sjnSENnLiyqjelHIEhcqYk4W4kOexj8diAKFtO3s5OtuyqzRqCd/h4 QAaIBR6AIdB7FUoDymQ== X-Proofpoint-GUID: M6cwLRoEuG3lBaSvBtweiO2PL0c9Jy7R X-Authority-Analysis: v=2.4 cv=DobDa2/+ c=1 sm=1 tr=0 ts=6aaafcf3 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VnNF1IyMAAAA:8 a=AcHJBQmbBjRtW04g4g8A:9 X-Proofpoint-ORIG-GUID: M6cwLRoEuG3lBaSvBtweiO2PL0c9Jy7R X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX2hWj9zBZ4ZH0 +CmjbydLnVzQRahAWokPuiZDDizjsyOsKvnHE7C/re5KOGMyYpvJ/ACUgAQqo9gIp2cH/kFs//Y hsidNPVCYHY23TNxG70cu9sIy4IQelE= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 impostorscore=0 spamscore=0 clxscore=1015 adultscore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=farman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590943179158500 Content-Type: text/plain; charset="utf-8" The various indicators pointers allow them to be overwritten, but leak any existing structs that might be there. The adapter indicators path checks that it isn't converting from regular to thin interrupts, but a check in the reverse direction isn't performed. Rather than unwinding the existing allocations to allow additional assignments, just reject these duplicates. Signed-off-by: Eric Farman Reviewed-by: Matthew Rosato --- hw/s390x/virtio-ccw.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index eb6378ea4c..d700db405b 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -565,6 +565,11 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret =3D -EINVAL; break; } + if (dev->indicators) { + /* Do not set without un-setting first */ + ret =3D -ENOSYS; + break; + } if (sch->thinint_active) { /* Trigger a command reject. */ ret =3D -ENOSYS; @@ -599,6 +604,11 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret =3D -EINVAL; break; } + if (dev->indicators2) { + /* Do not set without un-setting first */ + ret =3D -ENOSYS; + break; + } if (!ccw.cda) { ret =3D -EFAULT; } else { @@ -657,7 +667,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) } if (!ccw.cda) { ret =3D -EFAULT; - } else if (dev->indicators && !sch->thinint_active) { + } else if (dev->indicators || dev->summary_indicator) { /* Trigger a command reject. */ ret =3D -ENOSYS; } else { --=20 2.53.0 From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590875; cv=none; d=zohomail.com; s=zohoarc; b=F+c+BlZRE37k4hsXBS9t6HN0WDTT4PZJeV1pHB+lMCTk9zp+SJzSOPtgl7G857Cl8u8EtQFitJIwUQs5pegVGhzqAVg1FBwBkQG53ERnxxyZJ99wZVRRzek/t6/1bSYK7r+6mPNBGAwaOLO1RLPpxriKD7zsV1MqkuwbgXpHg5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590875; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NZa919vWQHK3YK5RidDPcIbHU1J72f0rAp1tG4Iv7Tk=; b=X6SR7jI1gKfToWgv40egiDVrCmR6bnVXWMKQDMxN+nfdSlo4oedxx7O2pEGUduVfQjL6GU6WwToWSjm0zHcOukQHayAWRSsSVmiO4w6wwh1dd97RWYScAeC1lSRPTIsWVWP7MyiBsN/nvhhkDmCMcGXa8BXt/6GtCxQlT6yu0qQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789590875655718.7012858584649; Wed, 16 Sep 2026 13:34:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJk-0007f7-4u; Wed, 16 Sep 2026 16:33:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJN-0007Zh-Ki; Wed, 16 Sep 2026 16:32:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJK-00030g-OU; Wed, 16 Sep 2026 16:32:57 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1Yjs045805; Wed, 16 Sep 2026 20:32:51 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmxcv6enb-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:51 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GJ2B7l1713033; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gpywf0cqv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWkSi30802310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:46 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B841A2004B; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9706120043; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 7D5EC16123B; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=NZa919vWQHK3YK5Ri dDPcIbHU1J72f0rAp1tG4Iv7Tk=; b=EeYmOn70vIej6loOEzufIXZu1yHUf6bgh ZzCpc0BneAOjXtsiEd0PrRNS35U5qO79B3Nr8lb1Idgcjxjcdyq4pdP275jypbm8 qgmymKZ6JZmphUtHDnN3afJ6H1RDLttZfQAhe3Slqm7wtEBROJjso1pjHQOrPhn2 0AxJOxR3QrFMedRrHmBONqjVzyQGgGVV88LrMOz4iwjkVAQUgu5qXx4xnSa7dnkC K7l4TTUPjZGkvPf30W4VXIEzJ3MUnJbWS1A5zLDzpXGoIjiWZt49smAwFrBTNbSN eehcI72NTUqvpHpMZAATPnEIW6DKLYnOfd5HsJ0ZddX0cxuas0D6Q== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman , qemu-stable@nongnu.org Subject: [PATCH 3/9] virtio-ccw: Fix rc check in read configuration path Date: Wed, 16 Sep 2026 22:32:35 +0200 Message-ID: <20260916203242.2509787-4-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX46CXC2sx45LY dYeSR5KjoPnztebGZU7gAjz+pvFgg5gkJVzl1/V7abwU+8+ldVdCrcM+fmxvqr6Wxjv3mjSnmq5 7xRxsYM09J9ipoB8EWMp0zAKRzqZxnM= X-Proofpoint-ORIG-GUID: v1vNHxSErJTHwPJH8VSwfoM-4Z4SrKZD X-Proofpoint-GUID: v1vNHxSErJTHwPJH8VSwfoM-4Z4SrKZD X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfXyOs8NAYaCB9l GfYqS7y6clzdIyCSdBpF8JDSrP5nxaa+0lneiik71JLHHVnFyTRl/XOlUiLURCCAQKKlsNdoref eO6BW150NfBuHfLJw3lKeA31XVCl+feGUXm4CCngvcTk6osQUqhxy8ujWqUWKg2CVC4QdUsnZu/ qc6y9WIBoL3GGF3H+K2ysUcjcv0WGASy36g+HyYJ8QhqY8IWD2w+kYLjdSyQkqeeHPbPaQ18Et5 0GBMJMEJzz7YbDZf+TC3SwIRo4pBX1D3Rd3gBku/Tr8IVTSHVo8MaTzUs39FuvDuT7a1Z4Bbqlg hLP2O5Dgd54XQBWzi77AS7Rzb7bSUtcvBhamqZeT4661ENBrNp76hxoXx1UQtpc0l2CT8F6zn0o 9SU8IAwnY/fYVVAJQKlVBil0AJHaBwYNuRtqhqjrNV0zSrhfrb+CMpK0/EVKMZor7xchsiDDP4Z ZNiGb2KapX+bbHv3mbg== X-Authority-Analysis: v=2.4 cv=F+7C5ahN c=1 sm=1 tr=0 ts=6aaafcf3 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=69wJf7TsAAAA:8 a=VnNF1IyMAAAA:8 a=uiMiztMkydEs4ieJCJEA:9 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 phishscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=farman@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590876966158500 Content-Type: text/plain; charset="utf-8" Both the read and write config paths use wrappers around cds->op_handler, depending on the direction the I/O is flowing. But they expect opposite values in the returned variable to indicate success. Fix this by unifying those checks, where CCW_CMD_READ_CONF needs to see !ret as success. The end result is some erroneous data in the SCSW response data, but the overall success/failure is correct. Cc: qemu-stable@nongnu.org Fixes: d895d25ae2 ("s390x: css: report errors from ccw_dstream_read/write") Signed-off-by: Eric Farman Reviewed-by: Matthew Rosato --- hw/s390x/virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index d700db405b..4622c5d46d 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -475,7 +475,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) } else { virtio_bus_get_vdev_config(&dev->bus, vdev->config); ret =3D ccw_dstream_write_buf(&sch->cds, vdev->config, len); - if (ret) { + if (!ret) { sch->curr_status.scsw.count =3D ccw.count - len; } } --=20 2.53.0 From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590949; cv=none; d=zohomail.com; s=zohoarc; b=OqPm1CneRwj6MryM3ueO4SzaCnBhiCkcAjjIBgap5NkzuDkWX8WlmQ468KtHwbQRbUHaDDVXmtkG2wfFDEeebvvhcdxRZNVCdZqwHrROQmOYyh268MjG53k29pyfnny+ORt9gY0RV6UAFFxRpTTLF3/rOR8QrgXHkjQauCQfAco= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590949; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=N1RQqv8BerfSGHh2mj70Qx4yNG9w4P0djTg8FoWU7Ic=; b=kZJUETrllzlZnAD/qzGeoPgCa9b4yhgsq9VWnQ7QmdByUizDp1fw2laV8VDtSUPGXahljkLHPRraKWUeknF7c1D3leNYO7A9BIKKo1EHlSEVqXeRcfxRPBUzFI2XPFhFTXuh5JmUIFIcYMSd8Tn7/pciixjtris5Gs40zIdQlEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178959094979914.360271638821473; Wed, 16 Sep 2026 13:35:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJn-0007iV-Tr; Wed, 16 Sep 2026 16:33:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJP-0007Zp-LL; Wed, 16 Sep 2026 16:33:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJL-00030j-Mg; Wed, 16 Sep 2026 16:32:59 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1gLB4057271; Wed, 16 Sep 2026 20:32:51 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmv5hxs8d-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:51 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GIv4pU1663487; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gq089r9rk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWkO641353494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:46 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B702C2004E; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 984102004B; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 7F73616129A; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=N1RQqv8BerfSGHh2m j70Qx4yNG9w4P0djTg8FoWU7Ic=; b=l4CM9snabKSrZ0AiJgylItJaE3izoCa40 oPhe/PduUU6nIuEenWSHB2JVTMzmzenFQ2V/uqurQkST9DNVvnEmhqPdC8inSRNO vMK0PaPS7XvZNF/hcX0sejB3SZ6IfxMcvttstRQSoRt+688mh6hH3N+3qNWfRy6O Kv0N5ATFCm7k72VV3ajANrVXC/THZNnWK1XoTW4V840c7jcwjOcQuCXcHT/qFitB b9aOkB64mANhFITMne4EGTbGInbq8A76DF2Wfvr7be8gxGeIoAfeVVcVkE721LtU spI+cN6scwEjp2KV83eZuXeNhyiFE07kl1Jl67E18e4beZ4Jpq5rw== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman , Anthony Krowiak , qemu-stable@nongnu.org Subject: [PATCH 4/9] vfio/ap: Clear error object pointer after non-fatal errors Date: Wed, 16 Sep 2026 22:32:36 +0200 Message-ID: <20260916203242.2509787-5-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX/va+STHw+6lB ztCZeKq/4T7nGpUTgFmOBvbB3La/ScyTTFhPy+9Emk30HLxXI8BliNezw0LSHgxqXPW4VVw/WeQ 9a+OV6sjkp4pkoQygsVEqX/aveUTeFVRPaeTgltq5fbhTeXjaITgesnNwUhEhjNJUBlemIsrx4R wKzOEofgHvHR+g2cXlw/fMutRBxeRJcwO26/kWoRbZLqwh3NJSrrQ8dWOoqcRiLDfjbhM2clGTE xyixNkEi8f8IvXkFJh2x7ba5T8MpVdVrgEm9lPlvRbn2mOhNpwyPoRyWma0BjCc1APEez40KB2Z uLYLwZelPhstPK9njATMzWgVXV/aDS6S2zd+pdv3FmaxBH3l/3JY3moxonOy0TRA5irV0M6oZNl 2gsLMBqyaqH3HsjY0O1+XXAiVLd1MRqgTgYi1jP5cNoBmmcSjAwmXikN7XkKj/Up65EHDYuWvRC fofrzmFtaixeURWzX+Q== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX1acdV/6F80/I 9iIxl8zzwq8SK5uiREndUashXmIfPhdmojBjbHURC3BQp13wIv4bpAkcJYWm5ZIy/NX2fXbRW3o Dtxm7dttIlp9Wt5s7oFax4ZNwAk8dwk= X-Authority-Analysis: v=2.4 cv=Zsx4uN7G c=1 sm=1 tr=0 ts=6aaafcf3 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=69wJf7TsAAAA:8 a=rlruftgHjx7kiOjKd_sA:9 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-ORIG-GUID: mzcf6HZHWLuhAP9_v42POIhXh0fYlegt X-Proofpoint-GUID: mzcf6HZHWLuhAP9_v42POIhXh0fYlegt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=farman@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590951244158500 Content-Type: text/plain; charset="utf-8" Registering a new IRQ notifier will allocate an error object if needed, and warn_report_err() will release that memory once it's finished. The pointer remains, however, so subsequent errors after the non-fatal errors in vfio_ap_realize() would cause an assertion failure for a non-NULL pointer. Fix this by clearing the pointer once the warning has been reported, to reset the state of the error objects. Cc: Anthony Krowiak Cc: qemu-stable@nongnu.org Fixes: 1360b2ad1f ("s390x/ap: Wire up the device request notifier interface= ") Fixes: 0fb8a62fe4 ("hw/vfio/ap: notification handler for AP config changed = event") Signed-off-by: Eric Farman Reviewed-by: Anthony Krowiak Reviewed-by: Matthew Rosato --- hw/vfio/ap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 6e2a1223ea..2926e04ad4 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -247,8 +247,10 @@ static void vfio_ap_realize(DeviceState *dev, Error **= errp) /* * Report this error, but do not make it a failing condition. * Lack of this IRQ in the host does not prevent normal operation. + * Clear the pointer, since the warning will release it. */ warn_report_err(err); + err =3D NULL; } =20 if (!vfio_ap_register_irq_notifier(vapdev, VFIO_AP_CFG_CHG_IRQ_INDEX, = &err)) @@ -256,8 +258,10 @@ static void vfio_ap_realize(DeviceState *dev, Error **= errp) /* * Report this error, but do not make it a failing condition. * Lack of this IRQ in the host does not prevent normal operation. + * Clear the pointer, since the warning will release it. */ warn_report_err(err); + err =3D NULL; } =20 return; --=20 2.53.0 From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590945; cv=none; d=zohomail.com; s=zohoarc; b=IQLVHI0ztrNPlTGHyh4a86ZWyoxHPV19z5EGJ4Og/xZ8yzREFGBrwaeCoWTI0qcd4HnnOfZJa0PTrvjT9eH2lVaji77CHi3zLdJ4RBLhU7F1YpAbYnGCfIeum0GmVrM2vMfDeeOWXScb5FghS29Sn5dc17pZ6/N1ohfsF1MuVxw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590945; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FuGKytLMs2BC3h9ds0S7fGLwYIr34qH+N7VVjas75qY=; b=K6cOyhP2/K9UpxOP6/cRY4ZKW25pvLdkZhFYU3XfaFb0wL6K3Wj/iwAKa3GTiZ7ybOFKFw2D+9PROARLzCto7dN1VfJ322i9Z/HHgEnaNTcXX1wQ2JCze+zf1hyzfmshKFN/++IgYvmau8Pz6XNOB3N8ofan5HzHX0B08jusALg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789590945366568.0814282645294; Wed, 16 Sep 2026 13:35:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJr-0007kH-0w; Wed, 16 Sep 2026 16:33:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJP-0007Zq-LU; Wed, 16 Sep 2026 16:33:02 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJM-00031L-Nr; Wed, 16 Sep 2026 16:32:59 -0400 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1QFd017615; Wed, 16 Sep 2026 20:32:53 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmxf56vtw-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:52 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GJ0la71699595; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gq03vgb05-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWkcY47710516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:47 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D45D62004B; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B720320040; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav03.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 816D916129C; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=FuGKytLMs2BC3h9ds 0S7fGLwYIr34qH+N7VVjas75qY=; b=gpTkwU8909m45vNFjOrKaKlyCiC0j0wsf rrMRdsyhLbk/I00M4uiJ4E+cPwKC/fn2OJi/7yzb/ZIgGUQy/im8q1/CRTZmUJso Gp8SCXSu4QjwvsW+FaG+J/TGEJH/0wiVwboE0Zd0bZcZapqsgKSq8mdvND35RhBi QDg76As/2BbktEYZk8xRRNt6pPX/t97PcSE3koJ33pEl6dK1dBPpcuArqzqxhQqW 9r8ZBFpjYMBNsjW6Vp3xdrGJLcU8uzHjRgZPN7aBUI92m8hpPWu4alcENyjlwZ8Y uvAoOc4jkGXXXBVkzmjQpgjqrwVKP6AZQ1o/J9y9fZ3AlW0d3DQBw== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman , qemu-stable@nongnu.org Subject: [PATCH 5/9] vfio/ccw: Clear error object pointer after non-fatal errors Date: Wed, 16 Sep 2026 22:32:37 +0200 Message-ID: <20260916203242.2509787-6-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: DgSABzF4iJvsVuu8P3-VGxSG9sPKRMSJ X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX1j1GYgCjGlk3 uhDi892GRwT7Xza9MPz1g8o4Lqko0LkBb6s7YPTc8RB7ZI/mefXyapX8AU23UJYbfXX++KZ1Bqs NelRPmejfLzY26YU8VA72wFVwfVmhWs= X-Authority-Analysis: v=2.4 cv=cvgOAF4i c=1 sm=1 tr=0 ts=6aaafcf5 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=69wJf7TsAAAA:8 a=VnNF1IyMAAAA:8 a=WuYEg3pJWr1ZmXxL5igA:9 a=ZXulRonScM0A:10 a=zZCYzV9kfG8A:10 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-ORIG-GUID: DgSABzF4iJvsVuu8P3-VGxSG9sPKRMSJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX26mx5RET8Ui5 Fh+i98gLkx5yl7uHuM8wwGjQcTdXaNb6OogTwF0MIJcXJhvJmL8q8OG3KU6oz6dSP4vCiSPE9WW TV2C4Kr13gk0fKY4nOeoIoxMi9WpHlKVrAfotm0XA2Vz/Hd+fJqBWf3qtutzFl/Ru+EDN02Mjtb ZJYaxZAENqYCROywlscLRReaEtKoPqK8IK2s6j2nlhfbi0Gukb7MLBiHydE6uKK+P3bnLTiZqGw JA/JCNYhTE7siuG00rGqaczLZz5zS4x0vnAcsF/RXL8mdeFfA4QxieGqGKkrP0vXFDHCI5ENuSu u+44B+NYQhdo0oz6VpKL/m8+i0x6mD7xoX+qUoYtE/XePIaxnXIMrMZS0Tqfjz997UyxqzgtnzK fkslhQ14ETvtHTMvzDf0KONQIb76t7SsJBLMO1KPdvFP+rwj2GGv7fbru08Hbq2lyEUQ8tUb04i YH7e754Y8tnjopCkzeA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 bulkscore=0 impostorscore=0 phishscore=0 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=farman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590947216158500 Content-Type: text/plain; charset="utf-8" Just like in vfio/ap, there is a non-fatal message that could be generated, with a stale pointer in the error object variable. Unlike vfio/ap, there is no secondary message that could attempt to use it. Clear it in the same way, in case that ever changes. Cc: qemu-stable@nongnu.org Fixes: 6178d4689a ("vfio-ccw: Permit missing IRQs") Signed-off-by: Eric Farman Reviewed-by: Matthew Rosato --- hw/vfio/ccw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index c3dc7c1962..8e29a3ae61 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -604,8 +604,10 @@ static void vfio_ccw_realize(DeviceState *dev, Error *= *errp) /* * Report this error, but do not make it a failing condition. * Lack of this IRQ in the host does not prevent normal operation. + * Clear the pointer, since the warning will release it. */ warn_report_err(err); + err =3D NULL; } =20 return; --=20 2.53.0 From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590848; cv=none; d=zohomail.com; s=zohoarc; b=PXVs3ymdvxWhd7vZeMUG/nGardutfxv1P/2ZQkO/M60EAVIycOP3B4E3ic1PZ/yRerv4KP0wJem3rEEuFQGqqbdd4hNRo26LMdqzEnX2T72OKIwpNcAKJpvu6lZrQNeWy3D/Hs2Omd8JJz2hpXgh+wfDLAke5Wg9bgZ/9rYmFRk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590848; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YRQ6iUSta7ErXBwnm9x97G9tni/Xu3rWpcGEXumEoRA=; b=nEQlyOBvJ7Wl31H4uiKcu3D2TuLwZ2vs8sUorA/cgmTsaUXxRAIxtqLu3au9DrXnMfhMcLLMS4xeef+xOs14UzG+cQARfTCeJTox8/Sin04CdrIL1AL7iPBqkZMWCRt40M9bjNjfQJ61PJrP4TNVcKekqc5HtOHg23jdqRu4sGA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789590848088909.9909715449708; Wed, 16 Sep 2026 13:34:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJf-0007dI-6B; Wed, 16 Sep 2026 16:33:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJN-0007Zk-Si; Wed, 16 Sep 2026 16:32:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJL-00030r-EB; Wed, 16 Sep 2026 16:32:57 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1c1P4057226; Wed, 16 Sep 2026 20:32:51 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmv5hxs8c-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:51 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GIvu5d1712957; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gpywf0cqw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWlnT47579530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:47 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E37F920043; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC5D32004D; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 838DD161392; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=YRQ6iUSta7ErXBwnm 9x97G9tni/Xu3rWpcGEXumEoRA=; b=sVPQWHNKK9UV3U8wxMw2juJNzH3UDOY5y gNDBxs5Ayip7U626xiOBRfO+yINxmfjVvNSUkgaqroc+XXAvgSjhAca2zeJ9Kkvg 38vUxfab3sHOCb1muJc0Ejm6u4UUURdzfZAZRD+in4Mc+UeY+WTR3gFYBeEo8X2c 1tB+VBEHYVHciCqL5Qk1LklmKM9FuKzlhtcnbdPU66zBtKJ8yxELrjhvpdDHxs/G Wsux5XwSbuU/9wbJVJL/ieTJ4BnyT10N+r5+Cvph7Q+9kRM7rstqn6S+5+4ZEjxw tBdk1QE4KXOCKpqebefuz8A73adoRZezZl5OxEcMIadKgf5wlOSvA== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman , qemu-stable@nongnu.org Subject: [PATCH 6/9] hw/intc/s390x: Fix payload to KVM_HAS_DEVICE_ATTR ioctl Date: Wed, 16 Sep 2026 22:32:38 +0200 Message-ID: <20260916203242.2509787-7-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX7ZAVhPwRqAGZ HWbRG1C+xnCtWzjp1Xjb2CIfWmhaS/ynA4B0oyJae61IBXetekX10rgJRMPPqGXRneEwfECUPSL g+TlPrVp3DO6rkmwkmYicxkCZgPxF+G/Y9hS3FzuM9tWqb15f7T8TrJlZa3VCcXUgXKW5qX6O26 TdaFbItpzKpgubGaYRqUl/NccNn6J/38MlPFcgFi4Y9645AZHus/5qq5lBlxF1izYWgrTbJ45QR PmOhmxx5d8Gq11IgUSr+MSN2HFNGWYV9qQmE+C0uDg/nkHVsk2t/8NsQZB+IA4YikcCDYXiXbyd UaTZklGQwwybep97Mds21M/9KH0RufHmEBU1ymUHGAqcTXkhmoW6UP8b9e9GUqfFvAarmXeDxiW fjPu+qU6LazRjbyijnIuo/hH0HvxcKU/5o8fnaFR+a9Qhu5jihKFWOpYuwwX/YThH+y9ry9Syau IHXKiRA1gM9sopR3D8A== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX09kBjP5aoX3u MtVJQVyXnx62OMIBNhp2xkRKau9gAAS44Wx984+VrC4dgP0b95utOjqqXlbraQ65Ceg1KlXHrvi 1bjtwyw00UtNz2Q1Y6QyvW+qrH9eoys= X-Authority-Analysis: v=2.4 cv=Zsx4uN7G c=1 sm=1 tr=0 ts=6aaafcf3 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=69wJf7TsAAAA:8 a=VnNF1IyMAAAA:8 a=2qTHi0OtVRMbIpyvczcA:9 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-ORIG-GUID: 7Xdffavw6FG4gibctbO-XWaeCFV2Baj6 X-Proofpoint-GUID: 7Xdffavw6FG4gibctbO-XWaeCFV2Baj6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=farman@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590848784158500 Content-Type: text/plain; charset="utf-8" The ioctl to determine whether KVM_DEV_FLIC_CLEAR_IO_IRQ is present receives the contents of the attribute struct as its payload, rather than a pointer to the payload itself as is convention. This may result in erroneous errors from the ioctl, which would result in clear_io_supported being false when it otherwise could be used (which is helpful in device recovery). Cc: qemu-stable@nongnu.org Fixes: 9eccb8622c ("s390x/kvm: add interface for clearing IO irqs") Signed-off-by: Eric Farman Reviewed-by: Matthew Rosato --- hw/intc/s390_flic_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index f833a3996a..5e6d422fba 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -633,7 +633,7 @@ static void kvm_s390_flic_realize(DeviceState *dev, Err= or **errp) /* Check clear_io_irq support */ test_attr.group =3D KVM_DEV_FLIC_CLEAR_IO_IRQ; flic_state->clear_io_supported =3D !ioctl(flic_state->fd, - KVM_HAS_DEVICE_ATTR, test_attr= ); + KVM_HAS_DEVICE_ATTR, &test_att= r); } =20 static void kvm_s390_flic_reset(DeviceState *dev) --=20 2.53.0 From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590940; cv=none; d=zohomail.com; s=zohoarc; b=FOzXQRflu/9BieO0TmQaPudJpYeriJT8GKw4xXvldMkfwJYwg5oueLgzGdAAq00VVqwvLLZtx1DvEw3+sDStVJRQTrLQODolcorC7lSPsSk82sgv5/govG7+tYIn4QkNNFbSH9P16o/03dKFJgP1jKO/fvoIHqRE6LDwNM1Xh0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590940; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SdT/JrjvbwyWVjNydlot7w+cYAfHbMY4DmT/koQ2fr4=; b=jwo7N1RR5zEfuAY+8yx9mYgfOdO7XClL9APAx4Mds3Zu7qRpQ/CrTujFmQKs5BBudKwySfjr7jH0xYDmMNI6vTTWYoOIySRnA2NJgEKoW0mIkERHQei/tXhSH28YSVEecdMzbvH7tSWZxh60Ty0eHagWMoE72d/yyUt5p9RKoBk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178959094080748.06854805121952; Wed, 16 Sep 2026 13:35:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJi-0007eg-U8; Wed, 16 Sep 2026 16:33:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJN-0007Zg-Eu; Wed, 16 Sep 2026 16:32:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJK-00030l-LN; Wed, 16 Sep 2026 16:32:57 -0400 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1ksR3041641; Wed, 16 Sep 2026 20:32:51 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmw5e6jwy-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:51 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GIxgaG1649278; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4gq03c0b4b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWkbp42205612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:47 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D81D12004D; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BADBC20043; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav03.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 85DAB1613EC; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=SdT/JrjvbwyWVjNyd lot7w+cYAfHbMY4DmT/koQ2fr4=; b=tlETLle5DSdkHLFECTV5PLRoFbJlSnfej 0fbRlPCUD+LqHrhX7kKBo6bZfHWMATXjl6EfwJ/KtsTVnaNe10bnPeOkVxZYDZhb KSbg4PsFiQIr9FcAIpGeCUxgFF6xYi64vL65EK+yCIWLORQc+f/0s8iQ+zT8n868 4RP/8bFRrhLUB7sVZe4ltLljdqJpxkkMiKpfcBUgcH8P5DtMXgmM0QSBJxoJTz+n ZRJ3zSXB+e1/3L1cV4dd45qL7Ms2m2UcxKNJmtmxTrpRpsYzzkNNUYruikvM5WYS WNa6QTonFYQBvcDRwy+vVT+atdKTRrK/kSTNy/atQFlDBjnx6Rr4Q== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman , qemu-stable@nongnu.org Subject: [PATCH 7/9] hw/intc/s390x: Fix check after g_try_realloc Date: Wed, 16 Sep 2026 22:32:39 +0200 Message-ID: <20260916203242.2509787-8-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX6B/hlszrjDkC /4G9hdKjPo6x8VU51FOObXswVKKu4dRwJSvWA8uv2CRVxWrJxEaTLqHFkB03k8fAoETk9nnbnTC UK4rMy+5KPVLBrSn+/x4TWaWl2ZCiUS4a/eOLJaW5YA8SdwY9Qoxo6+Y2MUzJFR2a4As/gjknrK TwBaC0YTXqbPPnmdLouZfzp8hYn2cF+XvA1fbtuW/shz8KjiyV7gBriLQA6wpmoEBGsD/Kha5x7 UsL8px2qh9F9LQateyvn/Jd9wqLHHMBo8yyWyTSwFES7P9VWDJuKOQaqWPglb02F82BctxHxGtc uAwsPd5fd81HcaJRFTEPV1NoCFaAjUmuXCTaupNG+yKzvpki3191lfaVRIDSa5LFF6VMtKK/vXP d7XIvHBMiNnTFn2BlHH7IxgnJ5BmMrtwTCCRzTVpoWkhLFUdWt6H43wctlB3jjiFbmVSUnUmiRo wQumcyEqYiyA7rVAXDA== X-Authority-Analysis: v=2.4 cv=E/NYNqdl c=1 sm=1 tr=0 ts=6aaafcf3 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=69wJf7TsAAAA:8 a=VnNF1IyMAAAA:8 a=ye_SPjtrCc-UUvtwVFUA:9 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-ORIG-GUID: n5-MkZ8TkFUTwuANm1CE7pW5lz480MZJ X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX4Voz3CJao9q/ AVF1nowIzMfGurH7DvErPzFmffAZWLFpRKP4L5zeqWrxf7gTeAwj/jl00mDXvjpj8AR1XMfM5Vb OaHrKdNZz/pO9vmvXOGNforBAoR/Dxc= X-Proofpoint-GUID: n5-MkZ8TkFUTwuANm1CE7pW5lz480MZJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=farman@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590941241158500 Content-Type: text/plain; charset="utf-8" The loop to store pending IRQs uses g_try_realloc() to expand the buffer being used, but the returned address is stored in a pointer-to-pointer. Thus, the check needs to examine its contents and not the pointer itself. Cc: qemu-stable@nongnu.org Fixes: 3a553fc658 ("s390x/kvm: implement floating-interrupt controller devi= ce") Signed-off-by: Eric Farman --- hw/intc/s390_flic_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index 5e6d422fba..ce9c720512 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -264,7 +264,7 @@ static int __get_all_irqs(KVMS390FLICState *flic, } len *=3D 2; *buf =3D g_try_realloc(*buf, len); - if (!buf) { + if (!*buf) { return -ENOMEM; } } while (r =3D=3D -ENOMEM && len <=3D KVM_S390_FLIC_MAX_BUFFER); --=20 2.53.0 From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590919; cv=none; d=zohomail.com; s=zohoarc; b=Mcp3dN3fgz8brNXPM2UOLPAr/6XFgNfZegM1X8lF1alEj6DWb76npRelKCIhNA2XwItwebIu/5kggUQYVZMFX8MPtbfsO+xujhSyjC9lwFakUgNy7jrqBWKtY9C7q6f29bjMdnqvfk5sVRd5pERI97IZOEpvb1BNV4YEYFG29C4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590919; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8AlmYIuwJaaZeD28QGS35kIg0heTMAztLPpHIEvTag0=; b=MZF1E0nalnyPkWP1eOUpiYTCv6nDiyZrkHscfzhTDyYSQ4m91dk+qktScS7nOV4OHgLu9VTTur0tTDG9elrL8XgBsZKmb59xF5aEk062E4D47EL4iuqRAwZTZdnpXowFGW9GKy0QcHUOkYcEh68exaV8q9DaVcJMu4L4R7fXfW8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178959091931021.712805794369956; Wed, 16 Sep 2026 13:35:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJm-0007he-5E; Wed, 16 Sep 2026 16:33:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJO-0007Zm-9b; Wed, 16 Sep 2026 16:33:00 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJK-00030o-Ri; Wed, 16 Sep 2026 16:32:58 -0400 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1lS2018176; Wed, 16 Sep 2026 20:32:51 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmxf56vtx-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:51 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GJ1L131699576; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gq03vgb06-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWlXM37355794 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:47 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E0DFB20040; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C00AA2004E; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 87EC7161426; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=8AlmYIuwJaaZeD28Q GS35kIg0heTMAztLPpHIEvTag0=; b=IYJjphprNMTXMUQqaOtojItjV1JNN1v93 Ex/ASuIOXpqmArzidMLl+UKr80m6b23PBUj5hMeYA8McNLT+C14KIVXLa/nxz2QQ c2x5iyzSzzQfW+7COXN+al49C1PDdE+xI0NA2wcNFMcSXQf1McDGA+n+879+1MlQ 9Aa0vjvS/9KY90RAjEfBQQEfo+rvW1oXTH2+9IWRjnb60CBmWnEsjuwSJJ3Y2Xd5 M4WCwQsWUMkwDbwXOmptUBs0cLX9CiK9aYsXStM7AaPG5KxTKDsnQoc7x+OUwcA4 cPARIvDiNyV88mgRg4nLPQePoUidEJDB2x/2rp5mJtg8qgUf0rDBA== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman Subject: [PATCH 8/9] s390x/css: Expand check against no-data-count CCWs Date: Wed, 16 Sep 2026 22:32:40 +0200 Message-ID: <20260916203242.2509787-9-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Zr7kQ09Est50mcOQaN-ofI9fyAZzd3O4 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfXxcgvXmz86A5P /9gvO5v7qvU5Jh0GGL7/DgOnB2ue0R838jrvP6fRzBNbpKefF90xDjyFkS/Hesn82Xp1EE5XVEn GX3kXw/Oe7dpdCuA6Vmb3oDsJlFnoXE= X-Authority-Analysis: v=2.4 cv=cvgOAF4i c=1 sm=1 tr=0 ts=6aaafcf3 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=7sngsDgIDZXEPo7Uw5MA:9 a=ZXulRonScM0A:10 X-Proofpoint-ORIG-GUID: Zr7kQ09Est50mcOQaN-ofI9fyAZzd3O4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX9OR4KmjYBzdQ pH2jOocmekSpCXJhkIS7YxS6IMuGujDuV8mvcsBHaphlbuzsx+Ja4bR1b73piqaFdlpQmB+g53l +vVvY5sncbbnQYUYNwqXUh+oqXLkMV1b6fkbacs8FZMcZOXVWyfjEDW4CjISZyIkeePH0GHP5gB hsKvmbGzBHIp/3WQWCVsdfHw7W22TCxSCYiaGNj5Yi4W9akZuJ0DV7X2AFF4zKXSEEZJj9zll2H 1y9lxeDEstekzabPaqQuBkhZe9adCb8CxvNQfJGteV0Ntnbppz4eMOBAWn6Yx8nlW8g7kWfLFMh wzoBpFT37/nnTP22GO5D/z5eBj/G5zn7tBXIAv8lqeqAc7Woy3MJx2uklwNdnJi8OcmaeVzuRkp U7Coiy9bcnt1Fvwwei4SJPU8JAVQB0/pPw6LGcNC5bm1cX/Ck56djn7jXES7SOT377O9Ou7utBD WKESKFMdJ1oKl3jYGmw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 bulkscore=0 impostorscore=0 phishscore=0 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=farman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590921201158500 Content-Type: text/plain; charset="utf-8" The channel subsystem will reject channel programs that incorporate 256 CCWs without a data transfer, but the existing check for this does so against a data address of zero. Expand the check to include other CCWs that are valid but would transfer no data. Fixes: e8601dd5d0 ("s390x/css: catch ccw sequence errors") Signed-off-by: Eric Farman --- hw/s390x/css.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 9da9128d88..c38549c7be 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -1016,7 +1016,9 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr cc= w_addr, =20 check_len =3D !((ccw.flags & CCW_FLAG_SLI) && !(ccw.flags & CCW_FLAG_D= C)); =20 - if (!ccw.cda) { + if (!ccw.cda || + (ccw.flags & CCW_FLAG_SKIP) || + (ccw.cmd_code =3D=3D CCW_CMD_NOOP)) { if (sch->ccw_no_data_cnt =3D=3D 255) { return -EINVAL; } --=20 2.53.0 From nobody Sat Sep 26 20:50:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1789590848; cv=none; d=zohomail.com; s=zohoarc; b=ldDSgmwhxrajFzbSs/Q5yWuiuFuDr04cHVtDtq8vy1Q6yBqrV2Me5vTjdmhqr/UanEij7j+IT3PoQBTi0L6CUk6CPT+LT95TRUnt3z4jWFXWwYf4DEJAEVtP9jcaJsC+BUVfzR/xvUHORn+igRJYez9kPeiKkmS0zlr97ZTiM7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789590848; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EMisayS6It8I5HN7vcfH++6z3hgrRUbfICDyq1tEkSQ=; b=SzQ6uPKEFANbFwVxR6A1H5tqWClUhzYpRpEw/p8FP6iXDvDGE2/KkJvbCHG2Sg6VYvukwa5jz1Bd/p7MwZ9oQtJ++qeXtfsvzWiAVIR5r48x+0AFX9FZzPSkF1dzwcEuZIsDlPYpyhf1g7Hyjo41RSwXamJbgCBGeca0BCZSWHI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789590848824537.7556298552643; Wed, 16 Sep 2026 13:34:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6wJb-0007bq-NJ; Wed, 16 Sep 2026 16:33:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJN-0007Zj-OC; Wed, 16 Sep 2026 16:32:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6wJK-00030u-Qt; Wed, 16 Sep 2026 16:32:57 -0400 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68GG1ksS3041641; Wed, 16 Sep 2026 20:32:51 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gmw5e6jwx-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:51 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68GItIb71699556; Wed, 16 Sep 2026 20:32:50 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4gq03vgb07-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Sep 2026 20:32:50 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68GKWl8B15335822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Sep 2026 20:32:47 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F2B7A2004B; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C79EF2005A; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with SMTP; Wed, 16 Sep 2026 20:32:46 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 89F8B161427; Wed, 16 Sep 2026 22:32:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=EMisayS6It8I5HN7v cfH++6z3hgrRUbfICDyq1tEkSQ=; b=XYwWy0YJ/TXTZKl/mRQZNgSpew+1gAUsM 5Nw89DUwf/C+wK4FVSkiYUKI4iit93LIYwhbeKiwp+o6dfvyoRq62mmNcnD2TbCE Qp95Y5r9L4fktju2u3rX48MzIVxFBUQh1jgiZCKOQYkOLlbvaVipRCyDFnq5jU7c GYitH72fohrdelNRkM/2Hat8/xojvHMQISFBjXiGNfzTHNUyCAVxtsQjDrX32ckr BoRgyGSAzUeNFpoRMLrWxXriY0mvZvCFPtYilNb9uk34vZPPlMY63A7I/ONEG56G nD+WdSbHasVVfkSnqpHjLeC+p3AP4SF7VazqNIziexABmSm0ZAu8w== From: Eric Farman To: Christian Borntraeger , Matthew Rosato Cc: Cornelia Huck , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Eric Farman , Janosch Frank Subject: [PATCH 9/9] s390x/sclp: Reject short headers in PV case Date: Wed, 16 Sep 2026 22:32:41 +0200 Message-ID: <20260916203242.2509787-10-farman@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260916203242.2509787-1-farman@linux.ibm.com> References: <20260916203242.2509787-1-farman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX2rl8hdUMBZRe NvenR1tJaHIXCYl4eDYT4SJhdDpejk/e7zQnj2EHpXWemdxvV4AtEergWwfgWT/2TGa8iRdj5e8 hkzmXCChU00otCypHhXGdSGnw/s5nNMkBlwulsNAV+8EXBrhTfH2f7MStGbdJidN6VPculH69hw FXFaRnveQJAplHsxXSMrEgcVe28VuxhJAhqns431lrbz4jzTPjgtW3yYWskR0yP5rgUN+NEza4t 3dTKUqT362ltxT72fABOXXnYZ0yS+r6qIe4SS7wDKnSbR+OL7HD1U9FsOfRtqYmQrUKC6Qt2cZ4 p+eIB9AOUakp0lhPxI33Cpj0yvf7WfUnh4SBHTBYYxDhv8TW8cH2ftuhuN1p7G8m2/Vr55breh+ PKXtmE72LpdG5xqWk8GFzJjOPBcP7yXpEYuFC0tdX7QPF3zkNGAKt7SvGG24S5vLrPbXDGHSIzx mnQ7hP1fmECXNodptkA== X-Authority-Analysis: v=2.4 cv=E/NYNqdl c=1 sm=1 tr=0 ts=6aaafcf3 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=VnNF1IyMAAAA:8 a=pH6oLB8u_88KfPtTI8IA:9 X-Proofpoint-ORIG-GUID: hKZTJsKM73MynN4ruFk85WBdjFAYQAm3 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE2MDI4NSBTYWx0ZWRfX5Njks9/kL8aG LIfLBVLF69MkSDgTalVe5gzdzEpkMh9Gujo7GzSGibTGOlbmDI2yEIXBMiy0PV8TGCH+sOtC60L I5KanKWb0y3+6JXfFx4yvQkhqBR7/8k= X-Proofpoint-GUID: hKZTJsKM73MynN4ruFk85WBdjFAYQAm3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-16_03,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609160285 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=farman@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1789590850739158500 Content-Type: text/plain; charset="utf-8" An invalid length in an SCCB header correctly generates a specification exception for the regular (non-PV) codepath that processes an SCLP instruction intercept. The PV case doesn't, even though such a thing should already be sanitized. Since a short length will cause problems later down the line with the storage that will be allocated based on that size, put up a defensive check and return if it is too short. Cc: Janosch Frank Fixes: c1db53a591 ("s390/sclp: read sccb from mem based on provided length") Signed-off-by: Eric Farman Acked-by: Christian Borntraeger Reviewed-by: Matthew Rosato --- hw/s390x/sclp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index d8b655efcc..ad8129a5d8 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -277,6 +277,11 @@ int sclp_service_call_protected(S390CPU *cpu, uint64_t= sccb, uint32_t code) =20 s390_cpu_pv_mem_read(env_archcpu(env), 0, &header, sizeof(SCCBHeader)); =20 + /* Do nothing if the header appears malformed */ + if (be16_to_cpu(header.length) < sizeof(SCCBHeader)) { + goto out_no_write; + } + work_sccb =3D g_malloc0(be16_to_cpu(header.length)); s390_cpu_pv_mem_read(env_archcpu(env), 0, work_sccb, be16_to_cpu(header.length)); @@ -290,6 +295,7 @@ int sclp_service_call_protected(S390CPU *cpu, uint64_t = sccb, uint32_t code) out_write: s390_cpu_pv_mem_write(env_archcpu(env), 0, work_sccb, be16_to_cpu(header.length)); +out_no_write: sclp_c->service_interrupt(sclp, SCLP_PV_DUMMY_ADDR); return 0; } --=20 2.53.0