Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp412516pxb; Wed, 18 Nov 2020 07:40:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIn9V+YpgMT7kOqnlIv0HVCuIgFKWfXN9CISM4aGIRmitx0Vm5DLYHtmsuGlefWbpVuwZZ X-Received: by 2002:aa7:c904:: with SMTP id b4mr963874edt.161.1605714033782; Wed, 18 Nov 2020 07:40:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605714033; cv=none; d=google.com; s=arc-20160816; b=BYZouaJNgpRGmt3s2Y+kbQRbGgUClrGVeF012Wy99ASVjI7n55d5ILdjBx6LshEoOp LeGnmuFz5JA5ML3HIxSCMBNm5JURZEllShG9Wy2Zj8OUble7NL0Ti8cTovdwUJchAeUw NWRcIPK+kezE5gF/+ulYq1JCO8EWsRLiAOS9RLxXB5Hc4qZFHRlbwx98gCZwjYlZ6uTj C9tF8HNSuwrwEfhH8c4kMTv4CrgaLxSyInNuJA3qyBpavxodp8MJtpi5heATSRaNki84 Ae4lofYPGR9HTIJKESMUU7u/ypdArmHRqH1mI9fXfNJbm1dSz+N3f50TJsu7FVDe5B9F UZZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Zf0CbfUHIhnvDFMKv+8Giay1yr/S37jdUNiHj2HQ00A=; b=kcBp3HjookC+6kcmPpbfyrNiNuATTtmm0QV/+/FuZy8EYpUW0iTN28dXSmhg5RNayi PN5ruXbajjXh9mqxSSQJzxPkSjO5A3LILJHULocv3YgDgPvgs+BN35GS1Ije/Tv1N22g IXWn9gLDj/alDVkEEto1bHfRYXoeq3faxOoP95ofXZ03qWAw6TSlFSZ2RwxdFwJ4vXGs 26sACoQ4mql+khhgHHkXOC7jd4pE0GOPNM1ZozPyr0fNAQqYbttln6GU7Jrdem8Ee/AM gx8ikGa4f2nQ97/6dMOcxup5H8msVGRSRB0VNfTrLbB3rLxggWkIU13MZkf97tbzBrix fWGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=DKzWIx4H; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c19si16623617ejk.311.2020.11.18.07.40.09; Wed, 18 Nov 2020 07:40:33 -0800 (PST) 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=fail header.i=@kemnade.info header.s=20180802 header.b=DKzWIx4H; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbgKRPiR (ORCPT + 99 others); Wed, 18 Nov 2020 10:38:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbgKRPiR (ORCPT ); Wed, 18 Nov 2020 10:38:17 -0500 Received: from mail.andi.de1.cc (mail.andi.de1.cc [IPv6:2a01:238:4321:8900:456f:ecd6:43e:202c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF287C0613D4; Wed, 18 Nov 2020 07:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Zf0CbfUHIhnvDFMKv+8Giay1yr/S37jdUNiHj2HQ00A=; b=DKzWIx4HrI9alopXCxMPPuurtE AsVTthYov+Aam6YQGXLsigD7P5kJIdQh7v8eDg/lATDX3cfFQ8ZO7Hm2LZ6m55L9F3N8ajF0kFoJs Yi/rW72Nxn9M0yhTLgHRe8yyDI0wL25/oNQRsiPXNkLjt5xxdNbU0UI34Sh7K3juPxn0=; Received: from p200300ccff0a3a001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:ff0a:3a00:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1kfPX6-0003lN-DA; Wed, 18 Nov 2020 16:38:08 +0100 Date: Wed, 18 Nov 2020 16:38:07 +0100 From: Andreas Kemnade To: Nishanth Menon Cc: Mark Brown , Liam Girdwood , , , , , , Naresh Kamboju , Arnd Bergmann Subject: Re: [PATCH] regulator: ti-abb: Fix array out of bound read access on the first transition Message-ID: <20201118163807.3783192c@aktux> In-Reply-To: <20201118145009.10492-1-nm@ti.com> References: <20201118145009.10492-1-nm@ti.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, 18 Nov 2020 08:50:09 -0600 Nishanth Menon wrote: > At the start of driver initialization, we do not know what bias > setting the bootloader has configured the system for and we only know > for certain the very first time we do a transition. > > However, since the initial value of the comparison index is -EINVAL, > this negative value results in an array out of bound access on the > very first transition. > > Since we don't know what the setting is, we just set the bias > configuration as there is nothing to compare against. This prevents > the array out of bound access. > > NOTE: Even though we could use a more relaxed check of "< 0" the only > valid values(ignoring cosmic ray induced bitflips) are -EINVAL, 0+. > > Fixes: 40b1936efebd ("regulator: Introduce TI Adaptive Body Bias(ABB) on-chip LDO driver") > Link: https://lore.kernel.org/linux-mm/CA+G9fYuk4imvhyCN7D7T6PMDH6oNp6HDCRiTUKMQ6QXXjBa4ag@mail.gmail.com/ > Reported-by: Naresh Kamboju > Reviewed-by: Arnd Bergmann > Signed-off-by: Nishanth Menon > --- > > Mark, > > I will leave it to your descretion if this needs to be tagged for > stable or to drop the Fixes tag - Side effect, if this occurs, will be > an unstable system very hard to track down - but typically occurring > during system boot - Impacts systems: DM3/OMAP3,4,5,DRA7/AM5x. > > I would categorize this as "This could be a problem..." problem.. > the bug is an out of bound read, and has been around since v3.11 and is > not a catastrophic data corruption kind of issue. > > Though theoretically, there is a possibility that the compare may > pass and result in missing bias configuration(and resulting system > will be unstable), I have'nt heard of actual report (but, it will be > surprising if any actual instability was actually tracked down to this > bug). Any ways, I had to go to git full history to pick the exact > commit - I have left it in the patch. > > Hmm so probably these boot problems which only occur when your debug cable is not attached? Is there any connection with commits like this: ARM: dts: omap36xx: using OPP1G needs to control the abb_ldo So would the potential problem be more probable by patches like the that one mentioned above? Regards, Andreas