Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp878591imu; Fri, 11 Jan 2019 10:37:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ui/aqiCEDQvuhSKa5X+JMIWnjsPQXii2jOVfnKQTkFRDDJL/WLKz5t9ced0LjgKJ9OHpE X-Received: by 2002:a62:6385:: with SMTP id x127mr15884832pfb.15.1547231878403; Fri, 11 Jan 2019 10:37:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547231878; cv=none; d=google.com; s=arc-20160816; b=wLwclC0+zdKWuM325KOYcXNtZ6nN7ewpaFtAdylGg4rgG1BBM6tLZjwZrPJbeJ6C6x zJbuMJKFVnb+SEuBola52jZIjRWBRuEGwWc7MPy3GnIQHl+8zvAEx+1H4cxpvlRi1Ce2 llj9QHi6NjfEnFeWmfOT4Psn2TUAx2RiJ8hLbL4yxDbh/Ok/OQQQQCXPohGxIeWPn6U3 vBtSy+WHk3qMFzjCwiKcNHqAQezO2V2XouGUaE9kwsM/fYDECu19QE45DNQh9l1ELhpK 496+Su1ABftk5FTn6Yw+lGxsXns+Cp/Pt8MJEPe+jmV3dCxH88ashPjBdKJkRyhhcQob tWzA== 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=f31LjdVdAbJVsGMHcL8hNQCzBbX5yxACPS4fbendzs8=; b=ZSk0+w5LQs8/V4BHVj6CktbwFFK0D+dtCn9Z5uUfOngnnTOyHc5msz0LEEQedhtaG+ aYozSwPOcPFtcshKaP4QZ0+/G5+ANebe8PWrb3NYRoFl6/MwTurTMgV0dmTc0d0PHCWl lGOkkVjyHuSMcD+oezfgzYGr7mBrcofmSp35ttcHsf8LeUQHABjAGvoQHGfmcpWdORv3 pcZ0zRZkt+M2Dx/XJjgkhtH8v7IhoQNAlA3TU0wVEnu5uMe3G6VadAJCbffzEX2jnB3L z23l2DVuLqvwuYn7I2yq5jPx12LAyxaPXdmLOqNuVhL+Pcul1bkmeBDnqORAOGQx+Vbl Ewdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WCJUM3sG; 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 s19si5543344plp.151.2019.01.11.10.37.40; Fri, 11 Jan 2019 10:37:58 -0800 (PST) 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=WCJUM3sG; 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 S2387999AbfAKOSy (ORCPT + 99 others); Fri, 11 Jan 2019 09:18:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:35312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731550AbfAKOSr (ORCPT ); Fri, 11 Jan 2019 09:18:47 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 0D7A82183F; Fri, 11 Jan 2019 14:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216327; bh=53bRl8hHLEkh/vACmcI2wYjcHN4+n5WWW5JXrXn1tT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WCJUM3sGFSgIzdS0yYjeXcqDuDD0qME6Maykjbm6OeCJKEMXyyqmqxRZFGjO2cMP+ eown+casOEi9PA4k5hSix5/RN2zGL8MLblb/iCzwW2HnqEkw1n/AlljLneVBCFb03t q600rPBLLYCA0IK0/e1BsP5Q1Y6CmaVjcpIsNbGo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Poirier , Steffen Klassert , Sasha Levin Subject: [PATCH 4.4 60/88] xfrm: Fix bucket count reported to userspace Date: Fri, 11 Jan 2019 15:08:29 +0100 Message-Id: <20190111131055.604887549@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131045.137499039@linuxfoundation.org> References: <20190111131045.137499039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ca92e173ab34a4f7fc4128bd372bd96f1af6f507 ] sadhcnt is reported by `ip -s xfrm state count` as "buckets count", not the hash mask. Fixes: 28d8909bc790 ("[XFRM]: Export SAD info.") Signed-off-by: Benjamin Poirier Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/xfrm/xfrm_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 9b6e51450fc5..13f261feb75c 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -623,7 +623,7 @@ void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si) { spin_lock_bh(&net->xfrm.xfrm_state_lock); si->sadcnt = net->xfrm.state_num; - si->sadhcnt = net->xfrm.state_hmask; + si->sadhcnt = net->xfrm.state_hmask + 1; si->sadhmcnt = xfrm_state_hashmax; spin_unlock_bh(&net->xfrm.xfrm_state_lock); } -- 2.19.1