Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2504956lqb; Tue, 28 May 2024 01:45:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVusjx/pvuLqFiIfyP3PiLvcEDZ0rikgdTv1A988LYFKMXkLxoM5ns6yQf7TPyxkFtDRB4xKgRD6T0W/qohPcsEIFN+twz+brgm+Qvyfw== X-Google-Smtp-Source: AGHT+IHOr2sRvREaL1Ip5MQA7nLGrKLTfUgdAPOPwHfqXqp26X6Gn0s+5jULj6EfMhP5yv83Jf1T X-Received: by 2002:a05:6808:8d9:b0:3c8:5da4:5f7d with SMTP id 5614622812f47-3d1a5e2d3a5mr10883683b6e.25.1716885911267; Tue, 28 May 2024 01:45:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716885911; cv=pass; d=google.com; s=arc-20160816; b=wyJJZiZ5sLwwJGViPuYEfjRHVVTDjMeJqdsQepW9VBX01wpStYVvXJApI3pqICppVR PoFducA+tfaIor3AiYxuiO+BB5dWJnddX5D25x6aYx/PUaZHYzainy42mNxtnGkumoFn Gaf/Vuijzw3faD1tkVIksV24q0E1kOAyckw9aCSdbBefgGGe4gXwmtIYjXqlSazamcFT yFjBKfwlUjEmzAp6tLRRCVqLULZ8m9hSil/K06st/yjrL6CyAgrWPT3H5P+BP6Fq2ixJ mG9VMMKJnAUleXlLvTnX1S7KkHoUU9ebwU8ip/LXpP2PdhF0TJ8iPkIILc/W81m/sS0j 4nqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=wQ44z2IHQxiByRr0eSjAKQIa4cR1QKAIlkWz5epjhe8=; fh=rJQJnbZTTRnnHHKVTNUQXz7mlUUD8Y5xXYeGjNTBXPk=; b=akpjZoLTFP2m2z/H4Lt89ApRbxCavH0AJULd1h9Gn2JcMydbTaNNrMedac6JnPuAdW nuIEOW7GkkvaTUcs8OUfQfEcvB/abeaTqKH+Q+EDP8D4CP+NaKL6xcNl/OTJqT02Mri8 WuncMrNx174b4e4dlmkD6Hh6il4+tFkTSgZHmCpc9O4rob1DYSwvHIwMgA6nGnflv6l4 sGCzDUKPtLsKs/4ztGrg06yuvruDlJGgk6zJwBp2yXfXxJLxXDJwACvWhzZm5aPV63FL Ohxw+QaMzFHzQwVEPmFxo4pFYXPC4YPO2ewFwP1Qb2SJa/ry46bjniZ5r9ONxQT8oe3I fiAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-191954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191954-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-68221b73b68si7817934a12.104.2024.05.28.01.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 01:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-191954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191954-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 22B56B23B23 for ; Tue, 28 May 2024 08:43:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24FD213C83E; Tue, 28 May 2024 08:42:41 +0000 (UTC) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (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 D4AD813C830; Tue, 28 May 2024 08:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716885760; cv=none; b=BxhzuGSWLP2+F75d6D/3Cr+0CrMxV8te7clSrNd/ysSDRorqhNMfrmA3w5ehZrGQDuQADN8mUcS1yIdsuF8m8cWugz++M5cMSH8fPvL8i/xbzqFNL5teHn2zMLrUcfeuq8TQCsCehWSAVLRj52rF6FX7sjoOCTRV4gfM3lsI/M8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716885760; c=relaxed/simple; bh=IHyNigSCLQ5VlvilEwW2sJrDDZCTJHMR4UeBcHElRZw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=m4nYWNzqi5hT2q7I0YQKvRzNnZwMSKWEEYXJkcokg2VctWRhsu9/f/b2v0AXH5WOZBhsdi4HgcnjvyFZa3acSqdVcOYZ6UFm0AtQa7xeKjPy25D+Zc9XoidtgJVfjFs3iFBozBeNqGIZGu7VniUAoSAFk3DXY10D3WpkQzIy/L0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a62db0c8c9cso54334566b.2; Tue, 28 May 2024 01:42:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716885757; x=1717490557; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wQ44z2IHQxiByRr0eSjAKQIa4cR1QKAIlkWz5epjhe8=; b=qaBrSRoprLAE+5BxiW+xHtCk40tCEPMU1MxWYeVjFtfTDL3/qiAtOS88u/6s1a8eum OVKTMXJ1Kd7AihIVJ1GlaJyZLhttRJOR3zOpGV8NlVBatMSIqXUkSQYMEtSmPgQxA4Ht UB9TON1rT4eyjjd85Q4+04qQ9wvXANmhtHbn8YTgf2zrBcJ3AR9KXrb6hl4FVYnxmEb2 p935beLUWyLaEtKVA6DQvNor2Ar4xE4atqq/W+xMRcsdX3f1aZIq6qvUyI4wy40Udgt8 fSmN09VNMN8USHTpJ9E0poKjktRq5f33LkQZugIZXxaT446Mrtpl/svpSFfJpgUY8WgQ /Fbw== X-Forwarded-Encrypted: i=1; AJvYcCXvTx50oLDfsmB2QFevmVGFjRM5sOrrdY0XgajmXu5ymyZ2qYWt1Tcw0gJ8gpylGs3nXez37loyKP5UA6obs5Blr62VFF5r1fZXa6vBQqqOC1LU3XdB4ebx/0MTaxor091eOoW2 X-Gm-Message-State: AOJu0YxeZ6rPaxVKdyycHg3tWLIHxPXTPkR/qkuW5KTV4Hm5X7GX6uYc qy8VNTp/gy3ZtgjAthWlTIR1uB03prahyK+LRJ4OB3kNtOvCYn/k X-Received: by 2002:a17:906:f1d3:b0:a5a:2d0d:2aef with SMTP id a640c23a62f3a-a62642e7322mr1112803466b.21.1716885756902; Tue, 28 May 2024 01:42:36 -0700 (PDT) Received: from localhost (fwdproxy-lla-117.fbsv.net. [2a03:2880:30ff:75::face:b00c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c0cc372sm588031866b.0.2024.05.28.01.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 01:42:36 -0700 (PDT) From: Breno Leitao To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: thepacketgeek@gmail.com, Aijay Adams , netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net v2] netconsole: Do not shutdown dynamic configuration if cmdline is invalid Date: Tue, 28 May 2024 01:42:24 -0700 Message-ID: <20240528084225.3215853-1-leitao@debian.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If a user provides an invalid netconsole configuration during boot time (e.g., specifying an invalid ethX interface), netconsole will be entirely disabled. Consequently, the user won't be able to create new entries in /sys/kernel/config/netconsole/ as that directory does not exist. Apart from misconfiguration, another issue arises when ethX is loaded as a module and the netconsole= line in the command line points to ethX, resulting in an obvious failure. This renders netconsole unusable, as /sys/kernel/config/netconsole/ will never appear. This is more annoying since users reconfigure (or just toggle) the configuratin later (see commit 5fbd6cdbe304b ("netconsole: Attach cmdline target to dynamic target")) Create /sys/kernel/config/netconsole/ even if the command line arguments are invalid, so, users can create dynamic entries in netconsole. Reported-by: Aijay Adams Signed-off-by: Breno Leitao --- Changelog: v2: * Use IS_ENABLED(CONFIG_NETCONSOLE_DYNAMIC) directly instead of a external function to check if dynamic reconfiguration is enabled. --- drivers/net/netconsole.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index d7070dd4fe73..ab8a0623b1a1 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -1262,6 +1262,8 @@ static int __init init_netconsole(void) while ((target_config = strsep(&input, ";"))) { nt = alloc_param_target(target_config, count); if (IS_ERR(nt)) { + if (IS_ENABLED(CONFIG_NETCONSOLE_DYNAMIC)) + continue; err = PTR_ERR(nt); goto fail; } -- 2.43.0