Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4141999ybi; Mon, 27 May 2019 12:02:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMrpHVKIDruYq7iPXrAe0FUSmDDsRhwOpBajgbydLbxr32gC+nFR+aDC8JSXfJYg8JkuhG X-Received: by 2002:a17:902:24c7:: with SMTP id l7mr80545295plg.192.1558983763954; Mon, 27 May 2019 12:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558983763; cv=none; d=google.com; s=arc-20160816; b=AScODJyMtdTjlDpmAfRjY29gtEW5Nile739YdbkRnhh+zIJ0I60dxhYdGzYL9ufsPn cJ0m5ljgNwBuRi+aYCThGaP/MkYnEtyulojl2sm1jgPBEIFr+hGkerTLeLcVP4MCN2GT LUTLyKxpgg7UY9DY7u4iHukR+dBRAVTdeZo3F5A2i9EpGLtEmSoYh033Jn41L4APTk9K WMTfhD3O13+N8td+TskuTPCrEptvpiHSxgWl7in/mspR5Oxk0bPT0d06XuuFMMWZNkMR hxWl7V9kNJOvVUW3ZXOb6zhX41UJgGsqdeVAwAUxtYKN34n7HsOQPc6c3QEvnzcPwagJ sL3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NEedJ91P76fWFabZlx9m2Oa4YrrKHooD1Fxf5CcjGNM=; b=TwOVsrUg3mivaHDiaof0Ei00LsdHQtzRXmmtlC+mFD3kdI6JoiZtCtxR3hMXDFT4nt vZSfWSLlw3Xx58VaQ7J5wRqZsuju/+YY5iukoz/4HOQYg4szpiVQMk8JgRGL6mFmYp9v X8gVuahWtGi/0RfS4M1AhJq9Sxvurtk8tWhyXhmqo39sK71Lh56T19Qs6w4bG5bQ6RBk pfHgmmgyHHR4QECuRMvW6BigbOVYEPOXhF4i4w5wAb+EVwU+ytgX9wU8tAArBRmXuuuf ESgv1ay2/5pGizytAf5kJj+79MLd6A+VDB96pNGSI6ZavnrisFNc9bMHMlAh1H8zbnv9 WlVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cn6si19102812plb.374.2019.05.27.12.02.28; Mon, 27 May 2019 12:02:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727355AbfE0TAA (ORCPT + 99 others); Mon, 27 May 2019 15:00:00 -0400 Received: from sauhun.de ([88.99.104.3]:35882 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726484AbfE0TAA (ORCPT ); Mon, 27 May 2019 15:00:00 -0400 Received: from localhost (p5486CF59.dip0.t-ipconnect.de [84.134.207.89]) by pokefinder.org (Postfix) with ESMTPSA id A09DE2C04C2; Mon, 27 May 2019 20:59:58 +0200 (CEST) Date: Mon, 27 May 2019 20:59:58 +0200 From: Wolfram Sang To: Yingjoe Chen Cc: Jean Delvare , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com Subject: Re: [PATCH] i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr Message-ID: <20190527185958.GB8808@kunai> References: <1557238832-10723-1-git-send-email-yingjoe.chen@mediatek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TRYliJ5NKNqkz5bu" Content-Disposition: inline In-Reply-To: <1557238832-10723-1-git-send-email-yingjoe.chen@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 07, 2019 at 10:20:32PM +0800, Yingjoe Chen wrote: > If I2C_M_RECV_LEN check failed, msgs[i].buf allocated by memdup_user > will not be freed. Pump index up so it will be freed. >=20 > Fixes: 838bfa6049fb ("i2c-dev: Add support for I2C_M_RECV_LEN") > Signed-off-by: Yingjoe Chen Nice catch. Applied to for-current, thanks! --TRYliJ5NKNqkz5bu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAlzsM60ACgkQFA3kzBSg KbbrPg//afgtgokT56fLVAUimGKtp43xzDIQTphV9hSrj6qPYR0k56cR1pHzIusn 2CI1BMettrTAASHv6klyeQcSJzoNDEJLwc3zWgPnMEARpTOaqc7IeptQfS0qNMkJ a83IE5Wvhl/w8dDINSxGqXOiMOIsYQ1fVHXYxB+9iaWM2ptxsCidWl5G+6hXUTn1 wW3icZKaPALroV+TlvlyFIp1D+WhkrgWf/Dt2t5xe4kvnO4Z7dAvdBKvzMh9ns61 zR/F9g0j8044RWSPzIm/uw7yvoamv+haq2f6P6k8aEvlt/R4HnsWSB440uZinZvy JGjn+XskfNUny0rQsWn7L8b7Avigx5bJSS5DCNeL8TUSIu4qCaBv3GSJAMd/IId4 u8Hfs2efh3xVY8szRzl3Cw2UT92Alhg5Y0+IQK2iSeEovnKiH9asyQU7FPbDLEeO L10vkNMEKz1WsAOmDr+MTf7qjER6sYoECehEnn2doOE9Cvsy2K8OmrLXZ5lnQ4zl w30FOYcZWdohFjMBYFOtZbL785pReQ/5dAPJlNUNPdbWU3FMfNhtylcbhCc4KJVV Yu0NvSTfN0fKHtfEpdB6VTsecRw7tjZogVXUvoecos8SKRd+J6n18j0QXBeR2BRx kUdKKAQWKwTi9U/bFlwHsXGW0yJRJL8w8Z6utUXJ/xPmNXnQsRI= =VNJn -----END PGP SIGNATURE----- --TRYliJ5NKNqkz5bu--