From patchwork Thu Jan 19 17:06:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shishkin X-Patchwork-Id: 13108387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED902C00A5A for ; Thu, 19 Jan 2023 17:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbjASRKt (ORCPT ); Thu, 19 Jan 2023 12:10:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbjASRKp (ORCPT ); Thu, 19 Jan 2023 12:10:45 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4138F872BF; Thu, 19 Jan 2023 09:10:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674148239; x=1705684239; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bhthSGOnd5mtZVdhRqBp03RIkiK20hhGEQnqr2CdGfw=; b=cNQ/CKiRwsyGpoc/4dLBFZzykhBVi154dwwroi6CVhtWoQNvSjLnYYiu BVziKcm7+lT9yzepDDbN/96E8JBTHQrKillLO6B01eSolwnOAfaPwGJL4 KM34qb6kNugCaLbZmjKodO9eTWGMDNk6XIef7Wyqqa9GD9XMzJ64nUTCK QBrgcKrwHPLwPYATVB5UeMigmq4zxilgvlYeMbONl8TegMrXyoRmkO76G HUmYRvnJruZyYwlH79+ikOA7MX9shACoFddFmuuC6uaawTPOpkchi/qJ6 zuA8RD107bWgFZpUWA93lL5bxTtDHg5HbF23eNzWL420H8VxmtKD+ilvC Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="305714639" X-IronPort-AV: E=Sophos;i="5.97,229,1669104000"; d="scan'208";a="305714639" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 09:06:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="784124757" X-IronPort-AV: E=Sophos;i="5.97,229,1669104000"; d="scan'208";a="784124757" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 19 Jan 2023 09:06:13 -0800 From: Alexander Shishkin To: Bjorn Helgaas , Thomas Gleixner , linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Marc Zyngier , darwi@linutronix.de, elena.reshetova@intel.com, kirill.shutemov@linux.intel.com, Alexander Shishkin Subject: [PATCH 0/2] PCI/MSI: Hardening fixes Date: Thu, 19 Jan 2023 19:06:31 +0200 Message-Id: <20230119170633.40944-1-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Hi, Here are 2 hardening fixes around MSIX table size/offset handling, aiming to prevent a malicious device or VMM from triggering bugs by supplying bogus values. Alexander Shishkin (2): PCI/MSI: Cache the MSIX table size PCI/MSI: Validate device supplied MSI table offset and size drivers/pci/msi/api.c | 7 ++++++- drivers/pci/msi/msi.c | 12 +++++++++--- include/linux/pci.h | 1 + 3 files changed, 16 insertions(+), 4 deletions(-)