Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp778340ybb; Fri, 20 Mar 2020 07:58:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsABPMYpgZ2/BDhRbSOPlI1BjbyyAEjnYh5qX6lRL7LKAA0WYf2P6YmXz90HZS5Ssdem+7P X-Received: by 2002:a05:6808:8c9:: with SMTP id k9mr6520924oij.11.1584716299952; Fri, 20 Mar 2020 07:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584716299; cv=none; d=google.com; s=arc-20160816; b=thPB3klXQnD2qYuqm+X7Srx/VHklZobOJoN3T6W9JYfz8M8gYMbsR5qCVxLZGT7CmO zOn7cPJFi8bhi3ynQsSoP85HcOo1W+EaPWBl7PBHZx43IEoaab8F0tnCl2l2mSU2UiMo 5jNGAKR/5IDmMZnrBRyuximzpaBBRK+58NSyST/1lPX7GRmmZN9gYIwYieZGWB/KD0ws sXVRa7hT5rzlFDA0t4VeQG5Bt3aDv2PJCmz572vM3jV/gSlf1wirH62KxRVpMbDF68iW 7AhNkwrBybZXChQmUFZWOZZJvGjMtGqBBkm0SFulICr+EcAAjwaY/4iBfbaaaTLanbe/ KgKA== 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=vKAwL2y+XKqFx+FvZM8GmjPNtSP4meaoZ5WWG4SMtq0=; b=0G/JvesX1UX05vZr+E/tByWYZGPnVc1LXgLtaAO9dGGp3+ssGOSY2vUoCvRApDvTOg 5kEJx1gR18buF1fNH080Q+s/ayAIWjAXSgmvyavKqaI/swEWvpygqDRfQIhh63w8T2wA e6eab4PxA4v8PVvPltzdr7mj+c3lex4TUyHN9AZeAwqHLrdbZJFuOpDDsE6crKCwsgje AFhTo+bODwIj6TgZzHM4qBUba7SEU2D3117gHekqtpaZIumv3ERmRPVYK2183W9GIkGb pu7ze18gsyoL5FPWll1dzY6YoHcyHibqx3jKL3LVDyrfJtFg4SOR9oDCeb+4hiwdRjLY VaDw== 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 k137si2950118oih.226.2020.03.20.07.58.07; Fri, 20 Mar 2020 07:58:19 -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 S1727355AbgCTO5v (ORCPT + 99 others); Fri, 20 Mar 2020 10:57:51 -0400 Received: from sauhun.de ([88.99.104.3]:49360 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727133AbgCTO5v (ORCPT ); Fri, 20 Mar 2020 10:57:51 -0400 Received: from localhost (p54B33339.dip0.t-ipconnect.de [84.179.51.57]) by pokefinder.org (Postfix) with ESMTPSA id 9B16E2C2E8F; Fri, 20 Mar 2020 15:57:48 +0100 (CET) Date: Fri, 20 Mar 2020 15:57:48 +0100 From: Wolfram Sang To: Dan Carpenter , Jean Delvare , Daniel Kurtz Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot , Mika Westerberg , Andy Shevchenko , Jarkko Nikula Subject: Re: [PATCH] i2c: i801: Fix memory corruption in i801_isr_byte_done() Message-ID: <20200320145748.GD1282@ninjato> References: <0000000000009586b2059c13c7e1@google.com> <20200114073406.qaq3hbrhtx76fkes@kili.mountain> <20200222124523.GI1716@kunai> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0/kgSOzhNoDC5T3a" Content-Disposition: inline In-Reply-To: <20200222124523.GI1716@kunai> 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 --0/kgSOzhNoDC5T3a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 22, 2020 at 01:45:23PM +0100, Wolfram Sang wrote: > On Tue, Jan 14, 2020 at 10:34:06AM +0300, Dan Carpenter wrote: > > Assigning "priv->data[-1] =3D priv->len;" obviously doesn't make sense. > > What it does is it ends up corrupting the last byte of priv->len so > > priv->len becomes a very high number. > >=20 > > Reported-by: syzbot+ed71512d469895b5b34e@syzkaller.appspotmail.com > > Fixes: d3ff6ce40031 ("i2c-i801: Enable IRQ for byte_by_byte transaction= s") > > Signed-off-by: Dan Carpenter > > --- >=20 > Daniel, Jean: what do you think? > Also, adding Jarkko to CC who works a lot with this driver... Ping. Adding more people... >=20 > > Untested. > >=20 > > drivers/i2c/busses/i2c-i801.c | 1 - > > 1 file changed, 1 deletion(-) > >=20 > > diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i80= 1.c > > index f5e69fe56532..420d8025901e 100644 > > --- a/drivers/i2c/busses/i2c-i801.c > > +++ b/drivers/i2c/busses/i2c-i801.c > > @@ -584,7 +584,6 @@ static void i801_isr_byte_done(struct i801_priv *pr= iv) > > "SMBus block read size is %d\n", > > priv->len); > > } > > - priv->data[-1] =3D priv->len; > > } > > =20 > > /* Read next byte */ > > --=20 > > 2.11.0 > >=20 --0/kgSOzhNoDC5T3a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl502ewACgkQFA3kzBSg KbaoARAAtfTyKYW9Ul8/37lfwTcF8GkKRTKd3Iasdo5yXbIx2HvPVPkl/fhoNQzO Vm6pbplxg27UWwBfqLgxRBS4AHx48ANi4X0BQIqeYKPl3hetOhHvwOzwWrfMwK0F AsMBtJsmSqqt9uHkuteOLnYHXxfoF+8ye0Q6QO3vStWP5FBfHlw1VrwiU0uZ3w+E 90ui9TPeSLp5WTXi4idgEc51blujdoXVceMDUwaSvJ+ZSl3SJIDuiPXOt5I7H4e5 q0vDW8mCj8l761YTOWExa8wygw+D/qDEblQC9vnj8ooCgL0BWFC8wH62PLCxgHjb 4tKAy+bWtzr3VzgfEnj0EnlLMMFxZ2oOYm6243SUwSOa+vbZQ4uSt5BDaLJmuaOO TZtWS+iNBytaHQNfFcBOfFlx3c9Z852iiSRrV4WLMknTszHOAuBvRJi4MRFoVi6F oUeJWi46KeNrpC1D2QwP1TcxlDWJ29DMsOVV3ix/fILvsHwIkcGLP74xjw7ZELxR tBbLBHWi3v71Ejs3VV75L5MlcsJgOUDJ/HLuz5E7lOZ69uBSKXCSJqs8e3xKF86S qbRGnZ/Tkfu+6PRn1PtN6ULQXa4NBIXPF3bhvdeq2YtF9+xsocjSMWdono83Wp/e WWZT2TZmAL+4Wvo5Nt9f2JKWRSmF2afUurkOjiRqmK3PrCKiFF4= =sTjl -----END PGP SIGNATURE----- --0/kgSOzhNoDC5T3a--