From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 067091E515 for ; Fri, 12 Jun 2026 21:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781301017; cv=none; b=ktOQHDyF3C9unYbSU+ujrvPi9VTNwLe2tnRnX7QQyocXfkWUj3C5010M1w0Pn7ktpmsgYvLNeh3PkzmlhQyULgjwLXdtRpzVo6UhjGRMW5BY6I9ybtfYZvEO5P1MZGtF73JZYt8kfIHH/JvDshb/xWfB9cUsVw26g98KeIuW5Ow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781301017; c=relaxed/simple; bh=FfLl9yxcrPlHU/sTQYOvoRJ3dCJcgs3UPDwxtJjHEmk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=MInwRnU6Q2tcLgFMoa11zQx4bc20EyyfwX2qUwGyOcquz2PdLMa+uzqZ9Czl96c51TbzT8v/Cn3X6GV8YaqU0R4CRzRUGSYnLWTS6Y/dOYgmCzZYN+VGuicXBu+uzpXav+tF4qPGOBUhYB7ZMeJEAv9m7A7KVjxKeLf2cHrYxR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=jT2HqeJv; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HdDhQKJo; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jT2HqeJv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HdDhQKJo" From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1781301014; 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: in-reply-to:in-reply-to:references:references; bh=wv0xct+57Ue2a/VO8M2fraJlUjgNe/Mx/nXgrjheBmQ=; b=jT2HqeJvTAChpz/vTwwMDaAb+ggh7oYZ5EKhVpho/5fy0mBzjS8Rkkn7jPjGvx/tlpQg0i YcbEDp0w/7v9eq7j2lUAWNTxoDzQraD2eQg5/UKP3f0nt1iMUY3mlOUNtiA6Tcu1l3Ds5F 7xmfd6j2ltMW9+y52fCwPXDYY53CJaZHELQTTR7nNolIqIhfllwNI0G5GKckh03Ozwj5Mh 0FXuVk0X0ym7diaGGUjFgaocYGko8x//F2R/p9lQp9sjiKdbCiMwNgAtN4jAtz9TiGWEFc 3kj4aEJOGA1thtuJVJLjYMxU1CINgHAfzxTF3DCiQBGjwQgqvU2L/T//e8bi/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1781301014; 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: in-reply-to:in-reply-to:references:references; bh=wv0xct+57Ue2a/VO8M2fraJlUjgNe/Mx/nXgrjheBmQ=; b=HdDhQKJoAnlmcqzFVDk+q+0QyNtSfNC8RKbcoizrfrpFTdlUjPFGIlhCVUDVzR3Fp5eNp8 lqTP55cnl3R3/0BQ== To: Mark Harris , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Alexandre Ghiti , Mark Harris , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: hwprobe: Avoid uninitialized read in hwprobe_get_cpus() In-Reply-To: <20260612045502.70850-1-mark.hsj@gmail.com> References: <20260612045502.70850-1-mark.hsj@gmail.com> Date: Fri, 12 Jun 2026 23:50:13 +0200 Message-ID: <87qzmbe8dm.fsf@yellow.woof> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Mark Harris writes: > 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. > > Signed-off-by: Mark Harris Reviewed-by: Nam Cao