Date: Tue, 20 Dec 2011 21:31:20 +0100 From: Stefan Richter Subject: firewire: do not expose globally unique IDs in the kernel log Printing worldwide unique IDs in the kernel log is questionable from a privacy point of view. Some people edit such IDs out of the log before they post bug reports. Make life easier for them and do not log GUIDs anymore. For local debugging, GUIDs are still available during the lifetime of a device in /sys/bus/firewire/devices/fw*/guid. Instead, log the vendor-unique part of the device ID (the OUI) in firewire-core and bus IDs in firewire-net. Signed-off-by: Stefan Richter --- drivers/firewire/core-device.c | 8 ++++---- drivers/firewire/net.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) Index: b/drivers/firewire/core-device.c =================================================================== --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -1036,16 +1036,16 @@ static void fw_device_init(struct work_s fw_schedule_device_work(device, SHUTDOWN_DELAY); } else { if (device->config_rom_retries) - fw_notify("created device %s: GUID %08x%08x, S%d00, " + fw_notify("created device %s: OUI %06x, S%d00, " "%d config ROM retries\n", dev_name(&device->device), - device->config_rom[3], device->config_rom[4], + device->config_rom[3] >> 8, 1 << device->max_speed, device->config_rom_retries); else - fw_notify("created device %s: GUID %08x%08x, S%d00\n", + fw_notify("created device %s: OUI %06x, S%d00\n", dev_name(&device->device), - device->config_rom[3], device->config_rom[4], + device->config_rom[3] >> 8, 1 << device->max_speed); device->config_rom_retries = 0; Index: b/drivers/firewire/net.c =================================================================== --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -574,8 +574,8 @@ static int fwnet_finish_incoming_packet( spin_unlock_irqrestore(&dev->lock, flags); if (!peer) { - fw_notify("No peer for ARP packet from %016llx\n", - (unsigned long long)peer_guid); + fw_notify("No peer for ARP packet from %04x\n", + source_node_id); goto no_peer; } @@ -1545,8 +1545,8 @@ static int fwnet_probe(struct device *_d } list_add_tail(&dev->dev_link, &fwnet_device_list); - fw_notify("%s: IPv4 over FireWire on device %016llx\n", - net->name, (unsigned long long)card->guid); + fw_notify("%s: IPv4 over FireWire on card %d device %s\n", + net->name, card->index, dev_name(card->device)); have_dev: ret = fwnet_add_peer(dev, unit, device); if (ret && allocated_netdev) { Date: Tue, 20 Dec 2011 14:58:56 -0600 From: Carl Karsten Subject: Re: [PATCH 1/3] firewire: do not expose globally unique IDs in the kernel log grumble. I use those guids like so: plug in dv cam, dmesg, cut guid to clipboard, run: dvgrab -guid (paste) It also kinda helps me keep track of what devices are misbehaving, but this alone isn't very important. Any chance of making this configurable? [...] -- Carl K Date: Wed, 21 Dec 2011 00:10:31 +0100 From: Stefan Richter Subject: Re: [PATCH 1/3] firewire: do not expose globally unique IDs in the kernel log On Dec 20 Carl Karsten wrote: > grumble. > > I use those guids like so: > > plug in dv cam, dmesg, cut guid to clipboard, run: > dvgrab -guid (paste) How about: #!/bin/sh guid=$(cat /sys/bus/firewire/devices/$1/guid) shift dvgrab -guid $guid "$@" To be called as "dvgrab-wrapper fw3 [more dvgrab options]", with fw3 being the device of your choice, e.g. the one that just scrolled by in syslog. Or you run "grep . /sys/bus/firewire/devices/*/guid | sed s/\\/guid:/\\t/" before dvgrab, and you get a list of GUIDs from which you can copy and paste. > It also kinda helps me keep track of what devices are misbehaving, but > this alone isn't very important. > > Any chance of making this configurable? So far the configuration of the "new" firewire drivers were kept at an essential minimum, and I am hesitant to add more baroque ones. I would rather drop this patch now that there was negative feedback, unless there is going to be positive feedback as well. -- Stefan Richter -=====-==-== ==-- =-=-- http://arcgraph.de/sr/ Date: Wed, 21 Dec 2011 00:43:52 +0100 From: Stefan Richter Subject: Re: [PATCH 1/3] firewire: do not expose globally unique IDs in the kernel log On Dec 21 Stefan Richter wrote: > Or you run "grep . /sys/bus/firewire/devices/*/guid | sed s/\\/guid:/\\t/" > before dvgrab, and you get a list of GUIDs from which you can copy and > paste. Or (cd /sys/bus/firewire/devices; grep . $(ls -c */guid)) | sed s/\\/guid:/\\t/ for a list in reverse-chronological order of discovery. Same but narrowed down to AV/C devices: (cd /sys/bus/firewire/devices; for fw in $(grep 0x00a02d:0x010001 $(ls -c */units) | cut -f1 -d/); do printf $fw\\t; cat $fw/guid; done) -- Stefan Richter -=====-==-== ==-- =-=-= http://arcgraph.de/sr/ Date: Tue, 20 Dec 2011 17:50:02 -0600 From: Carl Karsten Subject: Re: [PATCH 1/3] firewire: do not expose globally unique IDs in the kernel log [...] To further describe my pain: I am going to run dmesg anyway to see if the device is being detected and or any errors. Once I see that it is connected, it is really nice having the guid right there. I am really bummed I didn't invite you to PyCon in Leipzig so you could see what I do first hand. Maybe next time. -- Carl K