From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 688A37082D for ; Sun, 12 Apr 2026 23:05:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776035104; cv=none; b=cWBIU5GyXZPOihdNX+sy/3n/fSJ/+x/vROodUpNIyG0lQO8xF6/i0oEFUtqAU9JfsjiIRoStH4xWk4iTm59nuPESR9ZMqL09AmSeKsCACC/77M+hQxXfHWsnXt0ObfpHuTX6qtGRqiMGK+YU8KHd6CqEot8zM661QV/v3C81vCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776035104; c=relaxed/simple; bh=/wRYjeZfRPEsY+7mjJ80Nf4ra6EO4rRCZFOFM6L+hM0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L/4nsOM5oVHMc02Rmre2dnAJitAnSm84s2hIiHcP/wPTUMvzdWhu4MDdxXCo2ykqTmdBvr+jvrmpz8Y5HnAIggcgwCPBlfnYXX4yHkYu98DKsg9esTBKLlCElIqNGOvduSRtstStkmoVbdbz5W2zS6REUy93sPJMyKINskN6Hj0= 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=Su+whJvc; arc=none smtp.client-ip=91.218.175.183 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="Su+whJvc" Date: Mon, 13 Apr 2026 01:04:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1776035099; 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=RMZXVhxArrX2MIw67lXbdoUVcMjR3WhMg1BwJqh+Ul4=; b=Su+whJvcuoBO4DRTsIgcZVrxGj3/j6gLr4HqyRltFJkymmu1LHrwiVdJULuco3b9eXP7IP vfDSRyneo/nCdZtId8DpNLcNVR3w3+Rye+hS5OwQGaI196NCxilqehsTFXzr8yu+Ar5W5A CprRjXpVoleWFlC2GC6hgvSkGWsYETM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum To: Jakub Kicinski Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Tim Bird , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 1/2] keys, dns: drop unused upayload->data NUL terminator Message-ID: References: <20260409225703.158552-4-thorsten.blum@linux.dev> <20260412141004.22c6686c@kernel.org> 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-Disposition: inline In-Reply-To: <20260412141004.22c6686c@kernel.org> X-Migadu-Flow: FLOW_OUT On Sun, Apr 12, 2026 at 02:10:04PM -0700, Jakub Kicinski wrote: > On Fri, 10 Apr 2026 00:57:02 +0200 Thorsten Blum wrote: > > In dns_resolver_preparse(), do not NUL-terminate ->data and allocate one > > byte less. The NUL terminator is never used and only ->datalen bytes are > > accessed. > > I can't see where this is used at all. > Please write better commit messages, there's no way this 1 byte > is worth the amount of time I wasted trying to review this :/ The point of patch 1/2 is not the removed NUL terminator itself, but to prepare for patch 2/2, which adds __counted_by() and requires ->datalen to match the number of elements in ->data. Currently, that is not the case because ->data includes an extra NUL despite never being used as a C string. Removing the unused terminator makes the length match the allocation size and allows adding the __counted_by() annotation. I can fold this into the __counted_by() patch if you prefer.