Received: by 10.223.176.5 with SMTP id f5csp2131908wra; Sun, 4 Feb 2018 21:37:01 -0800 (PST) X-Google-Smtp-Source: AH8x226bhZkkyyvajNiExwyM8CshQSKtbbdT5Ale1UnjinhfHr5sWuS6Hd4G27o84DB3JB1Wh0zC X-Received: by 10.99.149.8 with SMTP id p8mr35962845pgd.186.1517809021559; Sun, 04 Feb 2018 21:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517809021; cv=none; d=google.com; s=arc-20160816; b=cTPzoxe/n3iwbf8hS5CwJ11DxmeAxQTNMZ3GyaVLdyjsiRwcxYoNh9SxUlNokZphg9 s4rZoN9uiFObowjan0hxtwJEmvwT44cw5a7KnaZjQca1MuSDLFr9f5BUhqZ5BEQ4o0xb zzeq/59jON+05dia01h8vXXNgDVKYpOVN+upLLo+qE7uQ51MSkeMrzCz9t9uSSNuTr3l bm2j6KHD8znClopTEfH+6oShBiGt17/iJsrjAA/ZIHAWVSMDh2u3UwOmOuDcpk3bJ04l hLYjqmSWSxy81jUO5ZdgYgcMtMTmrAtuV4gDZC3qolPDLwcVojYF71sF9NT/I+hC3bBZ bl8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=991rOOYrg9siQRKRMFqe200tLAQurIhKXurKrh4p6so=; b=ROYVs4WrlqLFMtVeFdM75CKUcAEq0CaGGCGBwmNzXeXNvGQR2EOrcanPdSBVvrAcFA RmT6LDSH5PmzbQ3X1I6HnrdDqC6HMMMpGC9B5mlBlk15nMlhfqbiZOUdxPWfzUVYv2zm ZMf7eVNTwvOkWfa0QVbiSg16hl76OZnMMIPV4CDogKYAmitU3xuoGOG6THeKKbgCT1JP mctkK7u3TrS985TMkNL/ZDuk3QrQ100y0BEapo2l+25K1OPwljxeu9NNNkDIFZL1xAO+ 7JYjlimod/sJ9nRw2qkB/sDu/6yxKVJPNeevCMlsNQb53QdrmfrX9Th8BKjjfmckZ4W+ /ySA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si6342915plm.382.2018.02.04.21.36.45; Sun, 04 Feb 2018 21:37:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408AbeBEFex (ORCPT + 99 others); Mon, 5 Feb 2018 00:34:53 -0500 Received: from mga02.intel.com ([134.134.136.20]:6032 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750724AbeBEFer (ORCPT ); Mon, 5 Feb 2018 00:34:47 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2018 21:34:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,463,1511856000"; d="scan'208";a="27299684" Received: from vkoul-udesk7.iind.intel.com (HELO localhost) ([10.223.84.143]) by fmsmga004.fm.intel.com with ESMTP; 04 Feb 2018 21:34:44 -0800 Date: Mon, 5 Feb 2018 11:09:25 +0530 From: Vinod Koul To: Zi Yan Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Zi Yan , Dan Williams Subject: Re: [PATCH] dmaengine: avoid map_cnt overflow with CONFIG_DMA_ENGINE_RAID Message-ID: <20180205053925.GQ18649@localhost> References: <20180108155050.7387-1-zi.yan@sent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180108155050.7387-1-zi.yan@sent.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 08, 2018 at 10:50:50AM -0500, Zi Yan wrote: > From: Zi Yan > > When CONFIG_DMA_ENGINE_RAID is enabled, unmap pool size can reach to > 256. But in struct dmaengine_unmap_data, map_cnt is only u8, wrapping > to 0, if the unmap pool is maximally used. This triggers BUG() when > struct dmaengine_unmap_data is freed. Use u16 to fix the problem. Applied, thanks -- ~Vinod