From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AEFA14E2CC for ; Thu, 25 Apr 2024 18:47:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714070826; cv=none; b=LyP7MNXrszjQ3aUd/OQS7SedGAfZzXcMkeThqf5mxd9LbS3Wtsknnn0H9nsz0ZiKI+30L7I7H+iYB00UdULoF+fWAgu0OyaGEW1j4+4NnuLVs6yZOHQHrQ7J4uMe/Im9WrhDREFtzZJGHPUGjR4teD95fnzlifEHUO78neGP4R4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714070826; c=relaxed/simple; bh=kOhpakvYf08EPjB71ahhoVsLQyFkjn3TrcLEzDp72jc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=LCIMItR5rStawilXfIRfxIk+UE3HcSbEcAav1T6qZzxmJlqoLOoCjgBVDvhLJzNSf5H+91D2Kj05cIWSe8kTHB6hlN0TUC3IUGQygppd3PWsXbUGqs/2sxC3nQU39vk7+dKrhqiGItNGFNmBTDvyvuI3H+7KFOz98CACNpjGmms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=EkWk0nZF; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="EkWk0nZF" Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240425184657epoutp046f2c493667ebe7411d818bfac29cfbbc~JmlOb3-TQ0315103151epoutp040 for ; Thu, 25 Apr 2024 18:46:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240425184657epoutp046f2c493667ebe7411d818bfac29cfbbc~JmlOb3-TQ0315103151epoutp040 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1714070817; bh=8UjWzASLbE281aLekYBWGcVUrDYfR/50j9EjsKMziS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EkWk0nZFFZR+UZPyMT3GvkvBnqBu8Ir0x2eKAXzvLVPGuZ/zaYZ+XLZ7vPDMFrndK 6CdiDg98Eole7XqWegqjEo7GV6nC2/+lY+bGx1B+3vcv1aJyLaabEr11jwQbyHz0gl p5rjRcNhC0GFBvJAB2wyJTeFCvDRtSEHAH+HkE3g= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20240425184656epcas5p35ee096051f0bbb21f8542a38aabb4ea6~JmlNhW5YC0824808248epcas5p3h; Thu, 25 Apr 2024 18:46:56 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.177]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4VQPwG354Fz4x9Pp; Thu, 25 Apr 2024 18:46:54 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id A7.20.09665.E15AA266; Fri, 26 Apr 2024 03:46:54 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20240425184653epcas5p28de1473090e0141ae74f8b0a6eb921a7~JmlLj1-nc2219922199epcas5p2p; Thu, 25 Apr 2024 18:46:53 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240425184653epsmtrp15999b231b11a167202adf9a316909721~JmlLjFbN_0085200852epsmtrp1N; Thu, 25 Apr 2024 18:46:53 +0000 (GMT) X-AuditID: b6c32a4b-829fa700000025c1-13-662aa51ea6f3 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id F8.F0.07541.D15AA266; Fri, 26 Apr 2024 03:46:53 +0900 (KST) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240425184652epsmtip15304991c802986bd2c08f53595bdaacf~JmlJv392M3082730827epsmtip1Y; Thu, 25 Apr 2024 18:46:51 +0000 (GMT) From: Kanchan Joshi To: axboe@kernel.dk, martin.petersen@oracle.com, kbusch@kernel.org, hch@lst.de, brauner@kernel.org Cc: asml.silence@gmail.com, dw@davidwei.uk, io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Anuj Gupta , Kanchan Joshi Subject: [PATCH 02/10] block: copy bip_max_vcnt vecs instead of bip_vcnt during clone Date: Fri, 26 Apr 2024 00:09:35 +0530 Message-Id: <20240425183943.6319-3-joshi.k@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240425183943.6319-1-joshi.k@samsung.com> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHJsWRmVeSWpSXmKPExsWy7bCmhq7cUq00g1k3BC2aJvxltpizahuj xeq7/WwWrw9/YrR4NWMtm8XNAzuZLFauPspk8a71HIvF0f9v2SwmHbrGaLH3lrbF/GVP2S2W H//H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XeA7+1/apefdfkosxRmJhlrMRcWJAG8TR5QIAwAA X-CMS-MailID: 20240425184653epcas5p28de1473090e0141ae74f8b0a6eb921a7 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240425184653epcas5p28de1473090e0141ae74f8b0a6eb921a7 References: <20240425183943.6319-1-joshi.k@samsung.com> From: Anuj Gupta If bio_integrity_copy_user is used to process the meta buffer, bip_max_vcnt is one greater than bip_vcnt. In this case bip_max_vcnt vecs needs to be copied to cloned bip. Signed-off-by: Anuj Gupta Signed-off-by: Kanchan Joshi --- block/bio-integrity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index e3390424e6b5..c1955f01412e 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -622,12 +622,12 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src, BUG_ON(bip_src == NULL); - bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_vcnt); + bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_max_vcnt); if (IS_ERR(bip)) return PTR_ERR(bip); memcpy(bip->bip_vec, bip_src->bip_vec, - bip_src->bip_vcnt * sizeof(struct bio_vec)); + bip_src->bip_max_vcnt * sizeof(struct bio_vec)); bip->bip_vcnt = bip_src->bip_vcnt; bip->bip_iter = bip_src->bip_iter; -- 2.25.1