From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6401200A6 for ; Fri, 21 Jul 2023 19:09:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62FFCC433C9; Fri, 21 Jul 2023 19:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689966569; bh=jFePZwF/0puxAcEyc4/KW8vKQAMNFxT7bwIjOohPr20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UwKyqr8NXddozjuUMzK6NdTpChkjKmA/FKyaEeQCOLPMNAeilYIcV9O71HsFuHXSP cxL70C1f7bAQBDclQzRgT9HTGltdV85Ffj9wKC9nzC9yFLLGV7nR/G3MuL7RAKp6Nf 1MrNfNzjbW39XAso1SslyEVB9CSes8Arvh5Tl6Q0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tom Talpey , Ronnie Sahlberg , Steve French , Hyunchul Lee , Namjae Jeon , Ralph Boehme , Steve French Subject: [PATCH 5.15 391/532] ksmbd: use ksmbd_req_buf_next() in ksmbd_smb2_check_message() Date: Fri, 21 Jul 2023 18:04:55 +0200 Message-ID: <20230721160635.688537672@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230721160614.695323302@linuxfoundation.org> References: <20230721160614.695323302@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Ralph Boehme commit b83b27909e74d27796de19c802fbc3b65ab4ba9a upstream. Use ksmbd_req_buf_next() in ksmbd_smb2_check_message(). Cc: Tom Talpey Cc: Ronnie Sahlberg Cc: Steve French Cc: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Ralph Boehme Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/ksmbd/smb2misc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) --- a/fs/ksmbd/smb2misc.c +++ b/fs/ksmbd/smb2misc.c @@ -347,16 +347,11 @@ static int smb2_validate_credit_charge(s int ksmbd_smb2_check_message(struct ksmbd_work *work) { - struct smb2_pdu *pdu = work->request_buf; + struct smb2_pdu *pdu = ksmbd_req_buf_next(work); struct smb2_hdr *hdr = &pdu->hdr; int command; __u32 clc_len; /* calculated length */ - __u32 len = get_rfc1002_len(pdu); - - if (work->next_smb2_rcv_hdr_off) { - pdu = ksmbd_req_buf_next(work); - hdr = &pdu->hdr; - } + __u32 len = get_rfc1002_len(work->request_buf); if (le32_to_cpu(hdr->NextCommand) > 0) len = le32_to_cpu(hdr->NextCommand);