From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (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 4F08533291F for ; Sun, 1 Mar 2026 16:41:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772383274; cv=none; b=rwcXfRuSu89ZVe87lKXVGmFZ5uoBx6yxfwFLezCWOhvT/CajyHoQkO03hhxtUb54aqvFd7EYGIIfp8InHZt9QeRhvXCY7UKajJj1vD+/qEVkWju/VRBBROPcALZ4WsNpzi5WiQ0sLhydZ9p6hSFX8kUMhwFszfvTthOdUAU4kDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772383274; c=relaxed/simple; bh=tPVwdBJ+9r9+O/klHKX+FPyiZaLdDA+YcAqEQQzonK0=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=PkGQWIAIpQYlhS8lOv5jssmYOEyTvQnMCLGpB5MJwb8MP5DY2rp/tCAOsoOGv4PNh+8DYryhGznCqy39+5f8lSiZHvYhQEdoJ6R30oi1CU2lcLs9r6AAWzxGzZnrtKhOSp3UsxH2UE/dYOzYGlgL8qXkMRsHUoAtT2FNXJh9nKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=o4zS4u1S; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="o4zS4u1S" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772383270; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WJZ4oFYbAkOje6I3E5iIx1h5i2IFvXeeSYZEMbkPPLU=; b=o4zS4u1So5NhoTiMMOubUUuvKKc/xzXOG0/GhjtENUHc9TaufY5T/XFkwhoGHAZCjYOjeS a6cebpTh8x46zJrA4WeSFBAJQEz/atSz0Hu+yWATp0I6D6kO8g8oQNK+09tbYXCiXm9nqX n6UBZOFvpQP14sK5rEdmlV/fyHJ5jgg= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81.1.4\)) Subject: Re: [PATCH RESEND] x86/mtrr: Replace simple_strtoul with kstrtoul in parse_mtrr_spare_reg X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum In-Reply-To: <20260228145818.GBaaMCighSpuxSUDPO@fat_crate.local> Date: Sun, 1 Mar 2026 17:23:00 +0100 Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Thomas Huth , linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <70047072-6F3E-44D0-BF73-CAFC7C1AF9A5@linux.dev> References: <20260127215824.440005-2-thorsten.blum@linux.dev> <20260228145818.GBaaMCighSpuxSUDPO@fat_crate.local> To: Borislav Petkov X-Migadu-Flow: FLOW_OUT On 28. Feb 2026, at 15:58, Borislav Petkov wrote: > On Tue, Jan 27, 2026 at 10:58:23PM +0100, Thorsten Blum wrote: >> Replace simple_strtoul() with the recommended kstrtoul() for parsing the >> 'mtrr_spare_reg_nr' boot parameter. >> >> Check the return value of kstrtoul() and reject invalid values. > > Where? The check is implicit in the return statement. Previously, parse_mtrr_spare_reg() always returned 0 (success). Returning kstrtoul() directly propagates 0 on success and -errno on failure, which adds proper error handling. However, I realized that 'arg' can be NULL here, so the NULL check cannot be removed. I'll send a v2. Thanks, Thorsten