From patchwork Sat Oct 22 07:19:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1089514wrr; Sat, 22 Oct 2022 00:43:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Kdz19s+7WywIfaUPLf3F+gTT3UBGCSYyN67YRotWOpz8gBXur+SLBljIsxhRr4A3sejvA X-Received: by 2002:a05:6a00:10c8:b0:563:1bd1:2ce4 with SMTP id d8-20020a056a0010c800b005631bd12ce4mr23205768pfu.6.1666424613327; Sat, 22 Oct 2022 00:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424613; cv=none; d=google.com; s=arc-20160816; b=xOhXIXksgWh/ehHO86DvYvJQmHTuHZO/kTWzeRmSLoYRxYQEDSd68Vkvt1ZkgPgCY/ j3J+45q93Ld4RMXVK0CsA2DYd3dy/C8X7vAJk9kVpJjApN8kfDpYmvzGU11MVXAFyRFb OOcQ1csvUE/s40ZEfOKK9ZgwSjbYkKj24OW1OFfmvcF1OLvj4lLtnN+473de/+jho11W P4QpHnedT2tI0S6aO5kiWU2DjwyVLd32v6dn9a0KtEsS+YDm89bQmiq40BiLqnpewWHz Nl8aFYKo8LDuVKk34/GxzW8P/bSB3yT3ob3qSY2dm7U0cmooFiq8Gz+qhU0wHaxFeJxh SrAQ== 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=iJS7MwxQ9hIcrf6M5uMCoLuKq8Zs+DwMksVPZEeRhzQ=; b=I8psp80/IQurd0AzoOr0+WE6Nkmrb8cBcjtVO+6hw5l2V5Lg/Nz/FMN8H74NbRiVIj +SHafg9OLkcdXyP2ZQzKEBLdFFHOHrQ5JYGQWSkAZhDERKr2pwXm2JLBd/jCcj/5DExS OO0F8oTUsJSLEx6Wcmij4pQ1ZkkI/LR++qp3kYGr+KxXhyELZsdtwvWJMtFLUuFrBqut 6tF150vHrEdmOHtL0v8Ha71hYWgjj32+elRrobty7V1ey4gYxQNGJ6s9yNeL6+eqxk1w dtFs37K/m4rsNJtrzZTwwIzuT+RBcCkyWc4cXVJ62YeTWCxL3kMIo+BdNx+MFm18FKJ3 VCfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FLNN7coL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y24-20020a17090a8b1800b002031441a918si1854276pjn.175.2022.10.22.00.43.21; Sat, 22 Oct 2022 00:43:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FLNN7coL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231284AbiJVHm7 (ORCPT + 99 others); Sat, 22 Oct 2022 03:42:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbiJVHmg (ORCPT ); Sat, 22 Oct 2022 03:42:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F1F9B49; Sat, 22 Oct 2022 00:41:01 -0700 (PDT) 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 001AAB82DFB; Sat, 22 Oct 2022 07:40:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58542C433C1; Sat, 22 Oct 2022 07:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424407; bh=wQtvt0pQYSjjl8y2IQ9Sln7QvAgF+4ZI5oQv0B0dNBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FLNN7coLmCdU9TLkHohiDCahQFKlLFrHpA1SCp22u/OFgCAJUSKSSzh6/SZGrZYV+ EePWI4423Os9u6dakrUsVAEXIRaMoKczedtHSLA053GcYEfixFrPm0Cw2nuD5QMiRU 54gqHR5HB95Jr0/EB8bHyhrQCNvWaotoP+L5N96I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Namjae Jeon , Steve French Subject: [PATCH 5.19 103/717] ksmbd: fix endless loop when encryption for response fails Date: Sat, 22 Oct 2022 09:19:42 +0200 Message-Id: <20221022072433.621452811@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747372855359714531?= X-GMAIL-MSGID: =?utf-8?q?1747372855359714531?= From: Namjae Jeon commit 360c8ee6fefdb496fffd2c18bb9a96a376a1a804 upstream. If ->encrypt_resp return error, goto statement cause endless loop. It send an error response immediately after removing it. Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers") Cc: stable@vger.kernel.org Signed-off-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/ksmbd/server.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/fs/ksmbd/server.c +++ b/fs/ksmbd/server.c @@ -235,10 +235,8 @@ send: if (work->sess && work->sess->enc && work->encrypted && conn->ops->encrypt_resp) { rc = conn->ops->encrypt_resp(work); - if (rc < 0) { + if (rc < 0) conn->ops->set_rsp_status(work, STATUS_DATA_ERROR); - goto send; - } } ksmbd_conn_write(work);