From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH] iommu/iova: validate iova_domain input to put_iova_domain Date: Thu, 14 Jul 2016 10:34:20 +0200 Message-ID: <20160714083420.GR12639@8bytes.org> References: <1468435772-27905-1-git-send-email-nwatters@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1468435772-27905-1-git-send-email-nwatters-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Nate Watterson Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: iommu@lists.linux-foundation.org On Wed, Jul 13, 2016 at 02:49:32PM -0400, Nate Watterson wrote: > Passing a NULL or uninitialized iova_domain into put_iova_domain > will currently crash the kernel when the unconfigured iova_domain > data members are accessed. To prevent this from occurring, this patch > adds a check to make sure that the domain is non-NULL and that the > domain granule is non-zero. The granule can be used to check if the > domain was properly initialized because calling init_iova_domain > with a granule of zero would have already triggered a BUG statement > crashing the kernel. Have you seen real crashes happening because of this? Joerg