Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2305427imm; Mon, 28 May 2018 05:46:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpmJoh7J4d71oqBxJV8WBoz4jlUuGYy6L2mnEUuXkmwMJFSXeFy4P5OojiXLQxXQGPuBYMH X-Received: by 2002:a63:b307:: with SMTP id i7-v6mr10502029pgf.448.1527511577660; Mon, 28 May 2018 05:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527511577; cv=none; d=google.com; s=arc-20160816; b=p+sJXZrtA1WvwNEr7Nfm7ME6qJ5xkSuqHhuxGlTl+7evdbYoanPTzUSJ8Otiig17tR CnSXUYNXuoE+qTyTL4UoAudce4XlKqX7haDdGDZb+QgBb7iOyCEs/6SgoEqxexXX4oz7 BaCcAoI5/NTKsm3qpNy6ruLaH5wuTpNSYfdjoU1ipm4JH9qkwRhXUTB2ISJteP41Q8tg syU2Vd1DIx/EFZ64XNSldRcwUVk7m/g6uqH8tZNlYGnctl2rc9DSOKG1TgUi7LIM3gGP eT2nGzoHgj90MR0nwWgs8eul2/gLxYofszP7RgaGsZvJgP6tGHCkqbTHQHgGGKzyY8ta +0og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=YgozqxwZ3eZ/yH37Eb/UWpDJlxM39OanVMWJ/epYZWM=; b=CRBZbehoFs63QHd6BgtlivE1XMtpgw1BxGzB/FNV9x+wr7IgICSezMLVVQskfuegN5 0yq0QHxB5EVuxopRYuNXrF+yDrS7vJVV2UYB+re4iD9WGXqowELiEZQsPJqM6stTwtn3 azSWNuu1ha9h8eRfO7aH9bWfJT78vEzcG8WhBK3LRd8H/0KJr2J89JUnhUn9E/v3hIvg 1yrkvBTTopN8G453nmHZ2CHcRkbiN3RHAFBN9+iZ/3GtpR1EDSMaomE0+//iCTujBb4c xRrQ8XkyU/ZQGIL1bnPiBc2B5IPKjDvqXD8E9sZc4IH7RwUBeYinjWT4UY/zSK620TbF tHUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BLeyhDyZ; 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 e9-v6si30209674pln.72.2018.05.28.05.46.02; Mon, 28 May 2018 05:46:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=BLeyhDyZ; 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 S937849AbeE1K5e (ORCPT + 99 others); Mon, 28 May 2018 06:57:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:45364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937743AbeE1K5I (ORCPT ); Mon, 28 May 2018 06:57:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B3E120899; Mon, 28 May 2018 10:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505028; bh=K+B8Izp6r0J+50CFwVMwnPLJSYBxvZHp3SOZaRMA/as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BLeyhDyZUs1EE7S4wuF1ABCA17PDRlY3FBF4b0nUcFUZ8Lpl0AlBOuEMn0t7A11Py TNSHIPGGEFYyzX6ShSNO17m7eTMNbd0WhsCcfFOVwPwhUEVoMRqvxZURjKYkFqe07k e9ZiQpN/Q928tvPBTuPuNeDJkQl2M6uoIqomcnYM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jean Delvare , Mika Westerberg , Sasha Levin Subject: [PATCH 4.14 318/496] firmware: dmi_scan: Fix UUID length safety check Date: Mon, 28 May 2018 12:01:43 +0200 Message-Id: <20180528100333.244595825@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jean Delvare [ Upstream commit 90fe6f8ff00a07641ca893d64f75ca22ce77cca2 ] The test which ensures that the DMI type 1 structure is long enough to hold the UUID is off by one. It would fail if the structure is exactly 24 bytes long, while that's sufficient to hold the UUID. I don't expect this bug to cause problem in practice because all implementations I have seen had length 8, 25 or 27 bytes, in line with the SMBIOS specifications. But let's fix it still. Signed-off-by: Jean Delvare Fixes: a814c3597a6b ("firmware: dmi_scan: Check DMI structure length") Reviewed-by: Mika Westerberg Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/firmware/dmi_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -191,7 +191,7 @@ static void __init dmi_save_uuid(const s char *s; int is_ff = 1, is_00 = 1, i; - if (dmi_ident[slot] || dm->length <= index + 16) + if (dmi_ident[slot] || dm->length < index + 16) return; d = (u8 *) dm + index;