From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.128 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795880992; b=ypiFTOmSWs7vO/ic1kmGymH8os0SzlQhZCkcMgBsJhyHumzGjUuQnoUWDI07WMlCpnqi 6nTfdJ3zG/+61QQnI7jc6N2qiJeAOKUEq3DqOQZGzSw8gSGBOaxbg0TbBY7wgUZRLSLHt O7Mr8kP2B4H8PPTG3XW1ImG2aXj6WrDwSBFsOypNhtHGciTsp06F2FWoc4SoXjRJDQqxZ cKvf4bY4NgSZ6LCqR9OKw/e3qTGfaUtQGXXG62/Fnq9Lby5VcaE6Myrczk7/8OOn/bkXU ESnD2AhMDdjNX50KaXA7cKaWyuy0HHEKw48x9cdByBg1UtgDi2IfBrc+l4snb+RcXJg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795880992; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:CC:Subject:In-Reply-To: References:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=3tDHcCr13zYeauyEYlS1W+adMoKlAGX2HKcZrR7frLk=; b=al0So3tqGYTRZqHuzYqG3P20j9ZO0uPtd85zmqEPxEPgMkPigH9L7UL/mWXFG5r0u8SY AtRuMWy6zbEujQSpyjmrwhWjYovdqjOg8mXX50AqG9w6WdIQcpC6hvJJnCkaKI9Zx7w6a FhH4HkpT8avWRjhfeRvHPh364lJgIKFpzuWZdjVjNuIc5wV9gVrWQJ+rqTUy7IV3XE+tb mJMsC8BPdH535egWb1j1VWrF5gZ2FBtzDItOj03iOiNTLHMw9I0bIM2utkRwq7gAGxh4d qUJe6GefsEwKD4z2ZnJrGC/HbSUe0V4CH3LfleRfg1o9KOaILhtE/9Q+TDkXkxsKpcw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=eO2HPSA0; arc=none smtp.remote-ip=91.218.175.128 Received: from mta0.migadu.com (out-128.mta0.migadu.com [91.218.175.128]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E62EE606A321 for ; Sat, 28 Nov 2026 15:49:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E62EE606A321 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, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=eO2HPSA0 X-Envelope-To: stable@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=x/SfbLT+C+46sgDmsdu/nt9Gx03sWMPSsDca01XiedE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795880989; v=1; x=1796485789; b=eO2HPSA0D3vRqQrjQukuDAFkG4KVFL+qKB14HiqwS1dbt5qW3xeHA16u/Q03+UM94UnZxOQ6 JWLQUoTKns6/0GmyFPF28bvfmsf8uZ9JB7LtOVuoM8+bIWvNOP3RRBNAvPxWKeXgGKuuVYBWBG/ 6KTWNvi7pV/zqyYc/slnqtbQ= X-Envelope-To: stable@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 05e75da0e92dddfb; Sat, 28 Nov 2026 15:49:49 +0000 X-Mizu-Trace-ID: 05e75da0e92dddfb X-Migadu-Flow: FLOW_OUT Date: Sat, 28 Nov 2026 15:49:48 +0000 From: Bradley Morgan To: ndokutovich@gmail.com CC: brauner@kernel.org, jack@suse.cz, jlayton@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, viro@zeniv.linux.org.uk Subject: Re: [PATCH 0/2] listns(): validate the reserved spare2 field In-Reply-To: <2DE3E250-2C87-4816-B96F-CD951F02BD6E@linux.dev> References: <2DE3E250-2C87-4816-B96F-CD951F02BD6E@linux.dev> Message-ID: X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 28 November 2026 15:44:07 GMT, Bradley Morgan wrote: >On 28 November 2026 14:06:21 GMT, Nikolai Dokutovich > wrote: >>copy_ns_id_req() rejects a non-zero @spare but not @spare2, although >>struct ns_id_req documents both as reserved. Validate @spare2 the same >>way, and extend the error-case selftest to cover it instead of only >>@spare. >> >>Nikolai Dokutovich (2): >> nstree: reject a non-zero spare2 in the listns() request >> selftests/namespaces: check that listns() rejects a non-zero spare2 > >Had a nice read through, thanks for the tests, for the whole series, let's >put, > >Reviewed-by: Bradley Morgan > >Also, a nice question, since I tend to be a bit ^Winsane^W > >Is this bug a edge case? Most bugs found nowadays in the kernel are edge >cases, but they would still need to be merged, because again, it's still a >case that can be reached. > >My question to you, is could this bug be actually reached? Like, would a >future caller set spare2 as non zero? would the driver maintainer for >example be silly enough to set non zero spare2, probably knowing the >consequences (if they understood the code), well, if they didn't, it'd be >their problem, no? Aw I was wrong, sorry, the function is called thru tests and as a syscall. Apologies for the wrongness :( R-B stands. > >I had a look at some callers, mostly selftests, and they all patch up this >correctly, so this wouldn't be reachable RIGHT now. I added my tag because >we will have to account for the future callers silliness (adding non zero >spare2)... > > > >> >> kernel/nstree.c | 2 +- >> tools/testing/selftests/namespaces/listns_test.c | 11 +++++++++++ >> 2 files changed, 12 insertions(+), 1 deletion(-) >> >> > >--- Thanks! --- Thanks!