Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3201028pxb; Mon, 9 Nov 2020 05:28:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3poOEyHnuijgpwcxtyFtyYHyiwFaF0H8yH+3XSGOo6NhjQGPjCN8Vo+FkTYCST68D55be X-Received: by 2002:a17:906:26c2:: with SMTP id u2mr14326104ejc.529.1604928480176; Mon, 09 Nov 2020 05:28:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928480; cv=none; d=google.com; s=arc-20160816; b=bMYhhAo0kq1oz0qpjRHtMSYuKpzgJ7y6vKwMMNGKIR8H8Ie+SLu1D+DewAp0yU9Y+d V0B8ijNl3Y2VMmqf4/DJnSXn84ty38WJDfxVPzQvQo9ubqmiJ1OpXEJ6VYSldFEsgddZ uB8nFRPPJEXHIBJT0l+vDQEK6+eXu5KIHsCB65yd+VjDRnqvQEeCgilWdx9tdzvbCTWC 16KiXXsFnr+xcVItxZHlgKfFMURH1CglMQz+Ol2L6m8Yu3/PZ9jEwkMjtWDPr/tuumPb ubu4LG3YVuB0r7c9Af3HApwSzWATDkk7wQLGcgXfN97zt+1TpLuF2rDK91XJS3z5k7r6 TU0Q== 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=hTXkJr6ajnqQ3rkjPJfpHnmVvITOMBxo1ustZ8tFyKg=; b=nGZej+7iyWzejFLJ+gsruFDEH5aQG4y2UHpBMZ2C70a9xTo9wf6RDYbzjF8eMPRrNT TaNnFRPDPqPx4OgTmnBYDNgufqEk2DvnfqsYHJPCAxVP22pUIIOTQPnTOrnwnRS5Botw v1AW05Kh9XxMb2k3NP8SlJsSetjRwpB1mxpwPEVqvo1oQRdwqsa63fsDvOAEXYu7vg82 ZIgD4O+CGJS8kTabbsxoZVhrr+IxqOci2KjFLqDsf6ZOhQ0JMxLjhInIGWMlXacGrUjt 2iG4Cl2xI79Ebv6rX4PfjWKRHPipWWBsexB54N8NRsnmxYAMr2wpd/BoTunFI7x3YeTO qQ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PbKbthom; 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 b5si1925178ejj.52.2020.11.09.05.27.37; Mon, 09 Nov 2020 05:28:00 -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=PbKbthom; 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 S1732982AbgKIN0T (ORCPT + 99 others); Mon, 9 Nov 2020 08:26:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:43776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731647AbgKINQl (ORCPT ); Mon, 9 Nov 2020 08:16:41 -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 32FDB22210; Mon, 9 Nov 2020 13:16:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927800; bh=xbU1shsLUHH8l0swdQELuObqhCkvZnPvwggRopfm+hQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PbKbthomOo32hTNwyB65wpTNY0nYv613huiT6J5H/+s0OfhoaDyoEl9BL1m6uNq4y 6a9X8m6yYE/xu4kj8qC9Yj9eUpsbY3z+Mr55VOg2fGu17TxJkauf/MkuhhnttrdWyT PjX6ZtVyeL2SIzMRxV/H5i/ijo0YZP0W69Hw/c0g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinay Kumar Yadav , Jakub Kicinski Subject: [PATCH 5.9 025/133] chelsio/chtls: fix always leaking ctrl_skb Date: Mon, 9 Nov 2020 13:54:47 +0100 Message-Id: <20201109125031.931203579@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125030.706496283@linuxfoundation.org> References: <20201109125030.706496283@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: Vinay Kumar Yadav [ Upstream commit dbfe394dad33f99cf8458be50483ec40a5d29c34 ] Correct skb refcount in alloc_ctrl_skb(), causing skb memleak when chtls_send_abort() called with NULL skb. it was always leaking the skb, correct it by incrementing skb refs by one. Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition") Signed-off-by: Vinay Kumar Yadav Link: https://lore.kernel.org/r/20201102173909.24826-1-vinay.yadav@chelsio.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/chelsio/chtls/chtls_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/chelsio/chtls/chtls_cm.c +++ b/drivers/crypto/chelsio/chtls/chtls_cm.c @@ -212,7 +212,7 @@ static struct sk_buff *alloc_ctrl_skb(st { if (likely(skb && !skb_shared(skb) && !skb_cloned(skb))) { __skb_trim(skb, 0); - refcount_add(2, &skb->users); + refcount_inc(&skb->users); } else { skb = alloc_skb(len, GFP_KERNEL | __GFP_NOFAIL); }