From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1ABC6C433F5 for ; Fri, 30 Sep 2022 13:29:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A150484D81; Fri, 30 Sep 2022 15:29:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Xgjj9Ek0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 493D5849AA; Fri, 30 Sep 2022 15:29:12 +0200 (CEST) Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BCA0D84D85 for ; Fri, 30 Sep 2022 15:29:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-11e9a7135easo5455402fac.6 for ; Fri, 30 Sep 2022 06:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=xC0AWEXUjqqD/tMJxui9p9do1lU9cNcKZPS1Id5SJIU=; b=Xgjj9Ek0D3lqmg97+eJbTZb+aUDy7SYyxlGZKYgK6eKyOODDNaFAWQELK7QJioiCPR fRimq3YE0SU1q53CrUMUPDovYCh89U3E/KKY+fcetz06H+VMjg6PTKgVmINaMiD4d4l2 Yhj/VY8jo/IpdNbkFZzov06XvmhkocICqkfmg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=xC0AWEXUjqqD/tMJxui9p9do1lU9cNcKZPS1Id5SJIU=; b=XxhsUryxQJJBEZgIyxTZVvmp1cYgH/BKJkkX2Cb2+DmTIZ4agIkXxhQYH0NwDj+8VO v1Z75NP4Hne9T6IzWR1J+X+0vmglKeWHzbeGMc2KHfSCmDrWWigmzd6W5IKY+8C0ZYFk eY+IjMauO/zNUhEW/IPM0R57KxYHPYBOupbJ7tAqTMcLQ8wVN9gkoUYfYdo5TUDxexjN BvCN82v+eY+dQjPhCbJBnwKMqVDqM1vLYaXBxxjy6rNOk+N5GAp5ODl07MQtVAQnQQUq pbzcRPjkBajSrW5XrZ2vz5R6eraoq5zIX+TPyp2T1DMzCueVuyZqyklDAJmgjHJ0/wrm 9imQ== X-Gm-Message-State: ACrzQf1OUePcy5xSsnWgiCT8++oIrST2FWCgS5wvnPIyg40eHVromeIW 3eHWL3Y3nqex2Hsni6CelXgXCZpxnfSI237jbt49CsALuGc= X-Google-Smtp-Source: AMsMyM5fjnNMthzS1rkSqkt2zqz0VUuTcBt8VqA8fAiQxOWl7nZVtqPYp25QROWDVLG7b7TkJvlQXICGibAhv5uJez4= X-Received: by 2002:a05:6870:390b:b0:127:42b1:e5d0 with SMTP id b11-20020a056870390b00b0012742b1e5d0mr5021308oap.64.1664544541441; Fri, 30 Sep 2022 06:29:01 -0700 (PDT) MIME-Version: 1.0 References: <20220929222706.27184-1-xypron.glpk@gmx.de> In-Reply-To: <20220929222706.27184-1-xypron.glpk@gmx.de> From: Simon Glass Date: Fri, 30 Sep 2022 07:28:49 -0600 Message-ID: Subject: Re: [PATCH 1/1] regmap: fix range checks To: Heinrich Schuchardt Cc: U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Thu, 29 Sept 2022 at 16:27, Heinrich Schuchardt wrote: > > On the 32bit ARM sandbox 'dm ut dm_test_devm_regmap' fails with an abort. > This is due to incorrect range checks. > > On 32-bit systems the size of size_t and int is both 32 bit. The expression > (offset + val_len) is bound to overflow if offset == -1. Add an overflow > check. > > Signed-off-by: Heinrich Schuchardt > --- > drivers/core/regmap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Simon Glass