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 EDC5541A575; Tue, 21 Jul 2026 19:43:15 +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=1784662997; cv=none; b=AskNjc+vvb6EUMrcY+RkjTpzWX25y1/ZAgQryI4YxEk9LmapMcnq+kr4vO7eOTunffmdxVrgihXUHYGKRGk2eW1PFqIPfum4Nsifz0/wI68H+oS9rq1AVzk2Nbw4kXbhE9TAlmVY9d5ktLS48la1vpzpE89ndGkaOjtf6q+McKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784662997; c=relaxed/simple; bh=KanKkeyXR71ZB7BZmD32VILEMH7soJLhnxD0cux/P5w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wa9DtnGCxEY+F4aa9mj6f1sbuKijPar0P5pcg29bRnMawUUi8NVfjhhN5MOQG4gG+3k2y7Gr6P1aXKIB/zGze7DvcFqwq4JRkblNfa3fCbY6TJNI1Pqq6o+4zwWoK4bLRPJKSZhUMcHYyNsjwJ12JRrp1lH484kMboN7E0NaaPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AX8XIjm+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AX8XIjm+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E8841F000E9; Tue, 21 Jul 2026 19:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784662995; bh=2FQvUFMgGThEb68AelgWyzV3Veb6eRq6epkVcNCWVkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AX8XIjm+hzdpASYuYotHm0rq+3jpDXc/66jatvk/M5USIGLKZhecwI7DyCj6q7Ggr UpXa9jpwGDFtc7C8imgvJYKz0bbRz3ElLTclIP3izI/Ztkw+SbiAKjFGkYrC5Klqjk 7pCtblBk/6pHaHhiT/UK2TkG08j4+MEn7tJT7LDM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nicolas Dichtel , Fernando Fernandez Mancera , Ido Schimmel , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 0657/1276] ipv6: fix error handling in disable_ipv6 sysctl Date: Tue, 21 Jul 2026 17:18:20 +0200 Message-ID: <20260721152500.810931686@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fernando Fernandez Mancera [ Upstream commit c779441e5070e2268bdfe77f6e2e0de926c431e3 ] When writing to the disable_ipv6 sysctl, if proc_dointvec() fails to parse the input, it returns a negative error code. The current implementation is overwriting that error for write operations. This results in a silent failure, it returns a successful write although the configuration was not modified at all. When modifying the "all" variant it can also modify the configuration of existing interfaces to the wrong value. Fix this by checking the return value of proc_dointvec() and returning early on failure. Fixes: 56d417b12e57 ("IPv6: Add 'autoconf' and 'disable_ipv6' module parameters") Reviewed-by: Nicolas Dichtel Signed-off-by: Fernando Fernandez Mancera Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20260622130857.5115-2-fmancera@suse.de Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv6/addrconf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 522b05201c3e98..b8fb9f429fc50a 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -6458,6 +6458,8 @@ static int addrconf_sysctl_disable(const struct ctl_table *ctl, int write, lctl.data = &val; ret = proc_dointvec(&lctl, write, buffer, lenp, ppos); + if (ret) + return ret; if (write) ret = addrconf_disable_ipv6(ctl, valp, val); -- 2.53.0