Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3851927pxb; Tue, 17 Nov 2020 05:24:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzinJAWQZe6eiayZ2DM6H4AB5cdtENl+/SsvkQdYFi0eOxbYPFlmmO2WuIIzX9+EteLmFg8 X-Received: by 2002:a17:906:5bda:: with SMTP id w26mr19624421ejs.233.1605619460788; Tue, 17 Nov 2020 05:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619460; cv=none; d=google.com; s=arc-20160816; b=eruCSRRcSurJP2rQBC7BB4lI4TMn0vH7plHx+S9p4Ln12ZEAy1/cx8HpNsVxvqKMVc xtk0rZC9FJ0+KXKmQtA59PwhdMhLZnNNGIRlYE6OKNRr9RaTRDqvJY41kAY2+QWpO/PX AL+dYn6KEQ7g1rVPSUBzBKh6MPP/KXDpd4OpjG2D1q1074rajFh9NDbtqZ0IA51j4g+4 78a7/xVZ/WmTSAs9R+75c9RqGx0QBP2/riB8uK647/zgug9xU5fXvO2K4/FL+34QzuE5 LOybjujSARk7YUDPDB10YaPFF7ycEQ1+/k8vQ+2W8OjTp/tbxAWochzo5wgvF1vR65Jq QsTg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/siphoecKIU03Z/+Okv1edt01rr1NAdK/XzFL1PefGo=; b=Lyc7UAWYg+v8scAJP250IIRjhNzB5fL91sfn9VT5K5JGdl9ShR8GV/dTET/b5gLFuj tFxpQ4whTkmZSJ96rVvYgTqvKNk/kPRCtLHnKhlOB069MVPOBX2lNIR1xqMaBonDJREI aiV7DZdHUhJ1swWbkjdyUPwxWF4QJt4Ge6d5Jx7+quG3mpEo58ZtBnLnYjVFjWmL86kA ZYj5l/VMv6+VDEogBIcTW2cRWho6yLLmlgkm1tXMmrBg9eEqVnRAWYI4vCp8WRl961Jt /iCB1e0omH+Ga0B1RK6i5V9eC3t7b4T87S8M07dg3GejwKG9Lg99zPSPj644lrPGW4U2 O0jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ErNTLwz4; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce10si16499118edb.515.2020.11.17.05.23.57; Tue, 17 Nov 2020 05:24:20 -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=pass header.i=@kernel.org header.s=default header.b=ErNTLwz4; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731132AbgKQNWQ (ORCPT + 99 others); Tue, 17 Nov 2020 08:22:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:56264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730301AbgKQNWI (ORCPT ); Tue, 17 Nov 2020 08:22:08 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9523820781; Tue, 17 Nov 2020 13:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619328; bh=94q8a8Sdr2/5YegOkc8ordUd8NWPMcOAM7pZxMuU6IM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ErNTLwz4qOpoNE8CmsbWgFALGeCKiU0mtR11vYtBaJEm2+AK3EWB2z730/ASsNrmi VYPuXMRfGxc8NZqjFiHfVlT6oR8HadDL9GDkPv/jccMFoXUrJ5GVoCOd1ag/0Ei8tq 8CUdPXub9BBkC4Yh1EXUAd/ELxuUCuq6ioJVkdEo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Chen Zhou , Paul Moore Subject: [PATCH 4.19 076/101] selinux: Fix error return code in sel_ib_pkey_sid_slow() Date: Tue, 17 Nov 2020 14:05:43 +0100 Message-Id: <20201117122116.822050681@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen Zhou commit c350f8bea271782e2733419bd2ab9bf4ec2051ef upstream. Fix to return a negative error code from the error handling case instead of 0 in function sel_ib_pkey_sid_slow(), as done elsewhere in this function. Cc: stable@vger.kernel.org Fixes: 409dcf31538a ("selinux: Add a cache for quicker retreival of PKey SIDs") Reported-by: Hulk Robot Signed-off-by: Chen Zhou Signed-off-by: Paul Moore Signed-off-by: Greg Kroah-Hartman --- security/selinux/ibpkey.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/security/selinux/ibpkey.c +++ b/security/selinux/ibpkey.c @@ -161,8 +161,10 @@ static int sel_ib_pkey_sid_slow(u64 subn * is valid, it just won't be added to the cache. */ new = kzalloc(sizeof(*new), GFP_ATOMIC); - if (!new) + if (!new) { + ret = -ENOMEM; goto out; + } new->psec.subnet_prefix = subnet_prefix; new->psec.pkey = pkey_num;