Message ID | 20210322160253.4032422-4-arnd@kernel.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a17:906:5290:0:0:0:0 with SMTP id c16csp1347084ejm; Mon, 22 Mar 2021 09:03:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHZis5RH06GCYolF8Lf5oB8mfRVCSwXczXlERxnSuoJK4GUNFYeSJDMJ58EqWNFuLDlBnV X-Received: by 2002:a17:902:b781:b029:e4:545d:77 with SMTP id e1-20020a170902b781b02900e4545d0077mr443164pls.59.1616429039698; Mon, 22 Mar 2021 09:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616429039; cv=none; d=google.com; s=arc-20160816; b=RZkuR4QDbwRtFjqnxHtWdCtTWoDKZCPGnhYXI9WjweIi6q4q3USdwt7QJm+SPkh3sx 02fHo27O9P8fUIfO4SgvTPLoMW4J+1DWQNoUZHRVlMbBBpFZTKMKIQRVANHYKqO9gguS tJ1tgrst0a3PPrWmOQyQ7Xe2c0O2WGSjLR1WqxGvhyAfl5L2yKQx/OEwLeOVDx5Jxuak Y7pql1CZCm7ds2PEF+KRjRYMQ8Hfria4ANF/uVkQRg8sMeMwlAt31EYk6knKtdfInspJ jHhkaR1e7AIxuKAJvsDe2XfBxCWEbhA4YPt7SOLcWZMi9CIY8DOmCe3zDh3xLj+uLGUQ Jz0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=E73QMOZ8viGNiDYJyLFjn6iMy3804zOGrz/MDNrrLkU=; b=HSXvZdxIk2SoUK7vs9H+wv2XiJEx7qVr4OVjcO2qVrw7Doah9q9SQ5W3Pf5hG7mAiX SYgQ8qRBqtQ2BCvB+m6maBEpAFkkJ5a4KT/WgQmVbc+VwLXY6Wkqum7DFBpvlQrsD8I1 krOCU+cRIqkcsOIktGOlQK68QJ5P/W/goOU2RJjHlXHc9w4/YEuK9ckF9shGE7ZED+u5 pcyDdfVfq/Isl8EV6KGY8AUsTJQmOu47DpZs9noI52cGfbeHwCdUOGfZ6n/CLrqMNXFy 8AKNyUkZdqvJ+uNv9A5HQITfa0qIcBzLwAhNBXDglQlkDgdy4olW/lbl4yRRFk+092bn HuYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=DnY2VvcI; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: <dri-devel-bounces@lists.freedesktop.org> Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id a15si17372559pgw.241.2021.03.22.09.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 09:03:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=DnY2VvcI; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7808189CA2; Mon, 22 Mar 2021 16:03:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8861789CA2; Mon, 22 Mar 2021 16:03:56 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4428761998; Mon, 22 Mar 2021 16:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616429036; bh=yFqEt0Vza9xx1ZEH6vpmadF/s9WD+9cr+PvfYFx1jTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DnY2VvcIHWNR00CmYsS8o9sdpXW8IfqlUTn3pfDogyHxX/SIITlr8SG6GxkT3eSRZ a7K8jLXsPna4Mm190+MpWcuBICb/n+i193Sgx5UJVnr/NQaks4zNGBOOkdJN7kk+Zx IrtL2gHR1/fBjD9NvgLiYwkQqQ/EKWhfodExGrNMHcxDZouSH1dybJZC/EbBnOcXm9 XQLG8dt1bjMaDOofLpAx013Fhy9k111G7DuVnc/32l3avRksgUDzsBf0x12znYeUYk RAdBhG+/y/EhxEsBwjpyhm77vbHfFV6Wbj7ETM5qbIRB/4/X2e34tKnfe8hgDnqlGY gToo1OwJ8lpqg== From: Arnd Bergmann <arnd@kernel.org> To: linux-kernel@vger.kernel.org, Martin Sebor <msebor@gcc.gnu.org>, Serge Hallyn <serge@hallyn.com>, James Morris <jmorris@namei.org> Subject: [PATCH 03/11] security: commoncap: fix -Wstringop-overread warning Date: Mon, 22 Mar 2021 17:02:41 +0100 Message-Id: <20210322160253.4032422-4-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210322160253.4032422-1-arnd@kernel.org> References: <20210322160253.4032422-1-arnd@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Cc: dri-devel@lists.freedesktop.org, Christian Brauner <christian.brauner@ubuntu.com>, linux-scsi@vger.kernel.org, x86@kernel.org, James Smart <james.smart@broadcom.com>, tboot-devel@lists.sourceforge.net, Kalle Valo <kvalo@codeaurora.org>, ath11k@lists.infradead.org, Miklos Szeredi <mszeredi@redhat.com>, Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>, "James E.J. Bottomley" <jejb@linux.ibm.com>, Ning Sun <ning.sun@intel.com>, Anders Larsen <al@alarsen.net>, cgroups@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-security-module@vger.kernel.org, "Eric W. Biederman" <ebiederm@xmission.com>, Tejun Heo <tj@kernel.org>, Simon Kelley <simon@thekelleys.org.uk>, intel-gfx@lists.freedesktop.org, Tycho Andersen <tycho@tycho.pizza> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
treewide: address gcc-11 -Wstringop-overread warnings
|
expand
|
diff --git a/security/commoncap.c b/security/commoncap.c index 28f4d25480df..9a36ed6dd737 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -400,7 +400,7 @@ int cap_inode_getsecurity(struct user_namespace *mnt_userns, &tmpbuf, size, GFP_NOFS); dput(dentry); - if (ret < 0) + if (ret < 0 || !tmpbuf) return ret; fs_ns = inode->i_sb->s_user_ns;