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 F142440F74F for ; Wed, 22 Jul 2026 23:01:37 +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=1784761299; cv=none; b=OPXJohnCMJKT046bHdX4bPRP9xnaXtBFG1zjodu+nU8Z2YXsTtfvSr7ha9zz1F0kKnMQG8sP2X0dlfJBpFj9xSBjh8ZGFRFjAOxNdZ7aGEZkzx/eVv7dJqQy+42mi2t83qhwKELQE2EA64Zs+EKGQlnJtz3bv+DLjq/Lj8Bky7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784761299; c=relaxed/simple; bh=27q28dvSyV52a658M6MUfP90gR0sOH+reYDV3I3YzIg=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=RCOqeeT3ExTEg2haZ4kRGrEHHtN/NMiOrAERuJhhYlkGVcWuudF4sX+Fcy2ipq8+0NecFpnIjZTve2l4qBwshD/QoGRlKEZwfTmMgWkM7rpkpz28A0Osj5jvTv6+bfZPocItpps+rG5bO95+ks3lGAnB+sqlDejPuCxeOeOhzmU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=wliPwyRa; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="wliPwyRa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0BBC1F00A3A; Wed, 22 Jul 2026 23:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1784761297; bh=tRl7eZYADZQqQNrGtSUMjyl9MslJlol0TPR9qw4bG7M=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=wliPwyRad5znjVO8s8VIPrnBk+ZV8gKPKhc6weDXnLVrFSw6BEZW8eEK+mYunG04p ov4FeIzKP0G2V6WckLW1kAdzIh1fQCtH8Jrf2YFLITWUo+o4RwIb0wjuH6B/E6pEgA QitYOVOpGU419y9pxoQ+Yo7Vuknv2/+YQReQVs1Y= Date: Wed, 22 Jul 2026 16:01:37 -0700 From: Andrew Morton To: Vincent Mailhol Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] lib/ucs2_string.c: fix out-of-bounds read in ucs2_strnlen() Message-Id: <20260722160137.51230dfcf70fd246cf7208ab@linux-foundation.org> In-Reply-To: <20260722-fix-ucs2_strnlen-v1-2-ba5bade2b026@kernel.org> References: <20260722-fix-ucs2_strnlen-v1-0-ba5bade2b026@kernel.org> <20260722-fix-ucs2_strnlen-v1-2-ba5bade2b026@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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 Content-Transfer-Encoding: 7bit On Wed, 22 Jul 2026 23:04:53 +0200 Vincent Mailhol wrote: > ucs2_strnlen() checks the current character before checking whether the > caller-provided maximum length has been reached. If the input is not > NUL-terminated within that bound, the loop can read one ucs2_char_t past > the limit. Is there a known way of hitting this from userspace? If so, and if the effect is at all serious then we should prepare a backportable fix against current mainline - that whitespace tweaking patch can come later. Also, AI review points at a few possible pre-existing problems in there which might interest you: https://sashiko.dev/#/patchset/20260722-fix-ucs2_strnlen-v1-0-ba5bade2b026@kernel.org Thanks.