Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp267781rwb; Mon, 26 Sep 2022 12:04:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SAytpAMii10YyzCgFVWx12baifznP4HzY80MVToawu0xFFTGna1pmtkGFpeW3Zfi4amuX X-Received: by 2002:a17:90b:164a:b0:202:5f0f:290e with SMTP id il10-20020a17090b164a00b002025f0f290emr227135pjb.27.1664219088358; Mon, 26 Sep 2022 12:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664219088; cv=none; d=google.com; s=arc-20160816; b=B+sDyOPbXeZzhjHVtOXeEja9+1XfJO4ckwaqi0SXttXeAMmD/VwKSZezft5pCoo9zr /JdvRBwm2sZFZMcFe3zG2q+3jLP3Tcw0Rpu2pzaehVeuOv3aiUKd/LcYAJfzMuty2rx+ 7OQAk7MTVm1iPr3A1kyd8HkRHo2OeA0WfPhhOF/HiRaIwcTmQMH5OmvgD0fPKvJgJoiF qxlrbroQ4Jx/IyWqdam4s1YE517lSpKDHLa/UFCEQtHF+UUCh5sOEb7LmWWsdg/WZ2pD IMB0Ki6MyuFN9sUhk7UFFn2+9uyOVLsRnkyj3u15yBAXyTsnOt1VQ1Vou7m3cnkonzbC 8yKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZbRJ8mO2p4vx8AyTjHr+MwJ8AVi8WB920WfIqpKjyQw=; b=OIYAh7+phISB29jbu0I5WfJE5lXXZdXvpdIzXgnFZzjcLpxKAdcMwokpWXPPWMwEv1 HRttheyE9i2lfkxAm7S16S/8a0lNIg2c3ylhJ8SRUmJt0xc8x/NTVK6BbvHgBNSW+oNM kYfhhphh44Mvi0q/Ud2xdO9Yiz5zpc6kWJ4EA8d7kCAsZ0xbu2PWdm0NZZV80XbXTa3n 1Dgi8klamkLyDySJGZXW1VS8AgYj8j2CUdNiJyCZskrgBk4BQV3e0Lbd2ztTI/YvnfBk bDo+pupLC+9kwzqSVXo7c7TE3oznSf1gjgYoskA5/z5Fg8wAJ8iCx+cL51JFsT33CLeo aFYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="F7JV5x/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a17090a7c4e00b002006b213af9si11865440pjl.32.2022.09.26.12.04.35; Mon, 26 Sep 2022 12:04:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="F7JV5x/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbiIZSZl (ORCPT + 99 others); Mon, 26 Sep 2022 14:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbiIZSZS (ORCPT ); Mon, 26 Sep 2022 14:25:18 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 219355E335 for ; Mon, 26 Sep 2022 11:23:13 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so13301927pjq.3 for ; Mon, 26 Sep 2022 11:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=ZbRJ8mO2p4vx8AyTjHr+MwJ8AVi8WB920WfIqpKjyQw=; b=F7JV5x/0etVoVGG4rO8OrL84nTxFnDrGuT1q6LOVYhfZKjrDIeEub2gbhtzkVtHd4n wklDvq0dbdpz83B/AL021wZUdMCpXJ/2nhf6CBHIAVLdMJlJ2J1pNnqSE9cLMtQoaXuh enRpmU+RrZ2KQlbZvsVWaFBxccDvm0e99X088= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=ZbRJ8mO2p4vx8AyTjHr+MwJ8AVi8WB920WfIqpKjyQw=; b=3v2QIID1Llnt5DlDnFL0UrCDugZ4I7VpH/Hw04Nw8k1Ex9N72OXOxWzJqRjB3MKh+/ JCE4ARjtQICIuVx6ZLh0WM36jzqm/M6+q9YL5meMaoT3Ikk40Cr/ysJaEP0BqMetF3rA GOyUry+rBxKPhQ4fttmAAuTaL83pY8Hf+/DGucEHaZHkFC4crwamu02LVvO6Bjty86fl GoHqH1VmwW4JgF16YWrnBSE/9KBV+9tWMpYOrlQBgBWzpi6yc3BtzY3UpXemfzlT+zHf k0SKTUk5fqdY4hBPCnVWOr3yI3fzVwSXy4k019VQuIZiGFM46BsmH/XkXwcgG4vJmqkl 9sKQ== X-Gm-Message-State: ACrzQf2jHvxm5ufrfx4MClGh3KQmfWWz/Au1ri/s9cEL4SWk9SJhclOJ Og9pZYjzI60djCsihpvHXVmdKQ== X-Received: by 2002:a17:902:bb98:b0:178:8e09:5675 with SMTP id m24-20020a170902bb9800b001788e095675mr23402986pls.91.1664216592557; Mon, 26 Sep 2022 11:23:12 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c37-20020a631c65000000b0043949b480a8sm10914556pgm.29.2022.09.26.11.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 11:23:11 -0700 (PDT) Date: Mon, 26 Sep 2022 11:23:11 -0700 From: Kees Cook To: andrey.konovalov@linux.dev Cc: Marco Elver , Andrew Morton , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov , kernel test robot Subject: Re: [PATCH mm v3] kasan: fix array-bounds warnings in tests Message-ID: <202209261123.91B4E71B2F@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 26, 2022 at 08:08:47PM +0200, andrey.konovalov@linux.dev wrote: > From: Andrey Konovalov > > GCC's -Warray-bounds option detects out-of-bounds accesses to > statically-sized allocations in krealloc out-of-bounds tests. > > Use OPTIMIZER_HIDE_VAR to suppress the warning. > > Also change kmalloc_memmove_invalid_size to use OPTIMIZER_HIDE_VAR > instead of a volatile variable. > > Reported-by: kernel test robot > Signed-off-by: Andrey Konovalov Reviewed-by: Kees Cook -- Kees Cook