Bug 27532 - GDB should ask the user for permission before downloading debuginfod files
Summary: GDB should ask the user for permission before downloading debuginfod files
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-06 07:53 UTC by Sergio Durigan Junior
Modified: 2022-01-09 16:36 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Durigan Junior 2021-03-06 07:53:11 UTC
One of the suggestions/complaints I got when we discussed Debian's debuginfod service on debian-devel was that the debuginfod client should inform the user before downloading the first file and ask for her consent before proceeding.

I'm not a debuginfod hacker, but I think this would probably require some sort of permanent file (under ~/.config/, maybe?) where the decision can be stored, and some way to allow the user to easily change this decision later.
Comment 1 Frank Ch. Eigler 2021-03-06 11:30:02 UTC
Getting all interactive from within a library such as libdebuginfod client is not really good practice nor generally practical.  I'd think that the setting of the environment variable & call into the library embodies consent by the enveloping application.
Comment 2 Sergio Durigan Junior 2021-03-06 17:51:49 UTC
Thanks for the reply, Frank.

Yeah, I thought about the good practices, too.  My rationale for filing this bug against debuginfod instead of e.g. GDB is that it is more uniform to have the actual agent who performs the download worry about obtaining permission, instead of having each library user (GDB, perf, etc.) do it.

As for the setting of the environment variable being considered consent, one of the points raised in the discussion on debian-devel is that, with the way things are implemented now (using a /etc/profile.d/ snippet), the user will likely not be aware that DEBUGINFOD_URLS is set unless she herself was the one who installed the system.  Also, and arguably, DEBUGINFOD_URLS's purpose is just to specify which debuginfod servers should be consulted, not if it is OK to do the actual request.

Anyway, I'm not opposed to the idea that it is the actual library user who should obtain explicit user consent here.  In a way, you could even consider that libdebuginfod is a wrapper around libcurl, and I totally agree that the library should implement the mechanism and that its clients should implement the policy.
Comment 3 Frank Ch. Eigler 2021-03-06 18:05:09 UTC
> the user will likely not be aware that DEBUGINFOD_URLS is set unless
> she herself was the one who installed the system.

The way I'd address this is to advise the sysadmin to set this by default
systemwide only if the user base is going to be copacetic with this, or
if they are informed somehow (release notes?) so they can easily opt out.
If pure documentation is not enough, maybe have some path from logon
through to the calling application print out the env var that first time.

Note that hypothetical unintentional information leakage is very small:
buildids, and perhaps the curl User-Agent: field.  That's it.  (It won't
get to querying source files unless the debuginfo is found first.)

Closing as WONTFIX on account of the impropriety of a low level library
engaging in interactive dialogue.
Comment 4 Sergio Durigan Junior 2021-03-07 20:41:04 UTC
Instead of WONTFIX for debuginfod, I am reopening this against GDB because I still think it is a good idea for the client to implement this feature.
Comment 5 Aaron Merey 2021-11-24 00:32:12 UTC
(In reply to Sergio Durigan Junior from comment #4)
> Instead of WONTFIX for debuginfod, I am reopening this against GDB because I
> still think it is a good idea for the client to implement this feature.

Hi Sergio. Since commit 7811fa5995 gdb will print a notice when debuginfod is enabled and give the user a chance to opt out. Closing this bug as FIXED.
Comment 6 Sergio Durigan Junior 2021-11-24 03:51:26 UTC
(In reply to Aaron Merey from comment #5)
> (In reply to Sergio Durigan Junior from comment #4)
> > Instead of WONTFIX for debuginfod, I am reopening this against GDB because I
> > still think it is a good idea for the client to implement this feature.
> 
> Hi Sergio. Since commit 7811fa5995 gdb will print a notice when debuginfod
> is enabled and give the user a chance to opt out. Closing this bug as FIXED.

That's awesome, Aaron.  Thanks a lot.