From patchwork Thu Sep 19 22:03:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 174105 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1600023ill; Thu, 19 Sep 2019 15:14:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOumCq+7Xvemm0YwLL8uw6PDyUT3qQm5xyCF5bYTlBcHH8AwMImPIWuuZDxphCXPD8uopK X-Received: by 2002:a17:906:5453:: with SMTP id d19mr4926940ejp.236.1568931254334; Thu, 19 Sep 2019 15:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568931254; cv=none; d=google.com; s=arc-20160816; b=eMwlgtYD529GAzTLi9C7z92nDObDkJi0L5JCZFXVopot6IdoqYZQnXYAOxyp2RBmjB VKUhcxPTIO5JvK2yOuQNsbwaGb81JGrDNz6X5NkzmeYEHwrxYf4cIQJqUestAcyZgiLw FIQVmV2W+oxW9NGZQlh5C8MnrulCTI8JbGhFyBgTOUVslPChrAStvSUoIPf+Hz42VUBB XHoncUdzkZzgngV2I1GNrK6aR1y8Kry/2T8iAbpJUK9WZjFycEt8R6u05N+l3615+FMa +l775K81YRctdVcqnJmvsOSLiCg8HDlUHW5qbnnk1kg4dDm7KNWbicssEzcZHZ7N4XUy z5Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=U2BK94GT0BQ7ZCrMpzD8n6zNCypdTf/sI2SY5YCQ5hU=; b=EcksL22Z1lfb14E7Uu1Q1qDNgKWTbCGfbaG0H/uR3GzFxoD/S1n9VlDSrZGbtnygwk TicvP16y74Hmzt8UAvNj40Zo/vXxKzFBlyjdrMRmg8/tQvCqFfhR2IVhx6JU0V1eQqPH zzS9Z6dGWbIhd16QCasw98vv/QQT41EAQNDMM5wKktQZD7PI2bc4Ys8331tXAeTNQLCD HXXkOKotevBsOlid8BcHuco9sjyoldt37dOFCApOOdvktyHZegA6KVZsTIKgOGrn6DeR fAJwfyB65q4linxXcSn/qUDwuAjTCfwdrBaNt3yOCPagpTLGbcFrtvnGw+kIeQfi15+p q8zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q0kEbRSX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m55si85152edc.17.2019.09.19.15.14.14; Thu, 19 Sep 2019 15:14:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q0kEbRSX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392204AbfISWOM (ORCPT + 26 others); Thu, 19 Sep 2019 18:14:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:53560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392166AbfISWOK (ORCPT ); Thu, 19 Sep 2019 18:14:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0233621920; Thu, 19 Sep 2019 22:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931249; bh=Ts8e8Hns3t4/ykTZIfN892InRBKDgKoLX54YAaNvoyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0kEbRSXD4wtRzFPMqixUeU3Av2pguI+/hInbjRAgtw2zQi3uQsjUXDlKFmaJIb0d KrokxpH+X+0vT7z3WZNxy4YXCEV48Kzw0E7XZ1I+63gOGpE/+bA0NwJXopgJ103ASK cFvbpntyZL8N91L8Vz+Zq3YhU0GsBSYlJZDLy4fY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ivan Khoronzhuk , Jonathan Lemon , Daniel Borkmann , Sasha Levin Subject: [PATCH 4.19 40/79] xdp: unpin xdp umem pages in error path Date: Fri, 20 Sep 2019 00:03:25 +0200 Message-Id: <20190919214811.273100959@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214807.612593061@linuxfoundation.org> References: <20190919214807.612593061@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ivan Khoronzhuk [ Upstream commit fb89c39455e4b49881c5a42761bd71f03d3ef888 ] Fix mem leak caused by missed unpin routine for umem pages. Fixes: 8aef7340ae9695 ("xsk: introduce xdp_umem_page") Signed-off-by: Ivan Khoronzhuk Acked-by: Jonathan Lemon Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- net/xdp/xdp_umem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index a3b037fbfecde..8cab91c482ff5 100644 --- a/net/xdp/xdp_umem.c +++ b/net/xdp/xdp_umem.c @@ -322,7 +322,7 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr) umem->pages = kcalloc(umem->npgs, sizeof(*umem->pages), GFP_KERNEL); if (!umem->pages) { err = -ENOMEM; - goto out_account; + goto out_pin; } for (i = 0; i < umem->npgs; i++) @@ -330,6 +330,8 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr) return 0; +out_pin: + xdp_umem_unpin_pages(umem); out_account: xdp_umem_unaccount_pages(umem); return err; From patchwork Thu Sep 19 22:04:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 174106 Delivered-To: patch@linaro.org Received: by 2002:a92:6d09:0:0:0:0:0 with SMTP id i9csp1579099ilc; Thu, 19 Sep 2019 15:30:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3dZerqxfWukQAn8VW94sj/dfIrRV9SH86aAYciPRH0o9OSkwvZp+1pR1Ochj4VX/ED1xk X-Received: by 2002:a17:906:b2d4:: with SMTP id cf20mr13674512ejb.152.1568932256969; Thu, 19 Sep 2019 15:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568932256; cv=none; d=google.com; s=arc-20160816; b=U5xKuqu4lqoOYzRcEmARIDI9JrbkUqvLf+3KqbZ+9B1dBpBH017d6/Kzz3103M2nWz iGH9UXQ4SrTeFqZOq65Yw/FXXcXhZCO4sRrR92wClH1ASviSASmaMNdsPWR1W9YqcGAQ MyE9bIzPIZXW7jRX0iWFvG+No9AGBqU5weGfVftiIEa8ZRob6lEdbSHHUbfkOxhgV0Rv 1hUb4wHU/m+yrxc9o4v8KqkpxPUe6TJpX3AzrXlbY6Vcb+la9czMepwa23a3qJyMhpPu HPUaLzTrYxvHxElHY6aw32b/Rioh6cGqHeWBTG+93Y2XAEW0SGvTyjS3ZL8ir+T6PrrK itlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NHU8uAhqPrkHNJ+b7Dg/cB/AsWqcdWg0LqhPBv/8ejU=; b=Q67qNe2SfvkTiokXcq3HmEIZctZeIe+/Z6NNLRsexgrQctFtPcDT1AjxLR6a6RygOC Gi15wyre9wF+f7M2nqe6qDl795/4DkxDfgg1kqZ+F8/z7nNlIdfYKe3lqjFJZtLVsQjT dHkMnUQ77T6+VOo7WNp9vvSIMYEneZAhX0XyBnrxvjSqPz4Mxp6Wlu6UmQ4AM6XcTCaz yOCmaoK0JOT6JwhBIAKzF/AH2dfmNYAcV7F6mS7AxKJg44MPWlUYXUaSr6j/s/Wreztw NtjLzK+/HoTEVWZxbM3Q2EqFL/TtgawkM64HaFkx8wZFArEWjEUq5RE/u+Ubp7nlfZEt 0x4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LW9BVM7H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si1454751ejw.231.2019.09.19.15.30.56; Thu, 19 Sep 2019 15:30:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LW9BVM7H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406320AbfISWaz (ORCPT + 26 others); Thu, 19 Sep 2019 18:30:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:55370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406126AbfISWP0 (ORCPT ); Thu, 19 Sep 2019 18:15:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 AB659218AF; Thu, 19 Sep 2019 22:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931326; bh=7MGaVN2wL64VImoAPcctyBsgIy7kwhtcTXeqnOhqXb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LW9BVM7HUMFd6CwFwiALxgAcztryqeDxYe0mHBiiRJUX8L7dRSGDXCIoGdE0aGT3P crhpqjmyz+ZVAC0GC6EHAHcv9s1erohjTl0Fv/thhRsFapmTm2KkutHdEvEv730y3e nkKR3IAg061Swoumv9syvNQrPkWOQ4b4L5cu2Dc0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Niklas Cassel Subject: [PATCH 4.19 78/79] arm64: kpti: Whitelist Cortex-A CPUs that dont implement the CSV3 field Date: Fri, 20 Sep 2019 00:04:03 +0200 Message-Id: <20190919214814.627750263@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214807.612593061@linuxfoundation.org> References: <20190919214807.612593061@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon commit 2a355ec25729053bb9a1a89b6c1d1cdd6c3b3fb1 upstream. While the CSV3 field of the ID_AA64_PFR0 CPU ID register can be checked to see if a CPU is susceptible to Meltdown and therefore requires kpti to be enabled, existing CPUs do not implement this field. We therefore whitelist all unaffected Cortex-A CPUs that do not implement the CSV3 field. Signed-off-by: Will Deacon Cc: Niklas Cassel Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpufeature.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -895,6 +895,12 @@ static bool unmap_kernel_at_el0(const st static const struct midr_range kpti_safe_list[] = { MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2), MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A35), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A53), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A55), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A57), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A72), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A73), { /* sentinel */ } }; char const *str = "command line option";