Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1658444ybh; Sun, 8 Mar 2020 09:40:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtmz3kagY0keZjH/porD6V+Uv7kIGBMIgrpSXUwOkSj5bRadWepqMYe77g7JpAKkksh2zoT X-Received: by 2002:a9d:7508:: with SMTP id r8mr10221684otk.116.1583685604490; Sun, 08 Mar 2020 09:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583685604; cv=none; d=google.com; s=arc-20160816; b=URmdvX1+wZqWM/Mh8kHOjySj433Y5Ckah5Ib3lN6QnSSSjawIlNUswhcMWC+yCTVi2 9byDJYEIyi5VUchTT3pLslzsyXN74iDYJb3tjwkRnvUaXPev+gvYA/9gjjar5At/GPL0 7M4rW01lNDtFkI7x8ZnEHkjlkqfq4e51U9GQvg58xcZM78C+n4Q48IsaiWlVGbEPI9Ab XSUtA7T7FT507JgMsmGRT0aC11v8tmwRJUO5qFv/RnXBi1RaE8JWX3vDgcrE0FK5Tjep sLaqcoX8s7CXZ4Its0/L1LnqVUovlUlt6g6BV0+N/V+/rTy/QznC/fAK5IhGc/LeH16h 1CXg== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=6Fx6Ry6nl79qdTgR2R8SE/qlYTFcSFMEX1AS2HEJP5k=; b=fi+39M3gOxXw8Qkxm1PiPrddz/EcVMIzwDgJcEz/jyEPVNcG0VgT1BSQErPj4iiHjl NVc45nTx3TKwHuTXfw6ud/31ESme8UzREV4C+80PcqIQED+T4VKmTeMZOYLt3WZWtzGX 85ofO7VT3m8W8ULrDefgffRTWQ9dI+B1NFX7IFNksBJPe91Fxi+k8DNvT8FXSna7CGCF pcvyWEmu9WAu6/NMHSE7ncvHRqpLHY0Rvcm3/SmqZ2jkEKPOc2XAPw7Bbmovs0zYsQQR yEKpJvLBuRgDjDKlMxqkiRYdo56iTwdQAMgaYkNKWE1Y1RocRSIhRmoTyTdcBMKgaWhT nhUw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si4974402oth.1.2020.03.08.09.39.53; Sun, 08 Mar 2020 09:40:04 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726353AbgCHQih (ORCPT + 99 others); Sun, 8 Mar 2020 12:38:37 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:56798 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbgCHQih (ORCPT ); Sun, 8 Mar 2020 12:38:37 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jAywj-0007Uz-GD; Sun, 08 Mar 2020 17:38:33 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 02D481C221C; Sun, 8 Mar 2020 17:38:33 +0100 (CET) Date: Sun, 08 Mar 2020 16:38:32 -0000 From: "tip-bot2 for Vladis Dronov" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: efi/urgent] efi: Add a sanity check to efivar_store_raw() Cc: Vladis Dronov , Ard Biesheuvel , Ingo Molnar , , x86 , LKML In-Reply-To: <20200305084041.24053-3-vdronov@redhat.com> References: <20200305084041.24053-3-vdronov@redhat.com> MIME-Version: 1.0 Message-ID: <158368551265.28353.5476421599260286182.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the efi/urgent branch of tip: Commit-ID: d6c066fda90d578aacdf19771a027ed484a79825 Gitweb: https://git.kernel.org/tip/d6c066fda90d578aacdf19771a027ed484a79825 Author: Vladis Dronov AuthorDate: Sun, 08 Mar 2020 09:08:55 +01:00 Committer: Ingo Molnar CommitterDate: Sun, 08 Mar 2020 09:56:48 +01:00 efi: Add a sanity check to efivar_store_raw() Add a sanity check to efivar_store_raw() the same way efivar_{attr,size,data}_read() and efivar_show_raw() have it. Signed-off-by: Vladis Dronov Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Cc: Link: https://lore.kernel.org/r/20200305084041.24053-3-vdronov@redhat.com Link: https://lore.kernel.org/r/20200308080859.21568-25-ardb@kernel.org --- drivers/firmware/efi/efivars.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c index 69f13bc..aff3dfb 100644 --- a/drivers/firmware/efi/efivars.c +++ b/drivers/firmware/efi/efivars.c @@ -208,6 +208,9 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count) u8 *data; int err; + if (!entry || !buf) + return -EINVAL; + if (in_compat_syscall()) { struct compat_efi_variable *compat;