From patchwork Thu Aug 23 23:31:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ronnie Sahlberg X-Patchwork-Id: 10574671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1541109C for ; Thu, 23 Aug 2018 23:31:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FB3A2C70C for ; Thu, 23 Aug 2018 23:31:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93CE42C70F; Thu, 23 Aug 2018 23:31:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 492E32C712 for ; Thu, 23 Aug 2018 23:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbeHXDDt (ORCPT ); Thu, 23 Aug 2018 23:03:49 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36522 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726085AbeHXDDt (ORCPT ); Thu, 23 Aug 2018 23:03:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BE70C5BCD2; Thu, 23 Aug 2018 23:31:50 +0000 (UTC) Received: from test1135.test.redhat.com (vpn2-54-77.bne.redhat.com [10.64.54.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 221A02026DEF; Thu, 23 Aug 2018 23:31:49 +0000 (UTC) From: Ronnie Sahlberg To: linux-cifs Cc: Steve French Subject: [PATCH 11/11] WIP. temp fix to suppress the dequeue_mid crash Date: Fri, 24 Aug 2018 09:31:31 +1000 Message-Id: <20180823233131.1153-12-lsahlber@redhat.com> In-Reply-To: <20180823233131.1153-1-lsahlber@redhat.com> References: <20180823233131.1153-1-lsahlber@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 23 Aug 2018 23:31:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 23 Aug 2018 23:31:50 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lsahlber@redhat.com' RCPT:'' Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ronnie Sahlberg --- fs/cifs/connect.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c832a8a1970a..4b82cf77da78 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -970,6 +970,17 @@ cifs_demultiplex_thread(void *p) mids[i]->resp_buf, server); + /* + * Only invoke the callback for the last + * PDU in a compound chain. + * This prevents a bug from triggering a + * crash in dequeue_mid() + */ + if (server->ops->next_header && + server->ops->next_header(mids[i]->resp_buf)) { + mids[i]->multiRsp = 1; + mids[i]->multiEnd = 0; + } if (!mids[i]->multiRsp || mids[i]->multiEnd) mids[i]->callback(mids[i]);