From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B62504613C for ; Mon, 27 Jan 2025 21:21:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A74FE40B97; Mon, 27 Jan 2025 21:21:41 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id A600E40A72 for ; Mon, 27 Jan 2025 21:21:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738009298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Da3uaxwBuVkbS304e2YdwETbgiPtKvEdRF77b2OeqMI=; b=OY2DageGsoXqZldVpzbGFziRcn3O8cD3g/kr4cGwixFIFUZ4Ty/WNQvKQTBmB4/kvb06GK 42Y8lXBkqBvaYvy+i8AMbUrQAhsrZnx4ec6ZXaKn7WPTZvyL9CVv0kAkfVO9/YXFbVes/2 m2QEnvqfWJSek9WmaHhF8HkGe9korm0= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-152-UbJ__qBSP8eIotSfW3xIJg-1; Mon, 27 Jan 2025 15:21:36 -0500 X-MC-Unique: UbJ__qBSP8eIotSfW3xIJg-1 X-Mimecast-MFC-AGG-ID: UbJ__qBSP8eIotSfW3xIJg Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4361b090d23so24783275e9.0 for ; Mon, 27 Jan 2025 12:21:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738009295; x=1738614095; h=in-reply-to:references:user-agent:to:from:cc:subject:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Da3uaxwBuVkbS304e2YdwETbgiPtKvEdRF77b2OeqMI=; b=nKt16wgHj7nawf2CxZqnsvkOHdz68KbDpALTZ6PAegxQ002WQY9ih+G8QqdZI2kabh Gm+estXNZjrHPJ6AV7Jz3EXaffW/QieNlJSGlnSvXFJ16/tfJMK0nahF8DoV+StGzws+ IbZffLSWQIWuWJp7LpB0D4nsrmjVXg/OUF20i2gBk0XHZqAi0d9gw6XjCzV4A1TrSB3A Kw5IXX6CwuO+OpnKz+Nhn3a2lY3HIWRHR1PhfXwH9llxEm8dMbEgmvoBl+VZHW/Zqhix XInf/dWoDroFj2ojZVu8TLR19dES+CmyspEhIHOC+QJAbRfHXnNphNQYJp5oi22J7C7L M07Q== X-Forwarded-Encrypted: i=1; AJvYcCXwfFbQVxwHNPI2av2GWG/wx1blUrTBBGMUlFpjC02QE/Z2rPEQbPHMRrVj2q+aH/nvePdi2g0=@dpdk.org X-Gm-Message-State: AOJu0Yyy4mnbBGwjur7NzUE/728TueswxUw9BTaDrPDHbT+x2MxgHK+B ycXkvtPOXok5O8WUfdkJo1ZHxsxLsa3g+uh+qKQaNQ9WzsR4ba610yEZy1a+GMRB4/Va3yKWET3 H8mJDxHx7TQAZuhNoG/DDRkdOp0aDbVrpgdDYQFrUXdZy X-Gm-Gg: ASbGncvEzf9FfCXmiVDcDCwEzm7mDg7D4R1wmXuE28aH6Re7OGqzxI1VH803WJ+Zs6l PgNTfhd8umpQcg3R8aiUEwbhcfHpUzvYCQgzkU8mg7hCICaADVKXLgjdq9X5Hi61SwcotRLLIrG fG+V1Y5e9aJcF4BqL9ONZry/N3YAGxV0TdRBABgNT/pYy8IBNmI/56T7q6ZnyFGEmQjN2te0OQo aJe+NWP7HVryEKEPed70gyXCQ4ji4pspTR4+RcSvbhl/DcKZubFcEB9x+qpDCdazHM606np+4Eo p6Pd6MktST/zVRs/4OgmC+32YDnwNdk14jCBREaIHRmgg/DOlsnFEHQDd6iVh4w= X-Received: by 2002:a05:600c:4894:b0:434:a7e7:a1ca with SMTP id 5b1f17b1804b1-43891427762mr337023535e9.20.1738009295439; Mon, 27 Jan 2025 12:21:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyuoceV1duCdDyMqWNjrVsduY4FNqYtvWII7LxneCtRqB1l9Zw/YXzG+YyK2RSINSrZ/dbow== X-Received: by 2002:a05:600c:4894:b0:434:a7e7:a1ca with SMTP id 5b1f17b1804b1-43891427762mr337023415e9.20.1738009295091; Mon, 27 Jan 2025 12:21:35 -0800 (PST) Received: from localhost (2a01cb000245cb001c88b351a0902c32.ipv6.abo.wanadoo.fr. [2a01:cb00:245:cb00:1c88:b351:a090:2c32]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4fa3efsm145348475e9.2.2025.01.27.12.21.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jan 2025 12:21:34 -0800 (PST) Mime-Version: 1.0 Date: Mon, 27 Jan 2025 21:21:34 +0100 Message-Id: Subject: Re: [PATCH dpdk] telemetry-exporter: listen on loopback by default Cc: , From: "Robin Jarry" To: "Bruce Richardson" User-Agent: aerc/0.20.0-2-g96322f5eae08 References: <20250127115143.585207-2-rjarry@redhat.com> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: eLQ01qDgxigSSbDqAFk44HFcZLx0LpjG8R-qiBaLhzE_1738009295 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Bruce Richardson, Jan 27, 2025 at 15:39: > On Mon, Jan 27, 2025 at 12:51:44PM +0100, Robin Jarry wrote: >> Fix the following warning reported by Coverity: >>=20 >> Defect type: SIGMA.insecure_network_bind: >> > dpdk-stable-24.11.1/usertools/dpdk-telemetry-exporter.py:278: >> > Sigma main event: The HTTP server binds to all network interfaces by >> > setting the IP address to "", `0.0.0.0`, `::`, or `::0`. >> > This may expose the server to unintended traffic. >>=20 >> Avoid listening to all interfaces by default to avoid exposing private >> information unwillingly. >>=20 >> Unrelated: The Python stdlib TCP server listens on IPv4 only by default. >> Changing this requires creating a subclass that overrides address_family >> to socket.AF_INET6. >>=20 >> Fixes: d94ebd627a86 ("usertools: add telemetry exporter") >> Cc: stable@dpdk.org >> Signed-off-by: Robin Jarry >> --- >> usertools/dpdk-telemetry-exporter.py | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >>=20 >> diff --git a/usertools/dpdk-telemetry-exporter.py b/usertools/dpdk-telem= etry-exporter.py >> index 6eca0db2e80a..6f66d4ecaab1 100755 >> --- a/usertools/dpdk-telemetry-exporter.py >> +++ b/usertools/dpdk-telemetry-exporter.py >> @@ -75,7 +75,7 @@ def cmd(self, uri, arg=3DNone) -> dict | list: >> "/usr/local/share/dpdk/telemetry-endpoints", >> "/usr/share/dpdk/telemetry-endpoints", >> ] >> -DEFAULT_OUTPUT =3D "openmetrics://:9876" >> +DEFAULT_OUTPUT =3D "openmetrics://127.0.0.1:9876" >> =20 > > Minor nit, but would it be better to use "localhost" rather than the > hardcoded IP here and below? That's a good point. I had considered it but as I wrote in the commit message: >> Unrelated: The Python stdlib TCP server listens on IPv4 only by default. >> Changing this requires creating a subclass that overrides address_family >> to socket.AF_INET6. On certain systems and depending on the libc implementation, localhost may resolve to ::1 which causes an error on startup: socket.gaierror: [Errno -9] Address family for hostname not supported I dug a bit and it happens that the python standard TCPServer implementation explicitly uses AF_INET when creating the socket. Hence bind() fails with IPv6 addresses.