Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp3067691rdb; Fri, 22 Sep 2023 18:02:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEg5tDsJd9o13z29AlN1h09whfAi3MHAzRLtCKqm+2ACcqq+4rD+ZXv0DP58hThI/40EACu X-Received: by 2002:a05:6a21:6d90:b0:151:35ad:f331 with SMTP id wl16-20020a056a216d9000b0015135adf331mr1916322pzb.14.1695430927358; Fri, 22 Sep 2023 18:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695430927; cv=none; d=google.com; s=arc-20160816; b=iDJx0MXCF51fkHgfvbHlNi6fJzC0EDlky5tLAec1uEC+HJZCIs3THbri8otT7fwdUd mZp6ZKv/L1Hvj9V669olVCfh3YsBkv+Vz1xzS9qh5ZALC9Kd7pimficuD7ygapuyFqAC RDVqlFu5Yp0kssAIQjRo9PdmjyIxqzC6D5JPDH0NggWkAYsd+jDlp4VThPYafRXLyEFr okQSusHene7qEOZdY7nufP4qId99uA9bTDo3jEJMmigzQRGvpUb0koG8Za9G6EdtnO95 RUMeLMITFqIzbOliMuuaCeadztIabCMB80qVsyJoABGstj59A639Xuo+H5OnExeQmRFJ GiVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=HVfyxw/Kl8/+TQQ2WdC9XhJKmxyl8eQRXxHJLzVysuU=; fh=TCi0P1kKXurXltcooQyKpudq/FuQKfH7o/MogUdNz0w=; b=gbtJ6iCi1WvDp4/uaS7dtacPmmzRdRWkzCjxCujzd2jqQOHY9Wuf/q5iQJ8QyZpvJJ 2jJEPb1zUSsEDB7Je+ddSnS5x0VALT925zxFXBCUU/tB9jLO30YmD+FQ22i5Itg2zKhq pAfVCpXFwXMg/lGQS/YEs25DYj62H2MJLZPlvgn6u/HH3WrBNKLQUi7bP3PXZn3AWyni 7fBTLHtpW0IgR4HpSVEELAhF2kQyj4V8OCIjeBW0ZBsd4nROc4niZKrYLvFAL1ENILc0 2lwQTm4Ei7ECosiWWal4Jycx3KzwF+wW7OdYGwfSXaIQfhryb4N0RTfLkfM6HfmRp3n7 sANw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=c0RLGFRn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id h3-20020a056a00170300b0068fcc67e73asi4962931pfc.18.2023.09.22.18.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 18:02:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=c0RLGFRn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 117A583C637C; Fri, 22 Sep 2023 12:16:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233461AbjIVTQC (ORCPT + 99 others); Fri, 22 Sep 2023 15:16:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231226AbjIVTQB (ORCPT ); Fri, 22 Sep 2023 15:16:01 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 356AAAF; Fri, 22 Sep 2023 12:15:55 -0700 (PDT) Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38MJEKcZ021852; Fri, 22 Sep 2023 19:15:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=HVfyxw/Kl8/+TQQ2WdC9XhJKmxyl8eQRXxHJLzVysuU=; b=c0RLGFRnxuoHtZEx9SRZj41qa6wGhBFHyPBp2xi8NahLKm60TYAl+DsraQioXS5TLFIw cZgldxh7aUN4/MDIbGO8pS/i4gzFEMtfo4Q6u1QAiUgDJW+DDN0h/HCPqGm1q5y0456Y tPpaoq8FdshCojJotVy9jzZU9QwhlaIoY8KUvmEgSmItMnQj597OKFjCJAsUMvSwhqo7 r18+Q7ahfeU9Eolbp6cVgWgKKEIB/cUg+iAisiTeHu8w6hoSRkHOg9g7qALEBVEtTF1J cBKDEmnA0kChtZcN4jiCIrvRolhT+bYNM3Eto0ttlh9k8oLS3rZJ1aoju69GLTN16vv7 eA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t9gwdr110-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Sep 2023 19:15:54 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 38MJEMCN021963; Fri, 22 Sep 2023 19:15:53 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 3t9gwdr10n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Sep 2023 19:15:53 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38MIb30H029794; Fri, 22 Sep 2023 19:15:53 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3t8tsp764k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Sep 2023 19:15:52 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38MJFnLj27198148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 19:15:49 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D047420043; Fri, 22 Sep 2023 19:15:49 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2F82A20040; Fri, 22 Sep 2023 19:15:49 +0000 (GMT) Received: from [9.171.40.202] (unknown [9.171.40.202]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 22 Sep 2023 19:15:49 +0000 (GMT) Message-ID: Date: Fri, 22 Sep 2023 21:15:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH] s390/cio: Fix a memleak in css_alloc_subchannel Content-Language: en-US To: Halil Pasic , Cornelia Huck Cc: Dinghao Liu , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Julian Wiedmann , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230921071412.13806-1-dinghao.liu@zju.edu.cn> <20230922141700.10895474.pasic@linux.ibm.com> <87sf76z961.fsf@redhat.com> <20230922152035.3ef1cb7e.pasic@linux.ibm.com> From: Vineeth Vijayan In-Reply-To: <20230922152035.3ef1cb7e.pasic@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: xDptwDPUkk6uTTiLnmC_34Hzon01rhdX X-Proofpoint-ORIG-GUID: PiT7fz-S8xg7tnqFFWmCzPbK8SBCe1xC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-22_17,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 adultscore=0 bulkscore=0 mlxlogscore=725 malwarescore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1011 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309220164 X-Spam-Status: No, score=1.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 22 Sep 2023 12:16:08 -0700 (PDT) X-Spam-Level: * On 9/22/23 15:20, Halil Pasic wrote: >> Author of 2ec2298412e1 here. If I don't completely misremember things, >> this was for the orphanage stuff (i.e. ccw devices that were still kept >> as disconnected, like dasd still in use, that had to be moved from their >> old subchannel object because a different device appeared on that >> subchannel.) That orphanage used a single dummy subchannel for all ccw >> devices moved there. >> >> I have no idea how the current common I/O layer works, but that might >> give you a hint about what to look for ???? > Yes, that is what the commit states and what the series is about. I hope > Vineeth can give us some answers ???? maybe even out of the top of his > head... If not, I would trust his judgment on whether figuring things > out is worthwhile or not. > As Corny mentioned, orphanage is the only case i remember where this scenario of dynamically allocated sch->lock being used. I hope you remember the cdev->ccwlock, which is nothing but the copy of sch->lock pointer. This is rather a tricky design, where we are using the sch->lock and cdev->ccwlock, which are same pointers. Because this sch is exclusively for the cdev ops. But at the same time, a CC3 code in the stsch can make the attached device an orphanage and remove the sch. We have already seen an issue with this approach and had couple of discussions about avoiding this pointer usage without using an extra lock but do not have a right solution for this now.