From patchwork Sat Jun 23 17:52:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paulo Alcantara (SUSE)" X-Patchwork-Id: 10483801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0AF716023A for ; Sat, 23 Jun 2018 17:53:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 053CF28971 for ; Sat, 23 Jun 2018 17:53:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE34A289D0; Sat, 23 Jun 2018 17:53:03 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 9C97F28971 for ; Sat, 23 Jun 2018 17:53:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751772AbeFWRxD (ORCPT ); Sat, 23 Jun 2018 13:53:03 -0400 Received: from mail.paulo.ac ([34.238.86.106]:33408 "EHLO mail.paulo.ac" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbeFWRxC (ORCPT ); Sat, 23 Jun 2018 13:53:02 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.paulo.ac (Postfix) with ESMTP id 4E930C254CD; Sat, 23 Jun 2018 17:53:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at paulo.ac Authentication-Results: mail.paulo.ac (amavisd-new); dkim=pass (1024-bit key) header.d=paulo.ac Received: from mail.paulo.ac ([127.0.0.1]) by localhost (mail.paulo.ac [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09uX8mhydGqW; Sat, 23 Jun 2018 17:53:00 +0000 (UTC) Received: from localhost.localdomain (189.27.253.103.dynamic.adsl.gvt.net.br [189.27.253.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.paulo.ac (Postfix) with ESMTPSA id 3C82FC0537F; Sat, 23 Jun 2018 17:52:59 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.paulo.ac 3C82FC0537F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=paulo.ac; s=default; t=1529776380; bh=3lP6o5XitsYb/pV+C4wMfA6XgOChaSQyegyRoNmIe1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwWoZpjOYlQRhY5xcxK0wpbR/C5AlJW6Nf3HVBqNewr/xUfwTn8NVILAFF22DNHGG M3X31gBbcskdfdAFEzZuTxwX4RmQTgSAi6BdRB7zJInroxTwv/R92cLOg6nX9+7u0D RmADmreW7SwhWc4fWWvT5CK+Ne6i5bP2BWPw1eXw= From: Paulo Alcantara To: linux-cifs@vger.kernel.org Cc: smfrench@gmail.com, Paulo Alcantara , Paulo Alcantara Subject: [PATCH 3/3] cifs: Make sure all data pages are signed correctly Date: Sat, 23 Jun 2018 14:52:25 -0300 Message-Id: <20180623175225.31162-3-paulo@paulo.ac> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180623175225.31162-1-paulo@paulo.ac> References: <20180623175225.31162-1-paulo@paulo.ac> 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 Check if every data page is signed correctly in sigining helper. Signed-off-by: Paulo Alcantara --- fs/cifs/cifsencrypt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index b4672eafc5bf..85b31cfa2f3c 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -83,7 +83,13 @@ int __cifs_calc_signature(struct smb_rqst *rqst, kaddr = (char *) kmap(rqst->rq_pages[i]) + offset; - crypto_shash_update(shash, kaddr, len); + rc = crypto_shash_update(shash, kaddr, len); + if (rc) { + cifs_dbg(VFS, "%s: Could not update with payload\n", + __func__); + kunmap(rqst->rq_pages[i]); + return rc; + } kunmap(rqst->rq_pages[i]); }