Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp706666pxf; Wed, 24 Mar 2021 13:59:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh3/ugJCtth1iiLIBEGA7cGP4kTAimL93w0OU4npJyq5Up+2ETsGCnWqZ7G6c1FGhjXUsy X-Received: by 2002:aa7:d954:: with SMTP id l20mr5525899eds.1.1616619599548; Wed, 24 Mar 2021 13:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616619599; cv=none; d=google.com; s=arc-20160816; b=SB/A6QHkX3Eg/1u1cH8kAY1L1Gq0V7W8vKX3dKo9vhJezjMKcEqCfW+HbLiu6sFVop MOaTXJVTIO/nDZonS4x/gO8nIljwirPmLCHHSEzXtyvBjoX9e7ONbMDJMnVXKFNGPnau +7Z/pJEavSxl1nT+NeZeaQiQCSZyN6JVvUPoLRlENWUFy7682QhCmC16e8YsWqLWCE9H EEdSVR+MoeReDkokdCkpIUGdP8n2QmmemoP6uFuG3MkM5As7xG8GK9I/i66YjRakzS5q 5slxRbocG7U9rTfqJ/HzIJHgxL8wWEN7J9WL3d4VaJB1qMBpkkVOfZBDxslQgpdBmRSS 5sEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=mz2hsiukUjoXQHrrXSxk8htmk7LaG5DOPZAMPiRiJMQ=; b=S0fXLX7mmETAOAHlqgxveadaVvm4NoDSpWBZi54ShToluIdQY7x3cAIq4+/sKtVuHi vGxILu1CHp/tckt6Pw9vWFYVEmTfnVsArdITdrlwA1JREkH7IN8rBO+8LLYHAp2toOQz rhI9yLUKLq/w2o0cskDB8Wip5X3fburRu6ek3BqPAmMZbGE9jWbLPB99trouaAADtBBJ FGEqOIrTBLCcOYk5ohBRIFjb0aRlXEhvp9k4sOw8/6wpNkh/MJlvrApHKGvdXAY9EFgW oPJKuEe548Dm10yU9gJTrbXA1Yci1GuuyXTjSy8uCZZtXkXFmXE6A1Q3+Hklgy6UiMp5 a+5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 j16si3311959edj.401.2021.03.24.13.59.31; Wed, 24 Mar 2021 13:59:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233583AbhCXUx6 (ORCPT + 99 others); Wed, 24 Mar 2021 16:53:58 -0400 Received: from namei.org ([65.99.196.166]:51310 "EHLO mail.namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbhCXUx3 (ORCPT ); Wed, 24 Mar 2021 16:53:29 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.namei.org (Postfix) with ESMTPS id 507624E1; Wed, 24 Mar 2021 20:50:33 +0000 (UTC) Date: Thu, 25 Mar 2021 07:50:33 +1100 (AEDT) From: James Morris To: Arnd Bergmann cc: linux-kernel@vger.kernel.org, Martin Sebor , Serge Hallyn , Arnd Bergmann , x86@kernel.org, Ning Sun , Jani Nikula , Kalle Valo , Simon Kelley , James Smart , "James E.J. Bottomley" , Anders Larsen , Tejun Heo , Imre Deak , linux-arm-kernel@lists.infradead.org, tboot-devel@lists.sourceforge.net, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-scsi@vger.kernel.org, cgroups@vger.kernel.org, linux-security-module@vger.kernel.org, "Eric W. Biederman" , Christian Brauner , Kees Cook , Miklos Szeredi , Tycho Andersen Subject: Re: [PATCH 03/11] security: commoncap: fix -Wstringop-overread warning In-Reply-To: <20210322160253.4032422-4-arnd@kernel.org> Message-ID: References: <20210322160253.4032422-1-arnd@kernel.org> <20210322160253.4032422-4-arnd@kernel.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1665246916-699807841-1616619033=:3443171" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1665246916-699807841-1616619033=:3443171 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Mon, 22 Mar 2021, Arnd Bergmann wrote: > From: Arnd Bergmann > > gcc-11 introdces a harmless warning for cap_inode_getsecurity: > > security/commoncap.c: In function ‘cap_inode_getsecurity’: > security/commoncap.c:440:33: error: ‘memcpy’ reading 16 bytes from a region of size 0 [-Werror=stringop-overread] > 440 | memcpy(&nscap->data, &cap->data, sizeof(__le32) * 2 * VFS_CAP_U32); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > The problem here is that tmpbuf is initialized to NULL, so gcc assumes > it is not accessible unless it gets set by vfs_getxattr_alloc(). This is > a legitimate warning as far as I can tell, but the code is correct since > it correctly handles the error when that function fails. > > Add a separate NULL check to tell gcc about it as well. > > Signed-off-by: Arnd Bergmann Applied to git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git fixes-v5.12 -- James Morris --1665246916-699807841-1616619033=:3443171--