From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 32F7C1FF146 for ; Tue, 12 May 2026 10:34:35 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 39C4C881A; Tue, 12 May 2026 10:34:33 +0200 (CEST) Message-ID: <2f1c3f22-6fa9-4032-870e-65eab1d2152e@proxmox.com> Date: Tue, 12 May 2026 10:34:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-manager] fix #7187: report: add ethtool output for physical interfaces To: Erik Fastermann , pve-devel@lists.proxmox.com References: <20260508124030.164094-1-e.fastermann@proxmox.com> Content-Language: en-US From: Friedrich Weber In-Reply-To: <20260508124030.164094-1-e.fastermann@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778574753356 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.013 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Message-ID-Hash: CHPNVNCDLBXEFV3AT5QKNEVYKMJQCHK4 X-Message-ID-Hash: CHPNVNCDLBXEFV3AT5QKNEVYKMJQCHK4 X-MailFrom: f.weber@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi, thanks for tackling this! A few comments inline (note that I only looked at the PVE patch) On 08/05/2026 14:39, Erik Fastermann wrote: > Signed-off-by: Erik Fastermann > --- Please add some rationale to the commit message [1], you can derive it from the bug #7187 for instance. > > NOTE: A similar patch was applied to all products: > pmg, pve, pbs, pdm. > > PVE/Report.pm | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/PVE/Report.pm b/PVE/Report.pm > index 29433d4a..b3a5c08c 100644 > --- a/PVE/Report.pm > +++ b/PVE/Report.pm > @@ -3,6 +3,7 @@ package PVE::Report; > use strict; > use warnings; > > +use PVE::IPRoute2; > use PVE::Tools; > > # output the content of all the files of a directory > @@ -142,6 +143,14 @@ my $init_report_cmds = sub { > }, > }; > > + my $interfaces = PVE::IPRoute2::ip_link_details(); > + > + for my $iface (sort keys %{$interfaces}) { > + if (PVE::IPRoute2::ip_link_is_physical($interfaces->{$iface})) { > + push @{ $report_def->{network}->{cmds} }, "ethtool $iface"; Everything in $report_def->{network}->{cmds} is essentially passed to run_command, and passing strings from the outside (like $iface) to something like run_command can be dangerous (e.g. allow command injection). Granted, here this is the name of a physical interface, so the risk of someone injecting something there is low, but as a precaution I'd still apply a PVE::Tools::shellquote on $iface before constructing the ethtool command here. > + } > + } > + I'd probably wrap the whole thing in an `eval` with a `if(@)` afterwards, just to prevent something die'ing in `ip_link_details` or `ip_link_is_physical` from crashing the report. > if (cmd_exists('zfs')) { > push @{ $report_def->{volumes}->{cmds} }, > 'zpool status', [1] https://pve.proxmox.com/wiki/Developer_Documentation#Commits_and_Commit_Messages