Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933038AbaKSWco (ORCPT ); Wed, 19 Nov 2014 17:32:44 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:55903 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756872AbaKSUx6 (ORCPT ); Wed, 19 Nov 2014 15:53:58 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tadeusz Struk , Nikolay Aleksandrov , Prarit Bhargava , Herbert Xu Subject: [PATCH 3.17 032/141] crypto: qat - Prevent dma mapping zero length assoc data Date: Wed, 19 Nov 2014 12:50:55 -0800 Message-Id: <20141119205151.698077659@linuxfoundation.org> X-Mailer: git-send-email 2.1.3 In-Reply-To: <20141119205150.700188369@linuxfoundation.org> References: <20141119205150.700188369@linuxfoundation.org> User-Agent: quilt/0.63-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tadeusz Struk commit 923a6e5e5f171317ac8bb462ac4b814fa7880d3c upstream. Do not attempt to dma map associated data if it is zero length. Signed-off-by: Tadeusz Struk Tested-by: Nikolay Aleksandrov Reviewed-by: Prarit Bhargava Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/qat/qat_common/qat_algs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/crypto/qat/qat_common/qat_algs.c +++ b/drivers/crypto/qat/qat_common/qat_algs.c @@ -650,6 +650,8 @@ static int qat_alg_sgl_to_bufl(struct qa goto err; for_each_sg(assoc, sg, assoc_n, i) { + if (!sg->length) + continue; bufl->bufers[bufs].addr = dma_map_single(dev, sg_virt(sg), sg->length, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/