Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8832252rwp; Wed, 19 Jul 2023 16:28:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlEJpVvwk8M0fdQhD+N8CD2wbpfFKOM476lH28ftPcjVLb26W5i4PxVlx9jm3PWJcWcm7h3+ X-Received: by 2002:aa7:d792:0:b0:51d:ece5:afd9 with SMTP id s18-20020aa7d792000000b0051dece5afd9mr3552000edq.21.1689809326065; Wed, 19 Jul 2023 16:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689809326; cv=none; d=google.com; s=arc-20160816; b=SfFsWKmLQpGm84ST9smUnrRCbDoZYSMIAF2Fg/+pIqwZJ7s7nkYBs9COMotatDpY1A OMD4NGjogwphk72nfN0n2Dic6rHnfA/Rq779mwMg2tQUCQbOlPjI/1/ND3X5pwgOLpPu 5becyu/PxV7pnyDFbaGXbzkLE/8TboVVb+pQpQ6WKANu4AT6zYMX2FAHzLxuSbcgT6e1 gnbVcg5QjBvJFAkY9l9zstMGtn1HTFg/RKSByDSok8BwTUhttP10brJwetIQtiuJbeTc PMzN1ca0t7SFrUf3yjm5XPWmEHPIvLNWcBXHytrQmjB2jGF25IzqDhRFeYCSSNQWBKPE XCRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=5x+K2CxoaU/raVxOmJZtUWUdJyWEsLarNkmOHl5Fz5E=; fh=VvyM/JM9fvcPCCO2P2JXjMPyJfofoGnXf0mlHt6Q/zI=; b=N7nqum8fMtf4QIjBqpNU820/wJIX7XxM/aw6kLjCYxnpNbaapvZqntkN2rgZ6IB7sf QC3K73xz6TX0ClgWzcuNfsYnYcJj4UaYEC4FbljsrM/tfA6SVOUHpjofpfitBTqea89v oEzkCvIsA+hplF8/CRLcJfVAGn0sEcR9Tguw1gO/SVnXvmluJoTBrYao42mdlvUQYhIr ePt6YeDX2Fbx+MMn33MfM1tc0tiHfqSg8eB8eIbUfe6tuKWAvD9FyMB0S8zNIhYnhDZf 8Aa81HapWblM8zeojeixQm8vuzmferZbHruif30ecBDcyyE2YPYcX6PfyrUBPMMHa4dt k3oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JpRakYUu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020a056402111300b0051da389c522si3709297edv.610.2023.07.19.16.28.20; Wed, 19 Jul 2023 16:28:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JpRakYUu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230281AbjGSWoz (ORCPT + 99 others); Wed, 19 Jul 2023 18:44:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbjGSWox (ORCPT ); Wed, 19 Jul 2023 18:44:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10CEC1FE6; Wed, 19 Jul 2023 15:44:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 999BF61840; Wed, 19 Jul 2023 22:44:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E474FC433CA; Wed, 19 Jul 2023 22:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689806692; bh=KpGFKEUuiIitS8UfirDt+cuq2SuWxsDx+OdYFcxFU7M=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=JpRakYUuJVAkIJR5HXblpzkI9PdUqU4i6XmbSMiTmtzfemV4WD1akHLy5SRrSFQpN un+aQppiWBaKop97bHOHt21+1n5Lni5eMuEOpIRbNOIQw+sidPK0D5Pg+bixMmM/iT 5x+yJ277k0CF6zsE7cPVFO/voXF/CTgmkLAMhiOiddjfli33xDNSUhJZVyNPVcWVMe /N7mjpOjsORLyfseS1M97Cx+eWLMUz5gcr35FhKsYEKzfkvyhrCKdrQjUpIFLkHSCx rHSKNa1leBY7DM/IVkwNmgKkCvpnnBeCpNNjaU+nXSyos4fD53d+gJSxubvCXqzjo2 SL/39Pi2aAirg== Date: Wed, 19 Jul 2023 15:37:02 -0700 From: Kees Cook To: Larry Finger , Kees Cook CC: Hans de Goede , Azeem Shaikh , LKML , linux-hardening@vger.kernel.org, "Gustavo A. R. Silva" Subject: Re: Crash in VirtualBox virtual machines running kernel 6.5 User-Agent: K-9 Mail for Android In-Reply-To: References: <202307190823.086EFD42D9@keescook> <202307190835.752D710D@keescook> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On July 19, 2023 2:24:52 PM PDT, Larry Finger wrote: >On 7/19/23 10:36, Kees Cook wrote: >> Okay, please try: >>=20 >> diff --git a/fs/vboxsf/shfl_hostintf=2Eh b/fs/vboxsf/shfl_hostintf=2Eh >> index aca829062c12=2E=2E902fe3224453 100644 >> --- a/fs/vboxsf/shfl_hostintf=2Eh >> +++ b/fs/vboxsf/shfl_hostintf=2Eh >> @@ -68,12 +68,11 @@ struct shfl_string { >> /** UTF-8 or UTF-16 string=2E Nul terminated=2E */ >> union { >> - u8 utf8[2]; >> - u16 utf16[1]; >> - u16 ucs2[1]; /* misnomer, use utf16=2E */ >> + DECLARE_FLEX_ARRAY(u8, utf8); >> + DECLARE_FLEX_ARRAY(u16, utf16); >> } string; >> }; >> -VMMDEV_ASSERT_SIZE(shfl_string, 6); >> +VMMDEV_ASSERT_SIZE(shfl_string, 4); >> /* The size of shfl_string w/o the string part=2E */ >> #define SHFLSTRING_HEADER_SIZE 4 >>=20 >>=20 >> The size assert doesn't seem to be used anywhere else, but I can do a >> more careful binary analysis later today=2E=2E=2E'' > >Kees, > >The testing was harder than I expected=2E My standard kernel would not lo= ad the system disk on the VM, thus I had to build one using my distros conf= iguration=2E It is really painful to wait for all those drivers to build, b= ut I figured that might be faster than trying to find the incorrect paramet= er=2E > >I can finally report that vboxsf no longer generated a BUG=2E It is getti= ng farther, but I am not done yet=2E It now generates a line that says "Unk= nown parameter tag" and then hangs=2E I have not tracked that down yet=2E > >I was not aware of the DECLARE_FLEX_ARRAY() macro=2E I had considered rem= oving the union and creating a simple string[] declaration, but I do not me= ss with file systems, and decided to let the experts handle it=2E > >I will let you know what I find about that unknown parameter=2E It probab= ly is coming from VirtualBox=2E It's possible the size really needs to stay 6 bytes=2E In that case, try a= dding a "u8 legacy_padding[2]" to the union and restore the VMMDEV_ASSERT_S= IZE? --=20 Kees Cook