Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2673852pxj; Mon, 31 May 2021 07:59:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuHEQWh8Wqz5+ZQ8IleouOtP3aYMVyutWI6lTcQDsmIk5Lgq42CuUYjU3lwyLnQb4iLuQu X-Received: by 2002:a05:6638:3290:: with SMTP id f16mr21332226jav.49.1622473176683; Mon, 31 May 2021 07:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622473176; cv=none; d=google.com; s=arc-20160816; b=VxwuJT49nQhmrMhpvzOhvMhUtNs7Tf5ocxZud9Psr8adIlXpnKmqEK2Q1FkNNa6hYX hUb5qcooK51eDRsIMIkg9ob5ww9GVjhDNOxZQ0MVkgYfMHFjPa8K1IynyfeMT4T2b7WA +co72hIltKUPi2YoWnOFBgvy82R4suFcA9Qr0YtKmiZJcODSHeH5sSgyIWBLB2IBTT/u Xtd0IeuM7a/8/yXIZSyP0lG/ZQNct+T2TJ1UHI4TFI1uRolYkWFNUucpJL9wF9qGC9zO 9Fvw5csH3Hc2Tz7KsSnUTRLW2WSfjeLAdQPUNO1GpZwYdJx2a/MUjouOSawa0AniLHRp W2kQ== 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=LK2fm4UY3qi2VoyN/0yTNq68MI+rw0Q2xyo3likLToc=; b=qSucwQpeM0E1J3CRs/PeYaymXzt2pORte7XPpCcuB7SqMjGwtpvUD8GBLwu+SK130Q ngMlNp0ZqdKr5hsCHgpMfejFz9IJlKFKID7dPcuIcnRLZjZ5jFLy3BkqpEDXU4Xy2b/m 9wiRbFbtsFYMSwOTWR0gY27toS6Uz4xuA6sRJJnJi6SlX7ArCD3O09iz845QC82E+ZrJ ZpW0Q0tlnfIRoXhEtRsqIwZW1OLvcaDQjTrwMLhAXgEyGBn7Bqh5VGuNFBtY9d+wa4rd xOrXt88F5i82GYytVIF8/v1RswXVcs9bC2ZqMVDR55xemO8ZpXCf4rC784obboj7WFSN hJqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hJCEXhvy; 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 d8si13955786ilg.2.2021.05.31.07.59.23; Mon, 31 May 2021 07:59:36 -0700 (PDT) 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=hJCEXhvy; 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 S233032AbhEaPAY (ORCPT + 99 others); Mon, 31 May 2021 11:00:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:37362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232810AbhEaOF4 (ORCPT ); Mon, 31 May 2021 10:05:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17E666195C; Mon, 31 May 2021 13:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468323; bh=3Shp8sSKKLxkGkhTI0C21kKKh1LOq5TbLqI58tEXAGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hJCEXhvyScR5Kpdqjq8qrDptw6n12vpFCNMTbciHA5OgQGwqm/EIZmaAIOTEzTlo5 Gn8oVQOuv1v9dcY0fAho6W5sfXT2j0TJzI1IcJgmVVUQpwqtscRzWWtSYmJ0JZeLa9 QpOAyUVyX1yh96ojvuDMD/wvTbtLWBUgNsh3ohWY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 201/252] chelsio/chtls: unlock on error in chtls_pt_recvmsg() Date: Mon, 31 May 2021 15:14:26 +0200 Message-Id: <20210531130704.845407722@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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: Dan Carpenter [ Upstream commit 832ce924b1a14e139e184a6da9f5a69a5e47b256 ] This error path needs to release some memory and call release_sock(sk); before returning. Fixes: 6919a8264a32 ("Crypto/chtls: add/delete TLS header in driver") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c index 188d871f6b8c..c320cc8ca68d 100644 --- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c +++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c @@ -1564,8 +1564,10 @@ found_ok_skb: cerr = put_cmsg(msg, SOL_TLS, TLS_GET_RECORD_TYPE, sizeof(thdr->type), &thdr->type); - if (cerr && thdr->type != TLS_RECORD_TYPE_DATA) - return -EIO; + if (cerr && thdr->type != TLS_RECORD_TYPE_DATA) { + copied = -EIO; + break; + } /* don't send tls header, skip copy */ goto skip_copy; } -- 2.30.2