Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3630566pxb; Mon, 24 Jan 2022 13:57:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwA+93u+Oxh4qoAHJnp1s4w09vfu2xu6SmK8VYxw8USuiSgil2yPnEah+znwSuG70wYZDrh X-Received: by 2002:a17:90b:164a:: with SMTP id il10mr331925pjb.51.1643061474973; Mon, 24 Jan 2022 13:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061474; cv=none; d=google.com; s=arc-20160816; b=0DylW1xAd0/owM+pVHv6lfcco1705CTy8SiU/IqmsJPrk7PkNHtzUsuwEfReLO2B+V YTyEnXwm9RyWt1KOJmmbpKMA+EbeXDEBvAsNqYLIXiZ6Fmz9Wyxc/uZF8qOTf8SfyvDr GHPTBpfRxaU/qcH1Q8L7C96YgXvdfdbjlQHsZtZfdPCpMQ/HfXzcSSiQIaNlNK6BrcHK GuZgVL1L1+2cpWUD0cKwl+X5YD4g85p04yr1rIxfnUseTFP8p9zAhm/tjbmwoAPLPqAe O7CHNZNWK/OuB/7ukQFqD6XzsSBa+Hj9o82FdrcoTAE39TeeQzBjN/7Ca5RBu+G6c2Vb Sepw== 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=4UxsC0zqjRc+U99m5B7OR016L46TozgreRwiaEwIho8=; b=GUzQCAR15gsWdx7L6Kgqg4Mp6/LNePkBWVtDnJ5cgghDRN4KZdlUaSBJma5euvTdnQ KZ9WdlfuqU4F0OH0dA6qX8cMukyRIFXMv3Ln6ozFAPp3W0GfzeRR0ywQ2wKuFgoR+MVU BJ1iB9mDVXM8KU3VeY0OLAyoLQ73tV/4IBqIlN1Dq6bT3u4N3eOcDAmIZpaCtdvRDxqA VnHlNOVLQsk7Xf1pLVIg+wtAyTPXZVsBHftNacivItnRM0uc71yYfF7ehE8CA5nKzKog RC/obXKrPTuJJWKBTXriCFAYyOJeYy8cv75Z89wLHjYGtM1Bz9N24oPQ68sZ4SQSgN8E 5JNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Pyuu7nsx; 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=pass (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 a38si14262337pfx.337.2022.01.24.13.57.41; Mon, 24 Jan 2022 13:57:54 -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=@linuxfoundation.org header.s=korg header.b=Pyuu7nsx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573745AbiAXVpo (ORCPT + 99 others); Mon, 24 Jan 2022 16:45:44 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:59654 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446321AbiAXVHw (ORCPT ); Mon, 24 Jan 2022 16:07:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3AD77B812A4; Mon, 24 Jan 2022 21:07:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DD39C340E5; Mon, 24 Jan 2022 21:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058470; bh=KcnNIjP6Rz+rHunKoXuupK88UPEDoviX5kS4HSHMa6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pyuu7nsxmi7ZJDdcmi4SS2H/UbkpTuCrzfex8B8HZyOkmK9zORobpaDnY/Cz+/Aik JDu9O/bEMFIXEvqH7oqrulsMLwsPh9pXerF/ru/4SPsG8ABkSeJzj+IluFN1q49AxP fEq7YP+hdfaRHQqZujwNyTwUe3wOnZ6UCoSOz/5c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Steffen Klassert , Sasha Levin Subject: [PATCH 5.16 0266/1039] xfrm: fix a small bug in xfrm_sa_len() Date: Mon, 24 Jan 2022 19:34:15 +0100 Message-Id: <20220124184134.247461826@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Eric Dumazet [ Upstream commit 7770a39d7c63faec6c4f33666d49a8cb664d0482 ] copy_user_offload() will actually push a struct struct xfrm_user_offload, which is different than (struct xfrm_state *)->xso (struct xfrm_state_offload) Fixes: d77e38e612a01 ("xfrm: Add an IPsec hardware offloading API") Signed-off-by: Eric Dumazet Cc: Steffen Klassert Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/xfrm/xfrm_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 7c36cc1f3d79c..0a2d2bae28316 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -3058,7 +3058,7 @@ static inline unsigned int xfrm_sa_len(struct xfrm_state *x) if (x->props.extra_flags) l += nla_total_size(sizeof(x->props.extra_flags)); if (x->xso.dev) - l += nla_total_size(sizeof(x->xso)); + l += nla_total_size(sizeof(struct xfrm_user_offload)); if (x->props.smark.v | x->props.smark.m) { l += nla_total_size(sizeof(x->props.smark.v)); l += nla_total_size(sizeof(x->props.smark.m)); -- 2.34.1