From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 01A7E28489B for ; Sun, 7 Dec 2025 17:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765127614; cv=none; b=qbAgjZdezFTc34dPTGNwNJ8XZYasXWYIB0hlNUt2lt0jEhrW2O/LF97RQmiujR8isEe/TyrOmK9w2zpbjEmk1x/D5DeMiQ0nM7O4lp+oRlXL8igbmPM6UuddtaTj22pshhswbrciFhefGxHnWMpjGZdrKM9pt6mLNWkcz6fRsZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765127614; c=relaxed/simple; bh=XlYcEZLTwF9rO0t4x2rwqNy4pkenX8A8y5WAXuD6TsE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RWAJ3cXvGe1yvyH0eOgJkO4/YTdWAf5FuPdBgT4I7VD7VPgZMFp0WKveNqCqblZ/b+uTjvbNALnyX+Q+TI+6S2pKCMcCKoMn71A2QJzfN3T2LTYRFBT+sR3j9Gevrq0yMfT0MRAaLLACNgFI031AorLxw8rdr8TSO9Q3vVbm8TE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZswcW/nf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZswcW/nf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA28EC4CEFB; Sun, 7 Dec 2025 17:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765127613; bh=XlYcEZLTwF9rO0t4x2rwqNy4pkenX8A8y5WAXuD6TsE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZswcW/nfP8J4MySolvG3SALMrxEbBeunX8W0y2xFUN4EtzAF33T58SkYruwSHNBt0 UmXcE1BTFRqh+6hy8P+r2r3/1A1DvFiOfKPshJzyrZ8VCxAZB/c1EefcOjiRKe7SxP Rrer7Bp1Fqv8zP3GIzBSbRf/7PHpOy+5Z7BOFNTozRTz2ZpVRI+04qYSur7AGkp+Vq HbUz/ZO9PNEFCnF+ISE32wqssmIS0w/lY5Jx5eR04OMREeDU+ZwuPuNeWveIIyoctd fBLbIa8ymVQcP4m+J3a3SfLuHn5YL4P8mcCyHAeYEW5xkGMVkHU9NPhjVIPGP4W00I irs9Nm1IU5H8A== Date: Sun, 7 Dec 2025 18:13:29 +0100 From: Alexey Gladkov To: Yutao Zhang Cc: kbd@lists.linux.dev Subject: Re: [PATCH] setfont: Initialize data pointer when resetting font Message-ID: References: Precedence: bulk X-Mailing-List: kbd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Dec 06, 2025 at 05:18:43AM +1100, Yutao Zhang wrote: > From: Tommy-Zhang3759 > > When resetting the font to default, the `data` field in the > `console_font_op` structure must be explicitly set to NULL. > > Previously, this field was left uninitialized. The kernel treats a > non-NULL `data` pointer as a pointer to a font name string. This caused > the ioctl to fail with -EFAULT (Bad address) because it attempted to > read from a garbage address. > > Signed-off-by: Yutao Zhang Applied. Thanks! > --- > src/libkfont/kdfontop.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/libkfont/kdfontop.c b/src/libkfont/kdfontop.c > index 8f132ff..4f1f0d2 100644 > --- a/src/libkfont/kdfontop.c > +++ b/src/libkfont/kdfontop.c > @@ -46,6 +46,7 @@ kfont_restore_font(struct kfont_context *ctx, int fd) > return -1; > > cfo.op = KD_FONT_OP_SET_DEFAULT; > + cfo.data = NULL; > > if (ioctl(fd, KDFONTOP, &cfo)) { > KFONT_ERR(ctx, "ioctl(KD_FONT_OP_SET_DEFAULT): %m"); > -- > 2.52.0 > > -- Rgrds, legion