Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4882994pjb; Mon, 27 Jul 2020 07:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysszEkFYAezraYc+0gLIKr/f8VyCBOcQs+a2OvHrosdH7TuHDNiIRLqi8avnv9LbJPgRwG X-Received: by 2002:a17:906:7a16:: with SMTP id d22mr7624148ejo.478.1595860324802; Mon, 27 Jul 2020 07:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860324; cv=none; d=google.com; s=arc-20160816; b=ro8dilQaHnGZDno+S+/F6mjMt7TlobhObskmfGfTsgAcl8lB6A9/3sEK2AArerlaZ7 2Rh1shXHhTrbiJxA1IqQlQQ998fasB7pNCbxG7VvsJnG1Z1E4hMr4e+CTqv1GsRQybn7 LqLTSawcBPVXncNnRxXtWdYyWQqe8sa+AUS/j46zjePm1eJwc+RlRQApQ+QBDvA+0Q1s XQHtLY9Uyqv3kW4b0XB4mwAV8SycYtqK0Ytj5G4D68Nsj1YWyyJRfycdOXEQO4LaMPeZ 4ah2CiVUz65fkmjw9ThkFkbZkuJJ0YhXnPZbV0lloRTKK8dfn6MaLE1TiRRSOTcTT/jr iWwQ== 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=cy2hWMBDa6AG9BTg00Qet/skQaC9MRU29t9U6eTNxSY=; b=S6jTraHILFoAxM9OMk/u1ZID/EI5rAqQOCT30lMJScYWlGIu2IG26t905fuoPu2cVC flVFWK+/OU6ZJn49qrlIl49t3ICKr5UNWJ1Uy2m5NFMLFQ8a5hmTp7EfnpW5ZXLkv2Hb RK4BZpJFfpPo/d4N48+u69J26M+qQgrMH/x2/Y++NGGPdPJdtTrFT9XDWDxwsnGzfmb0 f2NJ4vZhOfPR61/F3+pYOgSa7itKIOdTddpV7DXsHUItRXkcv9EFuuRs3JixI/qNwBgb Si/FqoilBhaPvpDIek1HWFZRHimYhLy48bKdBijyBetvzLCu/BdgcrUGVhxzh4KaSdn/ cvlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SuEfUiTd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si5589318eji.185.2020.07.27.07.31.42; Mon, 27 Jul 2020 07:32:04 -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=@kernel.org header.s=default header.b=SuEfUiTd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732355AbgG0Oa3 (ORCPT + 99 others); Mon, 27 Jul 2020 10:30:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:50590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731797AbgG0OVv (ORCPT ); Mon, 27 Jul 2020 10:21:51 -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 0A0452070A; Mon, 27 Jul 2020 14:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859711; bh=qrLmXgZbIEcHIp+0WI3P3rg3unMUaFsDnDu4Pd2+yeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SuEfUiTdxsNjr3Rr8FIDp2kSau+Bq7BWD4Uwo4rnhqDSCKoRW8vm25/6wC+XXOehz YRRnSTMWINP8u8nR8c8rJvm0WEaYQKHh+l52Mgduc1amgg/ayjKaJUr5CgoKyxw5eL dsrzf5FMGyBpe5Lc10cOPfNnsBFyqNkkhUT3JBNc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinay Kumar Yadav , "David S. Miller" , Sasha Levin Subject: [PATCH 5.7 075/179] crypto/chtls: fix tls alert messages corrupted by tls data Date: Mon, 27 Jul 2020 16:04:10 +0200 Message-Id: <20200727134936.334859651@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Vinay Kumar Yadav [ Upstream commit c271042eb6a031d1333cf57422ec1d20726901ab ] When tls data skb is pending for Tx and tls alert comes , It is wrongly overwrite the record type of tls data to tls alert record type. fix the issue correcting it. v1->v2: - Correct submission tree. - Add fixes tag. Fixes: 6919a8264a32 ("Crypto/chtls: add/delete TLS header in driver") Signed-off-by: Vinay Kumar Yadav Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/crypto/chelsio/chtls/chtls_io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c index e1401d9cc756c..2e9acae1cba3b 100644 --- a/drivers/crypto/chelsio/chtls/chtls_io.c +++ b/drivers/crypto/chelsio/chtls/chtls_io.c @@ -1052,14 +1052,15 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) &record_type); if (err) goto out_err; + + /* Avoid appending tls handshake, alert to tls data */ + if (skb) + tx_skb_finalize(skb); } recordsz = size; csk->tlshws.txleft = recordsz; csk->tlshws.type = record_type; - - if (skb) - ULP_SKB_CB(skb)->ulp.tls.type = record_type; } if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) || -- 2.25.1