Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp421169img; Tue, 26 Feb 2019 02:26:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IbD7zdnXOQVygvQNEzA+7zYZnBV40MjWoQSKtrVri6hV97wdV12v6q6jOweHHxoAwBKsUMx X-Received: by 2002:a17:902:1101:: with SMTP id d1mr24620842pla.19.1551176801517; Tue, 26 Feb 2019 02:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551176801; cv=none; d=google.com; s=arc-20160816; b=h+7EwqnC17PONmNYzwWnwT2kNfqzmsRb9sM9bPbtyca6+FoXkZTra+bPiu9/5Rnlag Topm6FQ9UNsxi2yjJKxuRxioUDqKJ/CU/AaKHGceTWtLUFc49YkznUqRrhVig/Yd1GFJ AHufA/843ucF2ZCPpZIsIpxcGv2xQks5vcQOtTk4qCn6zA8UKIhVULNVIO5sX3HitM14 ISGpU3sU5+BHoum4Gy1FLEsRND75DCJs9Zs7V3mGrhuNJHDYBI+0nz5Yi4hvoFNT/A+e q1paLgiTBkhoAXobsYMnFTWkBSs2NHt1ljCqj89CHOg1nuIZUNFfTnzITrisDTEfkFa2 qeAw== 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; bh=kjCEB9GvMkemh+YwLM6k/7/fpCsfuJk0ZYsVlhcVfIY=; b=mx8uJ4Tvj3ru9syqE3ma87F6Derw8Lnr/1MU/JjHh4sC3GqAW/KKXr52DFbw57DcfJ yCvrs27exYlFBYwunS/VFdDw1qJOOWg/bVofOCc0kvbNvJvAiwPZIpAFbCmL+854xdBq JqODLfGX1zPwcWoqU4RcNVAAVJhX1LPfQV7Ua3FCDKQoa0MmZiR5D73ol1LmoURa1ATi FpXs9Q8nuPDiWtihW1OiG+ALrYgM2jzkBUreVTQLJXtbMx52X1sb3jaO985gVIQbwwNS tQijSB6d0547oSv3EY2K9BMNf5IQ2z79VoJuEri72TPvo3tgPpLwb58f9BeWOhOxhJU7 w9Yg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si6544697plq.264.2019.02.26.02.26.26; Tue, 26 Feb 2019 02:26:41 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727476AbfBZKZa (ORCPT + 99 others); Tue, 26 Feb 2019 05:25:30 -0500 Received: from 8bytes.org ([81.169.241.247]:41386 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbfBZKZa (ORCPT ); Tue, 26 Feb 2019 05:25:30 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 4048641A; Tue, 26 Feb 2019 11:25:29 +0100 (CET) Date: Tue, 26 Feb 2019 11:25:27 +0100 From: Joerg Roedel To: Julia Cartwright Cc: "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" Subject: Re: [PATCH] iommu/dmar: fix buffer overflow during PCI bus notification Message-ID: <20190226102527.GF20740@8bytes.org> References: <20190220164630.11087-1-julia@ni.com> <20190220191744.GC1076@jcartwri.amer.corp.natinst.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190220191744.GC1076@jcartwri.amer.corp.natinst.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2019 at 07:17:45PM +0000, Julia Cartwright wrote: > On Wed, Feb 20, 2019 at 10:46:31AM -0600, Julia Cartwright wrote: > > - size = sizeof(*info) + level * sizeof(struct acpi_dmar_pci_path); > > + size = sizeof(*info) + level * sizeof(info->path[0]); > > This is probably a candidate for struct_size() instead, if that's what > is preferred. No, patch is fine as-is. Thanks a lot, applied to iommu/fixes branch. Joerg