From patchwork Wed Oct 19 08:23:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp300182wrs; Wed, 19 Oct 2022 05:33:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70GPz2vhdEhYVRCpmVJ/icVEsTOm8Rfe3onjNqAzR6oTVU17xpcrCcOxHzLoFUykPwSXA6 X-Received: by 2002:a17:90a:65c7:b0:20f:8385:cc18 with SMTP id i7-20020a17090a65c700b0020f8385cc18mr9259249pjs.235.1666182829066; Wed, 19 Oct 2022 05:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666182829; cv=none; d=google.com; s=arc-20160816; b=qBTZITJve6MH+dqNTY/nfmzjMJlySK0zhYQhqlBAxEUEa535glDqEw2UkgMIQ9mK1r UQRyMWPaHXf/0FqtP3bVJ4jzHHaU1onetcvIejKT4QHIldyrZBKbh+ArHC+gPYxWSmGu dWdMgJfoOYyjnKBljaUIz3EAFXJWNtIOy43fCIC0BSi82LGDSfjehUHfzkYugxWsufKC t0x6iVLKzm7IAxlT3w/VaeBxiXfSlHSvWkbQsSUfvO163cNCOWhoR/ioHCkHIfLyqQTX bv/Z3OIzE7VUfJ9Hck6jfwpkWrAGOONIQilPXDJk96qpfk4yZN1bfXelfp8xNpNsPUtE KSYQ== 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=glXiiPjqUWOzFUkRPfEDJqE6ASYxwcDlJ+uIOFdclLBt/2XS2fOjLdHtnl1ehHLiA5 /HKQPssBO/k3fmEIwfQN6UpDXvpT40fap4Hne5nADQItD+sGYuOBHpWduvZvF4BzJJAT HLiwUZpzrjc8oKk8PHDv9JaOX5TlCT+pNnyY0FI0sbostM+uDdblsPMEX1k6IIi/Y/qo /LXCXGhdulm2c2cQegzbeMaJ9iqy/RsSop+XCfGRxl6ZTyZmztL1Hk9nfcNRmk+u6VPT msCEBxrvuqJlPr3584z/Bn5AOkaeOT2HYKO9Uv6eUj0Yc17DmpJ1P8miBiFz0UJZvUeC 7bLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nY1BTvoM; 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 s5-20020a656445000000b0043a256f5b17si20313257pgv.555.2022.10.19.05.33.32; Wed, 19 Oct 2022 05:33:49 -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=nY1BTvoM; 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 S229751AbiJSMUD (ORCPT + 99 others); Wed, 19 Oct 2022 08:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233149AbiJSMTG (ORCPT ); Wed, 19 Oct 2022 08:19:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECCCC17652D; Wed, 19 Oct 2022 04:54:15 -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 036DEB822F5; Wed, 19 Oct 2022 08:44:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CE04C433C1; Wed, 19 Oct 2022 08:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169081; bh=wQtvt0pQYSjjl8y2IQ9Sln7QvAgF+4ZI5oQv0B0dNBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nY1BTvoMq3KBe5g7ohGAcEyDy56lD/TtLtrkvhqDraN0SrObSjf1M1qn/pGQ7LZPf UH75JLXSBCjtKA4gdDg+Jz6Y7uV5cZ+7nh2edThrrzrSMyDHxblpX/tIUNpgzDZCSM BtPElBDo3SUGnALIeX4wIQ7ogxTP1tQbDbFJkcpA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Namjae Jeon , Steve French Subject: [PATCH 6.0 114/862] ksmbd: fix endless loop when encryption for response fails Date: Wed, 19 Oct 2022 10:23:21 +0200 Message-Id: <20221019083254.960703263@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747119326464669705?= X-GMAIL-MSGID: =?utf-8?q?1747119326464669705?= 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);