From nobody Tue Oct 22 19:03:15 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XY1mL33mDz5VkZl for ; Tue, 22 Oct 2024 19:03:30 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XY1mK5KNtz4pLR for ; Tue, 22 Oct 2024 19:03:29 +0000 (UTC) (envelope-from tomek@cedro.info) Authentication-Results: mx1.freebsd.org; none Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-e2bd7d8aaf8so3253834276.3 for ; Tue, 22 Oct 2024 12:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; t=1729623809; x=1730228609; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WxhI+IlQGCRAwVf9WlF330CoI9R6/48T0SsVOguXtJU=; b=d2d7AXupSC7+Yb7KNpgquOpBsBFcVV0FqtppQdmhTsDqjo812Jv79qLrSDMrsWDvqe HFNGHu8fw5aK0cKHrj/odnTE7ybIAoO+QjWD1h4+0K3ampJwu9Ah1RzenhqS2IL790Gn dLBsWRlKkTcB88BqsxeSqNS72Alg8yCdoR8krIQywUsYfrkW7c+oTR149dLdGzQ0Nwoc pD2TGQYRZ/uaNTNgaszFl7cM9d17qF4u5QdkqCDaBe/Iq096f0HHkAyrL99PprwQhdY9 e+YgoFT/Bc5OBsAUKpzjNSlcFTYyjpkYYfFzezN32EbywOS8X2OYG9ghXwskQH7C5krS +15Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729623809; x=1730228609; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WxhI+IlQGCRAwVf9WlF330CoI9R6/48T0SsVOguXtJU=; b=pZZgpSf78f3YucRhN3zSal6FECbTjBJkYX9huzmjf5B2MfyO/Z/XjkTN/Nh0BNgcTk XwZGj/+YGXI50N3veaSiQeI3QRCVVvETn+F/mFkS79I4G2mfWwUhs69rmwSJn6NqN73c ieHEvBLVa2eH+gxLW9EmP81XeFYSBaf14Mf5s8lPewOwGEz76eYI2mRFE2RcCiEHRjxz LPX2PTQ5h3r11Q6iJuTI0Uynza4bxqc35FgkiowZqrYxLPlDsFXTbZZBEdcA3pyKEN+Z sNKE+4PM+A67UFUIfT7trXkXkSJXnW7ae15MyI39SmNDKMYegGDGELrUyVyQwfTWWD79 kUlA== X-Gm-Message-State: AOJu0Yxeh+QYN/4OnvKA6NBc+qMOxJSp26uZcpw4iJ6OuP5un6CQ8mIw 85sMQlWba95bF/75zwhQIaoRIwyvyWZCrbdNdcmHBY7Ir7L2oZm1DOWFFsBwiV8XtVQLC8pZJnM = X-Google-Smtp-Source: AGHT+IGQO/e0kF4RZ6VJnYwmI+Pw/GUVkDs0OrD8fkTc2QVN8+8YV7MogVpDrptVf6yf3ir7B4FN4Q== X-Received: by 2002:a05:6902:2502:b0:e2b:dcb6:ffa1 with SMTP id 3f1490d57ef6-e2e2721c08fmr3220704276.40.1729623808832; Tue, 22 Oct 2024 12:03:28 -0700 (PDT) Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com. [209.85.128.170]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e2bdc96ab29sm1166955276.10.2024.10.22.12.03.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Oct 2024 12:03:28 -0700 (PDT) Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-6e5cec98cceso35671197b3.2 for ; Tue, 22 Oct 2024 12:03:28 -0700 (PDT) X-Received: by 2002:a05:690c:4b05:b0:6dd:d0fa:159f with SMTP id 00721157ae682-6e7f0f89654mr204977b3.34.1729623807759; Tue, 22 Oct 2024 12:03:27 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> <202410221118.49MBIRSj009090@critter.freebsd.dk> <202410221847.49MIlXEs014246@critter.freebsd.dk> In-Reply-To: <202410221847.49MIlXEs014246@critter.freebsd.dk> From: Tomek CEDRO Date: Tue, 22 Oct 2024 21:03:15 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pyserial.tools.list_port improvement for FreeBSD To: Poul-Henning Kamp Cc: hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XY1mK5KNtz4pLR X-Spamd-Bar: ---- On Tue, Oct 22, 2024 at 8:47=E2=80=AFPM Poul-Henning Kamp wrote: > > -------- > Tomek CEDRO writes: > > > On the "desc:" in place of ugen I would put "Silicon Labs CP2102N USB > > to UART Bridge Controller" as the ugen is in the HWID/LOCATION or > > there is a reason to put ugen there? :-) > > The strings from the USB descriptors are unfortunately not available > from devinfo(8) and usbconfig(8) needs root-privs to reveal them. > > I vaguely recall that the strings are not in devinfo (aka: "newbus") > due to valid security concerns about unsafe "strings" like these, > but I cannot find any evidence of/from that ancient discussion just > now. > > I do find it inconsistent, that usbconfig(8) cannot function in > read-only mode for plain users, given that the information it would > reveal is already available for all from dmesg, but this might not > be policy but merely an sideeffect of the implementation. Hmm, I am running usbconfig on non-root user in the operator group with some devfs.rules tweak that enables operator group members to have full access to usb devices with no suid and I can see these strings :-) I did put a pkg-message when creating OpenOCD port and it seems to work fine for a long time :-) % whoami cederom % cat /etc/devfs.rules [system=3D10] add path 'usb/*' mode 0660 group operator % grep ruleset /etc/rc.conf devfs_system_ruleset=3D"localrules" % whereis usbconfig usbconfig: /usr/sbin/usbconfig /usr/share/man/man8/usbconfig.8.gz /usr/src/usr.sbin/usbconfig % ls -al /usr/sbin/usbconfig -r-xr-xr-x 1 root wheel 29504 4 lip 20:31 /usr/sbin/usbconfig % usbconfig (..) ugen0.7: at usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (300mA) % ls -al /dev/usb/0.7* crw-rw---- 1 root operator 0x24a 22 pa=C5=BA 20:50 /dev/usb/0.7.0 crw-rw---- 1 root operator 0x24e 22 pa=C5=BA 20:50 /dev/usb/0.7.1 crw-rw---- 1 root operator 0x250 22 pa=C5=BA 20:50 /dev/usb/0.7.2 crw-rw---- 1 root operator 0x252 22 pa=C5=BA 20:50 /dev/usb/0.7.3 crw-rw---- 1 root operator 0x253 22 pa=C5=BA 20:50 /dev/usb/0.7.4 crw-rw---- 1 root operator 0x280 22 pa=C5=BA 20:50 /dev/usb/0.7.5 Can you please verify? Maybe when this string is not available you can put ugen0.7 instead? :-) Thank you :-) Tomek --=20 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info