Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1075449rdb; Sun, 7 Jan 2024 02:27:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IG67EYXD9AqI+Fooe02t9XBL+H3amcPnCZKRnRaac9ObwJFUwFYulFAL9RqbODmK/CDhYPY X-Received: by 2002:a05:620a:1082:b0:781:31cd:41bf with SMTP id g2-20020a05620a108200b0078131cd41bfmr2726550qkk.120.1704623228681; Sun, 07 Jan 2024 02:27:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704623228; cv=none; d=google.com; s=arc-20160816; b=tZskB6yC8Rs3lO8wmaf0ChxWXLJr3JdPuZFo7QAlt6JxoZ/Xiax17abbGx96JVf9qz GqLO83zcnnqI8JX/lXDGZ84cNwIbId1gV4AgWMmlmpoMXbloKMZxSxeEmYG3GcoD+2FD ivT0opD08kygjhEKSRy/VE38mYWeGRippUEnZ0mJ9ubynTkMfC8oG73IMBVRUn66rdUj TIbHQMp5Iqc462euZF7VSG6iuFdGb+zm6RgHQAWFkToC48zrqYjOrByP3w11aP7mnfCZ nRYYFaWOnW6A+7xuP0Aa0EV0vthW/IdwbOj0onKiDItOvCJwBTjM1LDKK6NnEaDESeED vMJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=Ga6+A9cwq7fuTFNzHnNcQM73H/BQTgpX+VIIomVa33M=; fh=lqGz1FLdZite76lSpX9vPbx7u/BS5CF//xahFGS7jjw=; b=cN8VJvyvFU3EzZjUqIv0ULXknr7LMIEHfnrA8a7LrVQi2MoXMpCGhKO11f4xmfkarr FQ/S2tPb9e1CHIz4o6dfbSC55ymDWeP74evL7A2ypxtH8ttrkPesg2zNWKgl54a/JBEZ 5h6vvILI7E/sznWTRZjcHRyhTk6hIFJsJFN7zULutyxeqYXTpGCPO1xVbvktfHWLWFKl mBa4s2Jgq+gEuwpCyJWSr2UMF376SIb2BAxm7D/mAIkVDQX2YmfpF1hPc5ijGmVKdlqZ u8SeC/dAj5m6V07aTvDl+AvAWuftIx3BEYVWZgJO9vCB9Av+bWO+xuMmSHJokjQkYrXt lSew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=cCAh+KaV; dkim=pass header.i=@codewreck.org header.s=2 header.b=2IydRGWO; spf=pass (google.com: domain of linux-kernel+bounces-18833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18833-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w23-20020a05620a0e9700b007831806c3a7si1722710qkm.758.2024.01.07.02.27.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 02:27:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=cCAh+KaV; dkim=pass header.i=@codewreck.org header.s=2 header.b=2IydRGWO; spf=pass (google.com: domain of linux-kernel+bounces-18833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18833-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 632BE1C20D4E for ; Sun, 7 Jan 2024 10:27:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1EAE12B9C; Sun, 7 Jan 2024 10:26:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.b="cCAh+KaV"; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.b="2IydRGWO" X-Original-To: linux-kernel@vger.kernel.org Received: from nautica.notk.org (nautica.notk.org [91.121.71.147]) (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 BA9DF12B84; Sun, 7 Jan 2024 10:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codewreck.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=codewreck.org Received: by nautica.notk.org (Postfix, from userid 108) id 9AC1EC020; Sun, 7 Jan 2024 11:26:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1704623208; bh=Ga6+A9cwq7fuTFNzHnNcQM73H/BQTgpX+VIIomVa33M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cCAh+KaVsTqWTJZUlpjJJHi5l02ZixUhXOfMchd8cNdp+ugjbyB9f7rV8UTp1whjA argbE6PPo3bR6DKN9rpCkAWmXVlfRytioNOq2DF3Jyh1hxxme2g/Sse9BK2tuKCHYc m65FJfuFHnP+yvuTE5+eaSaA1cYJ5fwALp8bu1lDf3CtEhzFSf2un03moUMtZcGXNf IbWYCqKqctVPtJmeNhVYEXF+dROSwIyrEUhLdy15OC0i38amOAjffoJLZbtC+O5m2u rpdAXwRkoVpNDH+J1I5rZAybH47NqVBYJurH85vTNzgJ6TyQpHC/l7IQE4Ez3AgDli fHb5UrH1GMSgA== X-Spam-Level: Received: from gaia (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 41EAEC009; Sun, 7 Jan 2024 11:26:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1704623207; bh=Ga6+A9cwq7fuTFNzHnNcQM73H/BQTgpX+VIIomVa33M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2IydRGWOTysQ8G6+EBZMnwsgxmp1yOF+lpkxOPTa37yMiOLo3QRmRmvM1NVicBVTM oY6lMGpPXie7JITYpogkmL32qOQ78/xOrB/4/F9994kz0kkelOstUzkVwa1tDnZS1Q 4aWfArX+USObNxrWQKBEFXxjM/ys9k2ZdGQ5/UbuKhQv2A6aWW3fMx9u4Db5JhsFUt yg7x56RjFRhzkAB5KgbBnXaScOPjeU8x8/0rm/HsJweVasvQAqghykX9mT5/b+m5qJ ra/ZcmHJSFcGfO36CEo3fVy0C/uau0qPuLmeeHK82/Xrj7qgQI/3ploPaZA/uuym69 A/K3VPjwJnW6Q== Received: from localhost (gaia [local]) by gaia (OpenSMTPD) with ESMTPA id a0446c8c; Sun, 7 Jan 2024 10:26:39 +0000 (UTC) Date: Sun, 7 Jan 2024 19:26:24 +0900 From: Dominique Martinet To: Vitaly Chikunov Cc: Christian Schoenebeck , Fedor Pchelkin , Eric Van Hensbergen , Latchesar Ionkov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , v9fs@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: Re: [PATCH v4] net: 9p: avoid freeing uninit memory in p9pdu_vreadf Message-ID: References: <20231206200913.16135-1-pchelkin@ispras.ru> <1808202.Umia7laAZq@silver> <2et72smsvglzicqsyvt5m7bx2akyqzi2moq7tjupppygbsme3u@o2sltttok5wy> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2et72smsvglzicqsyvt5m7bx2akyqzi2moq7tjupppygbsme3u@o2sltttok5wy> Vitaly Chikunov wrote on Sun, Jan 07, 2024 at 10:56:23AM +0300: > On Tue, Dec 12, 2023 at 08:21:30AM +0900, Dominique Martinet wrote: > > Christian Schoenebeck wrote on Thu, Dec 07, 2023 at 01:54:02PM +0100: > > > I just checked whether this could create a leak, but it looks clean, so LGTM: > > > > Right, either version look good to me. > > Also, there was unnoticed bug in v2[1] - `int i` is moved to outer block > and `i` counld be used uninitialized inside of `if (errcode) {`. Thanks for pointing it out; I'm not sure if it's the same thing Christian noticed but I believe what I had applied with his suggestion of initializing i worked either way... But this is moot since I updated to v4 afterwards: this v4 has been merged in 6.7-rc7 as follow: https://git.kernel.org/linus/ff49bf1867578f23a5ffdd38f927f6e1e16796c4 (the message-id also points to the v4 correctly, e.g. https://lkml.kernel.org/r/20231206200913.16135-1-pchelkin@ispras.ru ) Thanks, -- Dominique Martinet | Asmadeus