Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1013245rwi; Wed, 19 Oct 2022 05:50:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5726HIRyNcdUgHS7+oNmN9GSDBOiWuqPK4Uqiic0ll2x9GqVQm3Lfr+zW+oZGKrqfyZZg1 X-Received: by 2002:a63:e153:0:b0:439:2fa3:74d1 with SMTP id h19-20020a63e153000000b004392fa374d1mr7050369pgk.85.1666183825046; Wed, 19 Oct 2022 05:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666183825; cv=none; d=google.com; s=arc-20160816; b=smixOf2morTk3B5cknZ4Hqnr1KtjzB+Gq0JU0FYzToT/5w9vuRRZZqSKadFkBKZQJW NfXZOJnP1hWEvqjtV8drOwnrSd9TGBXkmZfY10BqsCGD9Vq0tQLNDppJPY3V0rtYmdU0 ob0VBQa6LVtOmeU8BQpsC1OAv91lkTCEZaUwEVy2Di30OfzcEvU2tMao9xkSgOzOSF82 NIwDSuHFMDefoDpOqDyWcyAIp+c+qiXNZWEaVPYAjn1QHZD/CwaoGhyc9ZiKU/4O5Pfx ETdcWWpvh1ieQFPJRDGkbXKAy/Nwx5ieYyd430qUlJcq+Ju53mw/cSqHClBc+MFYXdQG T0GQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a63ba44000000b0044ed36e5a29si18611023pgu.715.2022.10.19.05.50.12; Wed, 19 Oct 2022 05:50:25 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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);