Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp283603pxb; Mon, 13 Sep 2021 19:22:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTGs7rGH9v9TUaqDJaQuWUsvfWqP9od7MxFp7CrdiW04KdPw61IVd9zPZx9LLxgz9vG/Gx X-Received: by 2002:a92:2c0d:: with SMTP id t13mr10115695ile.99.1631586154393; Mon, 13 Sep 2021 19:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631586154; cv=none; d=google.com; s=arc-20160816; b=BvmP0sXRcPR37vca4wvEIbPe2TS/Ka1vTEYyXV9iAGMmfGSDRiVFDwNZCRYXGZvllR DnUbQsE5GIdmS92LrjqneDGjYRJon5rfejin8QxubougJExo/zspJehbISg6N1WogJqC k7CpQluOfs4ahH43k4wGWyB2lt+c+uC5s4JihcWJklDWpK/4HXD41ZY/c5oOT8pKUAeb lszA2A045Hax5+dAmlYoby+c5ClvcQihmivpAjCRD9U/MzmVB1wZ4nI/wfAd466CSC3a Lv/WGfsMLuglnwkHvMt5dvMg/la9O+0zIXRdeN728jgtreN20ukSmuULZOvLZ5QBVwCV T2Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:cc:to:subject:message-id :from:content-transfer-encoding:date:dkim-signature:mime-version; bh=QoLIOI/r8M2fowTTekfDxFkvj7NLl9iwu+uZKG1Y57M=; b=kxsOaqhrkyDHBd6Dklg5ot5q9MDNBS2Q3kSwmYzZOal0KgJe9SfJWKtZfObxHuX3AT t+Qti0dIMgGUsR3X/VgtEZO56V66NOdx+Tgy6dGqvPV5FpYI8wan4b7uW1QFksy1fGVS nvtuvqUsP4DKVNdqiXLTlh/df8hLAhMAulO882443z9FQJooa0iP3eCmAuypT7OvJxmT g/qiY+nBOPdkVVOtGJxO+jvhaaazFrwc0ZanUCA3kFsIG7+yrisA2lfglCIwa3Xolmau QbbQc01C78J6w7RC2F7+cu9ekUTJt2t0yLCZcJazG0Kf2yMwtax0nCn/VOUOkX5UnAru x5vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="EO/va6LX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si8284094ile.58.2021.09.13.19.22.23; Mon, 13 Sep 2021 19:22:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="EO/va6LX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237393AbhINCWk (ORCPT + 99 others); Mon, 13 Sep 2021 22:22:40 -0400 Received: from out1.migadu.com ([91.121.223.63]:62342 "EHLO out1.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236565AbhINCWh (ORCPT ); Mon, 13 Sep 2021 22:22:37 -0400 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1631586079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QoLIOI/r8M2fowTTekfDxFkvj7NLl9iwu+uZKG1Y57M=; b=EO/va6LXViFeaWJSXt7yLDpgRcXFpmXCBuB22n7/SLVd4pSgdfDwUi+LcGBsEBnK7kWewd kWmpLe/ZGdjY2Pd/N1wqMKQodXIMAX6msmhybg/9+J1ABCpGqyUDExozM8pJSWuRYHyHP3 H5CgBCnzKtjtCGGr7L0Xdr5CiO79MR4= Date: Tue, 14 Sep 2021 02:21:19 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: yajun.deng@linux.dev Message-ID: <2a95994f251db7d1c5d3318f4468b324@linux.dev> Subject: Re: [PATCH] Revert "ipv4: fix memory leaks in ip_cmsg_send() callers" To: "Eric Dumazet" Cc: "David Miller" , "Hideaki YOSHIFUJI" , "David Ahern" , "Jakub Kicinski" , "netdev" , "LKML" In-Reply-To: References: <20210913040442.2627-1-yajun.deng@linux.dev> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: yajun.deng@linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org September 14, 2021 12:15 AM, "Eric Dumazet" wrote:= =0A=0A> On Sun, Sep 12, 2021 at 9:04 PM Yajun Deng = wrote:=0A> =0A>> This reverts commit 919483096bfe75dda338e98d56da91a2637= 46a0a.=0A>> =0A>> There is only when ip_options_get() return zero need to= free.=0A>> It already called kfree() when return error.=0A>> =0A>> Fixes= : 919483096bfe ("ipv4: fix memory leaks in ip_cmsg_send() callers")=0A>> = Signed-off-by: Yajun Deng =0A>> ---=0A> =0A> I do n= ot think this is a valid patch, not sure why David has merged so=0A> soon= before us reviewing it ?=0A> =0A> You are bringing back the memory leaks= .=0A> =0A> ip_cmsg_send() can loop over multiple cmsghdr()=0A> =0A=0AYes,= I forgot the loop, it was my mistake.=0A=0A> If IP_RETOPTS has been succ= essful, but following cmsghdr generates an error,=0A> we do not free ipc.= ok=0A> =0A> If IP_RETOPTS is not successful, we have freed the allocated = temporary space,=0A> not the one currently in ipc.opt.=0A> =0A> Can you s= hare what your exact finding was, perhaps a syzbot repro ???=0A> =0A> Tha= nks.