From patchwork Sun Apr 29 11:06:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 134661 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2663687lji; Sun, 29 Apr 2018 04:06:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqG1+z+Uctm5CsH2mnp3cmqbn9MyBOdTmB+yacYOhO6UuJetkPxZ9tzCWV8k03inlAdGExI X-Received: by 2002:a17:902:7844:: with SMTP id e4-v6mr8747637pln.296.1525000006331; Sun, 29 Apr 2018 04:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525000006; cv=none; d=google.com; s=arc-20160816; b=Z02RMjsjZBJUL1nmT5adt8xcgj/YNGlMoxUY3q/ZmtgxvkNh4gJp5IF2PnM9cUxBZG G1d1+FPdGBSZmVVsnAAOzuWqlWYrtDZoTUcXXXC2CSz9MusFY0Tm0GfyrUfj1FcfWOmp 6WG9bJK3m3NoQQYqCOXCSeRYVUfLJTXBIH6jpbq7oSyxsvKX5nvHLBRUdhfnI0VnAo5F YUeNDDBREGLMN5x9lZG0mkzv3YySouefPoMLiUIxThA2fvbPDYhausE2hUAkWNma5rI3 P4KZbljTET693rdx+5HcZ+xo6gtwnxrYaSGZfWv/d6JURLOEm0FHXrk0nVbmoN7CrKbF JS+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=OqTpSzX5rGXlQje/ylUcbmEmwhuhuGOj9mmbDxZ+7L4=; b=iUO6l7qd6bOR71Szfo7jbcBu0f/EyKD3dWR/6U0TYZv/7WbCSUlIEieYcZdSAkLXYJ 0ErTCquHCZZL6+zJGAQ7CseROa52GvXOUm0r+8MufAWodVnFdNR3ACKDenWVj73JjRjv 0M1gfrhgITzhpSgXRWTsXtxnnsWretzxYhdFuQ1SyKmo/eJE4g8gQl7xzFoM3dm9Endz WibUpEwiLU9f+IvYyZz+yOm6+dQ8+9KjSQXJYM89AFWwOxkO6yNfkYY30VzH2oYlFYD4 +FtFYgy9YLdhEoppSmKCkRhsp+EL11CLRotSk4zdFhub/U/jx+X4tNAWTXwVN/gZHSU4 iUyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BaAxAzJ3; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4-v6si4541255pgq.683.2018.04.29.04.06.45; Sun, 29 Apr 2018 04:06:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BaAxAzJ3; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752875AbeD2LGo (ORCPT + 2 others); Sun, 29 Apr 2018 07:06:44 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44899 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752415AbeD2LGo (ORCPT ); Sun, 29 Apr 2018 07:06:44 -0400 Received: by mail-wr0-f194.google.com with SMTP id o15-v6so5519824wro.11 for ; Sun, 29 Apr 2018 04:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=dgtX5E5JduCajbokcQY5jFpDDC/fDp1mz6JlzzntWSc=; b=BaAxAzJ3AeXtmgzFvWBoRcgIFF9eg724giGZy68A7iQb1dapcJ+AQmvh+CQLKOe1o3 BNJGtDh0DV758/JWeYfhwKwJiLQX2AaV7C15a8+tXAuuTvGqpM86yQno36zD8NBDSfpP dxQNHhBtzW4bEW/QDC0ariTW14/amjj6kel1M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dgtX5E5JduCajbokcQY5jFpDDC/fDp1mz6JlzzntWSc=; b=F0Lhi8oMvACvvF96zDkmbdg0eAkZ8J6HO8nr/SBnHPX3plvpVdmPPvvxl/PKdYqiGN 21EyfdxgWrZ8dUf0xZU0t7y4Y1xUhxxY2UuAOgNFjaySCMY9ELp0hOjJeL5Wi2dp8JlX CpNBgt+3FOudeSqIl1E5dK794YM7GXwcAZi6Pqy1CbygCP5uul1GzN7LugtZP7S6Rws3 d2uss2sJthGLtkfXyckxPuPAFkrWNvSR/OVykPhAjJyJB35L/ABvYhTTzlPW/t8Eviam 5fxL1bGUPSY/a2Wy+6jJW0L0MwW66XibIjEa/CUCFqi59fm/bynNJlvDbGuxLwkxEy4F YhVg== X-Gm-Message-State: ALQs6tCEOdy9SbdOHdzx/Z8E7VxFtsSDyAUADBg7T2mfeI3Lk7m4jGjB XsFPhl0GqOp1b4YirmRhS0ipGXxupIc= X-Received: by 2002:adf:c908:: with SMTP id m8-v6mr6663385wrh.6.1525000002802; Sun, 29 Apr 2018 04:06:42 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id a13-v6sm4783275wrc.19.2018.04.29.04.06.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Apr 2018 04:06:41 -0700 (PDT) From: Ard Biesheuvel To: mingo@kernel.org, hdegoede@redhat.com, linux-efi@vger.kernel.org Cc: lukas@wunner.de, Ard Biesheuvel Subject: [PATCH v4 0/4] Ignore unrealistically large option roms in EFI stub code Date: Sun, 29 Apr 2018 13:06:19 +0200 Message-Id: <20180429110623.13949-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org This is a continuation of Hans's work [0] to ignore bogus romimage/romsize values in the EFI PCI I/O protocol instances exposed by some UEFI firmwares on x86. I have only build tested this, both on 32 and 64 bit x86. Changes in v4: - Deduplicate the 32 and 64 bit code paths so that the actual change needs to be applied only once. This requires some preparatory work (#1, #2, #3), of which the first one should go to -stable. Changes in v3: - Limit the rom-size to 16MiB to match the EFI spec Changes in v2: - Add the check to both __setup_efi_pci32 and __setup_efi_pci64 instead of only to __setup_efi_pci64, some CHT devices which need this still use a 32 bit UEFI [0] https://marc.info/?l=linux-efi&m=152494632116321 Ard Biesheuvel (3): efi: fix efi_pci_io_protocol32 prototype for mixed mode efi: align efi_pci_io_protocol typedefs to type naming convention efi/x86: fold __setup_efi_pci32 and __setup_efi_pci64 into one Hans de Goede (1): efi/x86: Ignore unrealistically large option roms arch/x86/boot/compressed/eboot.c | 112 ++++++-------------- include/linux/efi.h | 14 +-- 2 files changed, 39 insertions(+), 87 deletions(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Tested-by: Hans de Goede