Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5440101ybf; Thu, 5 Mar 2020 00:42:15 -0800 (PST) X-Google-Smtp-Source: ADFU+vsn20BtWwLP7xa4evTTtmFiibGI3uumW5vlNCoWentT7/sNaEktUCVMBbLwXJLZ0oynOfIY X-Received: by 2002:a9d:69d3:: with SMTP id v19mr3158104oto.320.1583397735233; Thu, 05 Mar 2020 00:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583397735; cv=none; d=google.com; s=arc-20160816; b=OdzCG/VDwO8XCwbrdSEcCvh3eX81VFaZpPHgnXZd3ASe2yiO/YkVPDQu7NrGgDeRht RgC3+oYBgPQojT+XvjI4dlZMU+vzQBLnOrJ0NhSWlXr1Hr5H2z5bCva3limZphXdFyTE INMqodl7/FzMvVcPNZSXB25ZJNGQvxe+ASXw0BP/p/3su4xkVCY6Hx118cQIJJ4Zeirg 27SaSo2HNE5NmfTmV7TJgDDGdsU41yPM0QBxqk1XCzIkFzBjxUCXPHewMutoKm0S8sOC w2i6Iy9gzeIsQeve4+WQR5IB3gYkiIAYxsv8p24At+vXLoKGE8FwKUi904/e5XbaoBPW +BpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TuWQ+iLEiNR6MjU69NtgSJHIMX21Xib1ZaETC6m+QbM=; b=LG2uK4qEvjJQpVUYXerP2cQdkg1WnsKxH25u2K/W34OZjVOpYu9S9l2iFgeSDiiz6j g73cKhLtMytBq7P9+p8HjtxpdRMCTNJKbsD1lIppYw7Smehzv13iFsiCHM5XkEYCn+gG 3WW0N+pMLlTS2XgtxAjFlzBsTQM0ZPJCeyXSXz9m9zMAd3Ga4Cj0133d9L7gZWFUHkIb p7SIiXmM8ewpvBi8sobuMMSRBSsNvO5CUznK/ndKBPQibS9lM1dGml1+SxBNj8YNBfHp xo6viGG6e2wWlxWq+1sW7GYUKpG2Fg9e+YWvzLlH8dl5psjWrgvmQI+LNvAA0zSr6nPH b1NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YrReZc+I; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x189si2023099oia.270.2020.03.05.00.42.03; Thu, 05 Mar 2020 00:42:15 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YrReZc+I; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725944AbgCEIlo (ORCPT + 99 others); Thu, 5 Mar 2020 03:41:44 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:33513 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725880AbgCEIlo (ORCPT ); Thu, 5 Mar 2020 03:41:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583397702; 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=YrReZc+IYKYnkZKLS82phSkF7nLRb95Fo1K0RY0vEr/atmjVmlnJNN7SXT9qCKbI/6Fo68 CgpnH2eDwNyo0MRr7nE0q+QFFMNWVzfWJpwnRHzWTXTFh+rls3rprNXIduGIVo+BZTcaM7 74XsTMxIicTRdSNWRx6E470WELULSdY= 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 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-)