Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp871891pxu; Thu, 3 Dec 2020 15:03:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzc0fWxie8X43weFvkNlszRrOZ4z7uxqOhuA19+suGNX86oWvp1HN3UJDSue1dRpVfDUKrx X-Received: by 2002:aa7:cd84:: with SMTP id x4mr4834343edv.192.1607036622562; Thu, 03 Dec 2020 15:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607036622; cv=none; d=google.com; s=arc-20160816; b=b/HvlZ3Ek94AA0fZAgJ66FewyuOZIdn1k7FJ3jxweFAzk1dhU+/pBCRSnK1l22xym8 3NFD6ZcmHYfx2Bd9otiSGDhpsokc53Fp7ByjTOS5EWqfqBFOyX2c3byYKtGCHYPbYFZn ScqD/jxvsxuYjhH4duBI+irRYb38OL4+nFDvOlnWVLdxze89pvn13SRSMRBgw/P8H5Gi runQRgnL5zjZO9jnIaM18a7Tch7cG7WRDf6fbuVCFrtHxoPa3yzOwPtLIRitxxW8oeZl yaTBz3kEjVg6WqTsCca4JzqvKVYtwN0q/QuquucGKCnOtGQMqX98luojdT8n6ERcKEnM cO5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3c+0u2xiE9vV/8OBVB3MNID0owbw/IseZO13Ua1k4bY=; b=Uc3j4QWTI3IfOoC6EYuiqPu+HJaRrTwfumJRyDw1NncFDCsBryVHdj64gucEJDkn0h ktM3Cu1gw0Mo1PQ+TUg1O3enaVsdv0oS2FtzU9+9R63TTisWKq+sDemFNdhCFjy2U60L 1t1FrPpLX/sDf89mMG8WrpePKTGCSo3txRSNrwm/L7z02gapWy+sX4cO/Kngk5JEBafa nQQ2vYxjbRabaY6qrXWsbRj5Bti+F9gomLtW+4x492CFMElMA/vnacNVfzVZvV23KUlr K6bAJS9dSjRYyVFe7kwtY7ZbqPOILWVe1pHF51S+4wzaF96dB1q4V93GBrrdIJolfVVa plVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="JZ0/0jd8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si266897ejc.256.2020.12.03.15.03.18; Thu, 03 Dec 2020 15:03:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="JZ0/0jd8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727293AbgLCRCX (ORCPT + 99 others); Thu, 3 Dec 2020 12:02:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725918AbgLCRCW (ORCPT ); Thu, 3 Dec 2020 12:02:22 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07028C061A4E for ; Thu, 3 Dec 2020 09:01:42 -0800 (PST) Received: from zn.tnic (p200300ec2f0dc5004496c992b512bfd2.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:c500:4496:c992:b512:bfd2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 3091B1EC01A2; Thu, 3 Dec 2020 18:01:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1607014899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=3c+0u2xiE9vV/8OBVB3MNID0owbw/IseZO13Ua1k4bY=; b=JZ0/0jd8mbL3Vjue6Ea6Q+mgWKJXg0zeL+KQdYAjd1Sl9k5XaiI9NmeNzsB5xdZ216PZtG /A9XuYFwMyf03PRtjLbtojWWR/8DaYb0ZlT6t2LK3XkmreQ9yqKUKYvcQRYARj4n9NiEBW +teZQUPPL6GzaGP3B4OVB91VOU59KbE= Date: Thu, 3 Dec 2020 18:01:40 +0100 From: Borislav Petkov To: Tom Lendacky Cc: Masami Hiramatsu , x86@kernel.org, Thomas Gleixner , Ingo Molnar , Kees Cook , "H . Peter Anvin" , Joerg Roedel , "Gustavo A . R . Silva" , Jann Horn , Srikar Dronamraju , Ricardo Neri , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] x86/uprobes: Fix not using prefixes.nbytes for loop over prefixes.bytes Message-ID: <20201203170140.GM3059@zn.tnic> References: <160697102582.3146288.10127018634865687932.stgit@devnote2> <160697103739.3146288.7437620795200799020.stgit@devnote2> <20201203123757.GH3059@zn.tnic> <20201203124121.GI3059@zn.tnic> <20201203124820.GJ3059@zn.tnic> <1c1b265f-34e3-f5cc-0e7b-186dc26c94b7@amd.com> <20201203165420.GL3059@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201203165420.GL3059@zn.tnic> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 03, 2020 at 05:54:20PM +0100, Borislav Petkov wrote: > On Thu, Dec 03, 2020 at 10:45:48AM -0600, Tom Lendacky wrote: > > Since this is based on the array size, can > > > > idx < NUM_LEGACY_PREFIXES > > > > be replaced with: > > > > idx < ARRAY_SIZE(insn->prefixes.bytes) > > Actually, this needs another change: > > struct insn_field { > union { > insn_value_t value; > insn_byte_t bytes[NUM_LEGACY_PREFIXES]; Blergh, spoke too soon. All those struct insn members are struct insn_field. insn.prefixes should probably be a separate array of explicit size NUM_LEGACY_PREFIXES, not that insn_byte_t bytes[] gets enlarged in the future for whatever reason, while the max legacy prefixes count will remain 4. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette