From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (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 F3034260580 for ; Tue, 17 Feb 2026 23:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771370862; cv=none; b=AYXt4HY1VyrzHy9NNhKeeaOJR0kF/Fmk5mVowkX3qMpAFDzov/UpsdUYyAVtOw0lWVSbRRUpOwW+Qm2VMC9y9CbNQMahekQ58KEsjO5INihfuEIS3L9q0ozqqbNs4iJefABOJqktpnmCUYgAVccYtYNKX2c+QE4E5gBTtLzLAT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771370862; c=relaxed/simple; bh=fZp2PFJJAnBaNXnIodTPiCY3HfzveyNPIaZmF0/pRto=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dKsVmPSIr6OsnomNYpecOYt8eK7LfI63UIQd+ncG7OFhsymVXhor/MphAnGa06+PsCci+ZoPesh2l+ETGm35WmQt3Y82rwjwjdy/96hi1GPqgcmzwazwHIi67YpbJV6deIzJGDdMbfl5QSRLULukSn7o4vDTovBxFZ8E0cyWUaw= 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=qjLfFglR; arc=none smtp.client-ip=91.218.175.177 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="qjLfFglR" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1771370848; 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=p3PL4+vuvrWhTslRypNTa3ipy/HPHV3MfgKQlMWnh7M=; b=qjLfFglRSuJJiXeW4/f92y7jqLtLqtETo8rTwZqZ6Ue19DRHeP4uDVXDMl/D+MDfpYzjks A3k2rrTns8KSs2P8Dzgb21rIcpsZmpT+LMyjVNVcUvGUqM27csIi9Ri2MOfiThccD8kmv1 jOYk52PhyFROb28lXmqjdfEqaQmz1yI= Date: Tue, 17 Feb 2026 15:27:23 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v1 13/14] selftests/bpf: Fix out-of-bounds array access bugs reported by ASAN To: Eduard Zingerman , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann Cc: Amery Hung , Mykyta Yatsenko , =?UTF-8?Q?Alexis_Lothor=C3=A9?= , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20260212011356.3266753-1-ihor.solodrai@linux.dev> <20260212011356.3266753-14-ihor.solodrai@linux.dev> <59f6faf52bd77c01a96f495eea3c7389c3455b50.camel@gmail.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Ihor Solodrai In-Reply-To: <59f6faf52bd77c01a96f495eea3c7389c3455b50.camel@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 2/12/26 5:11 PM, Eduard Zingerman wrote: > On Wed, 2026-02-11 at 17:13 -0800, Ihor Solodrai wrote: >> - kmem_cache_iter: remove unnecessary debug output >> - lwt_seg6local: change the type of foobar to char[] >>   - the sizeof(foobar) returned the pointer size and not a string >>     length as intended >> - verifier_log: increase prog_name buffer size in verif_log_subtest() >>   - compiler has a conservative estimate of fixed_log_sz value, making >>     ASAN complain on snprint() call >> >> Signed-off-by: Ihor Solodrai >> --- > > Acked-by: Eduard Zingerman > > [...] > >> diff --git a/tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c >> b/tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c >> index 6e35e13c2022..399fe9103f83 100644 >> --- a/tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c >> +++ b/tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c >> @@ -104,11 +104,8 @@ void test_kmem_cache_iter(void) >>   if (!ASSERT_GE(iter_fd, 0, "iter_create")) >>   goto destroy; >>   >> - memset(buf, 0, sizeof(buf)); >> - while (read(iter_fd, buf, sizeof(buf)) > 0) { >> - /* Read out all contents */ >> - printf("%s", buf); >> - } >> + while (read(iter_fd, buf, sizeof(buf)) > 0) >> + ; /* Read out all contents */ > > Nit: > - while (read(iter_fd, buf, sizeof(buf)) > 0) { > + while (read(iter_fd, buf, sizeof(buf) - 1) > 0) { > > And keep the log? AFAIU it's not necessary for the test, it seems to be a debug print. There is an exact copy of this loop without printf in dmabuf_iter.c. > > [...]