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: 4253 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp446575wrn; Thu, 19 Jan 2023 09:15:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXsRz9H1K9jR0RCmhl5RdMeFzHP1CeozSQXmGd3vCmZqbwAEKroMo9e8V4GrMLdgJ0ti17eG X-Received: by 2002:a17:906:3399:b0:84d:335e:d136 with SMTP id v25-20020a170906339900b0084d335ed136mr11412433eja.48.1674148557308; Thu, 19 Jan 2023 09:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674148557; cv=none; d=google.com; s=arc-20160816; b=PceAwKuD5QOcCbwsTo46BDCzLi/D7Zn/U4wxb7Z1pbe6vDt5c/WWOsYX2umbDd/mxg jm7IaUeua9vKSuFLUL0KvGRSSOi9H8mng/F1LdNK4ExxZyYv5C7uNUIR/h4SlWNCn7+u MT6wIGSwhaFeXO7dAfG8Lm5lDPKKZRvn92IbmJQQXVpsIZOd4RRn2OpW7QjbRdXkK9jz bBNn5LcGEBCrs1rTTCB/iYh25m4GlI5X0IY9oYYd5JV4RT+90AwGuwl2gs4PHTvcqVUE ceNAohCmH2GwY4KQgqX22vUac2QKDMQBLAFle20V+g1GP5gym4eMkx2ktooGyT9rhtV2 o1Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hY/uGP890IinrmcgktrZL7Gc8NoyEydJ+vU3kBSF4yM=; b=d1yuDKQVyD3dZvKelphqW79/ZDw3CkFotrnQqwwcGmxfvjfQKUQDYeil96pJUizvKN tym1P3v2FNGgS3me0pUC8pkb2bmyPcOsRBoZqqO9VLYxv74NWJ9h3l45wCgCoosPglGt 3sIxUQhgPuLek3ohHW/F9W1ly/iKVbsPcMLK9AgvrCZe8+IbnV+9LNPIZfWzQjHHHkGL gOSJluA5Erscjgwxds7jqOrW+l1EUX9nM6rrWGi7f7RtWb6hJ3dFE+SMopsw/vidw3tN HkFZ2lg9tbM8rhamZ8NP+pCAT5rIvckSFgFyKRA7nEVPhxneAHjYTslFmJU/Ro1hsLqn 1X8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="cNQ/CKiR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wu4-20020a170906eec400b008269916aa9dsi41909845ejb.160.2023.01.19.09.15.23; Thu, 19 Jan 2023 09:15:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="cNQ/CKiR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229818AbjASRKt (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755471997326491632?= X-GMAIL-MSGID: =?utf-8?q?1755471997326491632?= 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(-)