From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C52748B365 for ; Wed, 15 Jul 2026 17:14:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784135662; cv=none; b=pI690usf9udcZL9bzpw4jTVe+Vv62Rrj3dsnFPwoI1gxRgielfE/uphwom4SbDsUzSBMqZcw2rttZb5xugg91TAv7xqfsIwWnAcxK7Znv9RHv7mhYOc/fiYJ5WPPnPOLOj7MKglojn+sNM9Ti36i10wMAJsa/VfEZ+dETHbxXK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784135662; c=relaxed/simple; bh=SypJKx6muRMrwtgu6NuRNt2gqpmY/HxyOcC3ZI/Up20=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=V5XSYXeb2ou2pGVSPQ2za8HQO5pg2ELuL8rhv2PWH6nRXnSWVpV1aQWbye1rkZ0h25NlZbDXyAqfOBYUh4gBfgTtrQOaEtVuREQzgxyF/34zCcin0b8TisvMb4uAeFQjzbCqA9q161CCaIjnVeJ/devgec6uqP5e2T6ViyQSIk4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KroKzY6V; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KroKzY6V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 893651F000E9; Wed, 15 Jul 2026 17:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784135656; bh=LjIDABZ6RiKEOS2gR8+fPbzT/X3YyGFaiYkNIhS7z08=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=KroKzY6VqTaMhVGLj2QsmUUKpuLKdIgREmw0xhKvmXlQwUIUHA10BWYoHVnzE9AgW FKUaRZ/LdV0o0XUBR8pnjuF1eZPwUDBken+o1d5hE9YGnDOq8Z5ksOgjrUV69u0PVr Wm/NB//EwYd7TrErlzVA/xw2z+GB6prxcRo3xLHSD2FTVXeQ4zb8UUqCniv3t1trvF Af9m9LeJ27C3Ib/VpBYIoHyYUZqby5GzdxRYOee3m2Kmpj1oxFTZZCCtF5DVsuKlTc ewku6n94AHnkKrIEmW3nrnOWSfAqz2YhB8Jvb6qNUfBybWVOJfH32rlBZRv4yYcwzG W06ZKXGw5zakg== Date: Wed, 15 Jul 2026 11:14:14 -0600 (MDT) From: Paul Walmsley To: Mark Harris cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nam Cao , Michael Ellerman , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] riscv: hwprobe: Avoid uninitialized read in hwprobe_get_cpus() In-Reply-To: <20260714003056.73707-1-mark.hsj@gmail.com> Message-ID: <35b94b17-2a2f-ae20-1156-e06c8de297cc@kernel.org> References: <20260714003056.73707-1-mark.hsj@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Mon, 13 Jul 2026, Mark Harris wrote: > When cpusetsize < cpumask_size(), hwprobe_get_cpus() did not fully > initialize its copy of the cpu mask, which could cause non-deterministic > results from the riscv_hwprobe syscall on a system with more than 8 CPUs > when the supplied cpu mask is empty. Address this by fully initializing > the cpu mask. > > Fixes: e178bf146e4b ("RISC-V: hwprobe: Introduce which-cpus flag") > Signed-off-by: Mark Harris > Reviewed-by: Nam Cao > Reviewed-by: Michael Ellerman Thanks, queued for v7.2-rc. - Paul