From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82FC2C38145 for ; Wed, 7 Sep 2022 16:09:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230087AbiIGQJQ (ORCPT ); Wed, 7 Sep 2022 12:09:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbiIGQJM (ORCPT ); Wed, 7 Sep 2022 12:09:12 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21BAFD0B for ; Wed, 7 Sep 2022 09:09:06 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8C20320585; Wed, 7 Sep 2022 16:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662566944; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vrsXd+bIvOt3zs7xld8Fn4DZIx7cnr+PjAHywJzUMzo=; b=wN6WLAEJiWw+RJdC6PceDP7mhQbvHHUMCQ/rNYisyZ9oyjsJCEdAq6tWgiqNvBt8MHiJwa I18skYmmRVbWdv+GgrpRovBEDbz4f0Jga0bjAbaEHQD2DF2qfQKSrSX1TNsmQgDMO4B/WQ vMpDp3UFT7Y1ojPl3qZ0PswP3KtwDdg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662566944; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vrsXd+bIvOt3zs7xld8Fn4DZIx7cnr+PjAHywJzUMzo=; b=QIU7xYDNrn2poUZutLzb1YhkmZZ4nFpwBDW+wukE76KZDWunx7eLSCe8cPuqSEdHoJ2LHb xNwL+GthjA96ogBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6856013486; Wed, 7 Sep 2022 16:09:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eUDoFyDCGGODawAAMHmgww (envelope-from ); Wed, 07 Sep 2022 16:09:04 +0000 Date: Wed, 7 Sep 2022 18:09:03 +0200 From: Jean Delvare To: Andy Shevchenko Cc: LKML , Linus Torvalds Subject: Re: [PATCH] firmware: dmi: Fortify entry point length checks Message-ID: <20220907180903.5a14d3c4@endymion.delvare> In-Reply-To: References: <20220907103041.0a88d5c4@endymion.delvare> <20220907172146.72460eda@endymion.delvare> Organization: SUSE Linux X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Sep 2022 18:48:03 +0300, Andy Shevchenko wrote: > On Wed, Sep 7, 2022 at 6:21 PM Jean Delvare wrote: > > On Wed, 7 Sep 2022 17:52:10 +0300, Andy Shevchenko wrote: > > > "NOTE: This value was incorrectly stated in version 2.1 of this specification as > > > 1Eh. Because of this, there might be version 2.1 implementations that > > > use either the 1Eh or the 1Fh value, but version 2.2 or later > > > implementations must use the 1Fh value." > > > > Good point, so maybe we should accept 0x1E and treat is silently as > > 0x1F (which is what we have been doing implicitly so far) for maximum > > compatibility? > > At least the previous comparison covers this case, if I'm not mistaken. Before my proposed change, yes. After my proposed change, no longer. Let's not risk a regression, I'll change the check to: if (memcmp(buf, "_SM_", 4) == 0 && buf[5] >= 30 && buf[5] <= 32 && dmi_checksum(buf, buf[5])) { I'll also add a comment stating why we are allowing length 30. Thanks for the valuable feedback, -- Jean Delvare SUSE L3 Support