From patchwork Thu Mar 5 08:40:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladis Dronov X-Patchwork-Id: 206484 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D419C3F2D7 for ; Thu, 5 Mar 2020 08:41:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74B5D208CD for ; Thu, 5 Mar 2020 08:41:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZIajPMYz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726036AbgCEIlq (ORCPT ); Thu, 5 Mar 2020 03:41:46 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:40538 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725880AbgCEIlp (ORCPT ); Thu, 5 Mar 2020 03:41:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583397704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TuWQ+iLEiNR6MjU69NtgSJHIMX21Xib1ZaETC6m+QbM=; b=ZIajPMYzFl3kaMofv7zqIfp8eeHCMGf+LimN1j7Ao4WBwy1IYRNpOJpuc8pzPvtoVo00xd 3nhtxEikAEm+ma69eN10VBsSsBFwIjo4z9bJe5u63XdawDhh5jVxGAnkXtjsbJM0VXw37U KpEFetB1aag2PkROIJabjEpXJs3U6Nk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-FyDKhKtVOMup3-dZA3TmHA-1; Thu, 05 Mar 2020 03:41:40 -0500 X-MC-Unique: FyDKhKtVOMup3-dZA3TmHA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD1EB100550E; Thu, 5 Mar 2020 08:41:39 +0000 (UTC) Received: from rules.brq.redhat.com (ovpn-204-231.brq.redhat.com [10.40.204.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BE8819C6A; Thu, 5 Mar 2020 08:41:35 +0000 (UTC) From: Vladis Dronov To: Ard Biesheuvel , linux-efi@vger.kernel.org, joeyli Cc: linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] efi: fix a race and add a sanity check Date: Thu, 5 Mar 2020 09:40:38 +0100 Message-Id: <20200305084041.24053-1-vdronov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org There is a race and a buffer overflow while reading an efi variable and the first patch fixes it. The second patch adds a sanity check to efivar_store_raw(). And the third one just fixes mistypes in comments. Vladis Dronov (3): efi: fix a race and a buffer overflow while reading efivars via sysfs efi: add a sanity check to efivar_store_raw() efi: fix a mistype in comments mentioning efivar_entry_iter_begin() drivers/firmware/efi/efi-pstore.c | 2 +- drivers/firmware/efi/efivars.c | 32 +++++++++++++++++++++++--------- drivers/firmware/efi/vars.c | 2 +- 3 files changed, 25 insertions(+), 11 deletions(-)