From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CC3BC2FF for ; Mon, 6 Apr 2026 04:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775448852; cv=none; b=SHeEanbWjaTjwRkpMzrouWRCcPfQ88NPdEcFGoJMzVN4Va9F3KxuDwhXr+s/UqmLX6YVbizIXRQMaZFpUbQF/OPsxNUH2qDlSdI/79PcudrfkVR14Jh3HnQaGZchxGYUkQTrG04piB3lJF+CMuuWqho5B9mn1vwqHLxI3aQjgVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775448852; c=relaxed/simple; bh=UWukafqK49bkulS5Sg+KJO4z122g7pojjTf5iY+7Cng=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nIkm8ANlQntKlL//HI3NLKSzxW0UmAZqPuyBH758xC4BLr0Dc0LnmS8w80QJYhSKMpHS/GJrZbUxz3dfB956tgRjMJgvgBZNH5+cRwe33VqNYAPZeV/s5TzYnNy3Td530UIadYiLAJlXaEjxuv9ujA2RJaFkmta5BGsKhpm7DEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=allelesecurity.com; spf=pass smtp.mailfrom=allelesecurity.com; dkim=pass (1024-bit key) header.d=allelesecurity.com header.i=@allelesecurity.com header.b=Jh8nbbuI; arc=none smtp.client-ip=74.125.82.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=allelesecurity.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=allelesecurity.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=allelesecurity.com header.i=@allelesecurity.com header.b="Jh8nbbuI" Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-2b4520f6b32so3631663eec.0 for ; Sun, 05 Apr 2026 21:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=allelesecurity.com; s=google; t=1775448850; x=1776053650; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6FFmfbqUJtg3hdvp5z3Iq8gFNeJQDVPJXxta1wcIAEU=; b=Jh8nbbuImDW6zj1BkR3H1gVy68FfYh+ps7Ek32WfFHob+Lvv/ZJlOT+fZQsVd28M68 sFl+62VAY5+45cz/KxfN+6eGDjTgfC5uAX8LeAD/se8T2nqO552jQ8FANi5jdB6aRU0B Y852mkvyB/ksdBzbJDQ5ZznSAPzpa4iDT+KFA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775448850; x=1776053650; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6FFmfbqUJtg3hdvp5z3Iq8gFNeJQDVPJXxta1wcIAEU=; b=k3oYQlKrKYo/ziu6MwIzGpWq3epIVgx519T5bDFOYSiFuTrGBzOPUr20uYMjCZeD+e VwUfCGB9R7xX35nrm0YxbDeiXH96cQydWwFNMIkmTW3/xt9M0LmUBZyAJb2Cs/fObHyG ABJHUuKCzRMJ9UDxAiDSb2c20tFLPQf+siKa1CupLjOf5ve+a1+dSA5655dLWbAR/vj6 krA3LTXLhr09rGB/2QDJSExaVL9oJ/AHiBTzJ06E1tfRA12w7vxNk+0r1ZYruEW9x5Xu o7wdWo+CGoZ2XogjC2cLTZX/OB5qkZF9qOJYL0EG292a9Fpyg3ciB188JSl18gLXTQyW iXmw== X-Forwarded-Encrypted: i=1; AJvYcCWO4cFOvAMXjv66Ccuml2FjOgW+roinHacSmaarEQCTBj8yoIAGwafQh6DoEzyifntS/YW6jYGJPJZoy0k=@vger.kernel.org X-Gm-Message-State: AOJu0YwR3Cd2CL3XzyzA7hGGIHAEEYh7EoDy6S0EJMJ3ghrAQTI4F1F3 qNboevkf9x7SM8Ofwnb97EMxhMhXy8SnUe1qMcRNqKu1LC83/h75aXIkPKFvdQLbNh8= X-Gm-Gg: AeBDiesUAD/QM9mAd7E+Oe1u+Eda6ZRaju/GcTA/TU0q/q3JXvmiLMTz1OHNW1CBMrY nSbybQqMZWF3v8NB5CbFoXtAuLFXY2qCxy8z3R207LAXnmZal03/2TylYCMDVsLT3UTnFlbrOJZ WXaEMwiV0QvsjpKMKcfaRL8cyFRVazqHb69FN/B4KGZrxdhasLr01vkn91yXlsJf+iLzPmWfL5e n2L/OLEaOPb9MBGHkKOIQqAI4+cTLmcEGWj6Jdx1LqSMI6rDHpd2YXIa+/7aAAvTrZD3xf7z0nV j+RtMl+Pey2SJjB2+h7si97c6zbd+hS5VrmWMktOjUdnV5yakAs20bHngUFsAMh0bUIDLQ6uTEx Z8DGOR/FQMwvNCPrt2hmToUyFZg3Di8sPl66J+EU+k8INckpOT613gtLFUEWYBUbHCBqLmIm99B mVpvQGGQjNr4b4W7OQAqibJpVHKJ2AWefOKkWK X-Received: by 2002:a05:7300:dc8e:b0:2c1:3f85:756 with SMTP id 5a478bee46e88-2cbf9fe3608mr5005632eec.11.1775448850222; Sun, 05 Apr 2026 21:14:10 -0700 (PDT) Received: from [192.168.1.2] ([179.105.152.82]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2cee97ff4e8sm3395736eec.25.2026.04.05.21.14.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Apr 2026 21:14:09 -0700 (PDT) Message-ID: Date: Mon, 6 Apr 2026 01:12:56 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] rxrpc/proc: size address buffers for %pISpc output To: Pengpeng Hou , David Howells , Marc Dionne , anderson@allelesecurity.com Cc: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260404190004.4-rxrpc-proc-pengpeng@iscas.ac.cn> <20260406141000.1-rxrpc-proc-reply-pengpeng@iscas.ac.cn> Content-Language: en-US From: Anderson Nascimento In-Reply-To: <20260406141000.1-rxrpc-proc-reply-pengpeng@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/6/26 3:10 AM, Pengpeng Hou wrote: > Hi, > > Yes. My original changelog example was too loose, and your quick test is > right for a fully expanded plain IPv6 form such as > > [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]:65535 > > That form is only 47 visible characters, so it fits in the current > char[50] buffers. > > The reason I still think the bug is real is the current %pISpc > implementation in lib/vsprintf.c. > > For AF_INET6, %pISpc goes through ip6_addr_string_sa(), and the compressed > path uses ip6_compressed_string(). That helper switches to a dotted-quad > tail not only for v4mapped addresses, but also for ISATAP addresses: > > useIPv4 = ipv6_addr_v4mapped(&in6) || ipv6_addr_is_isatap(&in6); > > So a current-tree case such as > > [ffff:ffff:ffff:ffff:0:5efe:255.255.255.255]:65535 > > is possible. That string is 50 visible characters, i.e. 51 bytes > including the trailing NUL, which does not fit in the existing char[50] > buffers used by the rxrpc procfs helpers. > > So I agree the example in my changelog should be corrected, but I do not > think the underlying bug goes away. The claim should be framed around the > ISATAP case rather than the plain IPv6 or mapped-v4 examples I used > originally. > > If that makes sense, I can resend with the changelog corrected to cite the > actual maximum case explicitly. > > Thanks, > Pengpeng Thanks! I confirm the ISATAP case really triggers the issue. It ends up writing 51 bytes, including the NULL byte. $ cat /proc/net/rxrpc/locals Proto Local                                           Use Act RxQ UDP   [ffff:ffff:ffff:ffff:0:5efe:255.255.255.255]:65   1   1   0 $ Regards, Anderson Nascimento