public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug debuginfod/29022] New: 000-permissions files cause problems for backups
@ 2022-04-04  9:42 bugzilla at hadess dot net
  2022-04-04 21:43 ` [Bug debuginfod/29022] " fche at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bugzilla at hadess dot net @ 2022-04-04  9:42 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29022

            Bug ID: 29022
           Summary: 000-permissions files cause problems for backups
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debuginfod
          Assignee: unassigned at sourceware dot org
          Reporter: bugzilla at hadess dot net
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

the debuginfod-client creates 000-permissions files as a way to mark "negative
caching". Unfortunately, that causes permissions problems for backup software,
disk usage checkers, etc. that rely on being able to access the user's own
files.

Given that the usage of those 000-permission files is not even atomic (see
commit 7d64173fb11c66284a408e52d41d15b7755d65d2), is there any reason not to
use the contents of the file, or the name of the file, or some other attribute
like the xattrs as a way to carry that "negative cache" information?

My backup software's log is hundreds of lines of:
Warning:
/home/hadess/.var/app/org.gnome.Totem.Devel/cache/debuginfod_client/d9ebf6de9e98f66a21daca59c8f601a9daa03c5b/debuginfo:
open: [Errno 13] Permission denied:
'/home/hadess/.var/app/org.gnome.Totem.Devel/cache/debuginfod_client/d9ebf6de9e98f66a21daca59c8f601a9daa03c5b/debuginfo'

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debuginfod/29022] 000-permissions files cause problems for backups
  2022-04-04  9:42 [Bug debuginfod/29022] New: 000-permissions files cause problems for backups bugzilla at hadess dot net
@ 2022-04-04 21:43 ` fche at redhat dot com
  2022-04-04 22:08 ` mark at klomp dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: fche at redhat dot com @ 2022-04-04 21:43 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29022

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
For what it's worth, these caches are all disposable, so you could exclude the
whole directory structure from backups or just delete it.

I'm not keen on a file-attribute solution, because it's less portable and it'd
still require SOME file to exist.  A 0-length file is not unambiguous (consider
empty source files).  A differently named file is a possibility.

(Pretty sure atomicity is an orthogonal consideration - TOCTOU is a possibility
with all the options.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debuginfod/29022] 000-permissions files cause problems for backups
  2022-04-04  9:42 [Bug debuginfod/29022] New: 000-permissions files cause problems for backups bugzilla at hadess dot net
  2022-04-04 21:43 ` [Bug debuginfod/29022] " fche at redhat dot com
@ 2022-04-04 22:08 ` mark at klomp dot org
  2022-04-05 14:36 ` fche at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mark at klomp dot org @ 2022-04-04 22:08 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29022

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
Theoretically you can have a totally empty source files, but they are pretty
useless and they won't even leave any debug (DWARF) data (except for an empty
line table and compiler options string), so since there is no DWARF reference
to the source file it won't even be requested by any debuginfod consumer.
executables and debug files are ELF so are never zero size.

So I think it might make some sense to investigate whether we can use the fact
that a file is zero size as negative cache indicator. It would also get rid of
the "root is special" case.

At least I cannot imagine we really want to ever return a zero sized file. But
I might not have big enough imagination. There is always some theoretically
possibility that there is a legitimate request for a zero sized file in the
future. But do we really need to worry about that? Does it prevent some future
extensions?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debuginfod/29022] 000-permissions files cause problems for backups
  2022-04-04  9:42 [Bug debuginfod/29022] New: 000-permissions files cause problems for backups bugzilla at hadess dot net
  2022-04-04 21:43 ` [Bug debuginfod/29022] " fche at redhat dot com
  2022-04-04 22:08 ` mark at klomp dot org
@ 2022-04-05 14:36 ` fche at redhat dot com
  2022-04-07 11:39 ` mark at klomp dot org
  2022-04-13 19:26 ` amerey at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: fche at redhat dot com @ 2022-04-05 14:36 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29022

--- Comment #3 from Frank Ch. Eigler <fche at redhat dot com> ---
I can't come up with a convincing example why 0-length files would be bad, just
general unease at the ambiguity.  I don't mind switching to it for now; at
worst, later on we may have to revise and then arrange to clean out caches
once.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debuginfod/29022] 000-permissions files cause problems for backups
  2022-04-04  9:42 [Bug debuginfod/29022] New: 000-permissions files cause problems for backups bugzilla at hadess dot net
                   ` (2 preceding siblings ...)
  2022-04-05 14:36 ` fche at redhat dot com
@ 2022-04-07 11:39 ` mark at klomp dot org
  2022-04-13 19:26 ` amerey at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: mark at klomp dot org @ 2022-04-07 11:39 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29022

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-04-07
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at sourceware dot org   |amerey at redhat dot com

--- Comment #4 from Mark Wielaard <mark at klomp dot org> ---
Aaron already wrote up a patch to use zero sized files as negative cache
instead of zero permission files:
https://sourceware.org/pipermail/elfutils-devel/2022q2/004861.html

The only question is how this works on upgrade with an old cache. But it might
just work out because the old negative cache files were also zero sized and the
unlink should just work despite any changes in permissions.

If someone could try it out and/or give it a formal review that would be great.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug debuginfod/29022] 000-permissions files cause problems for backups
  2022-04-04  9:42 [Bug debuginfod/29022] New: 000-permissions files cause problems for backups bugzilla at hadess dot net
                   ` (3 preceding siblings ...)
  2022-04-07 11:39 ` mark at klomp dot org
@ 2022-04-13 19:26 ` amerey at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: amerey at redhat dot com @ 2022-04-13 19:26 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29022

Aaron Merey <amerey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Aaron Merey <amerey at redhat dot com> ---
A fix has been pushed as:

commit 8b568fdea8e1baea3d68cc38dec587e4c9219276
Author: Aaron Merey <amerey@redhat.com>
Date:   Fri Apr 8 19:37:11 2022 -0400

    PR29022: 000-permissions files cause problems for backups

    000-permission files currently used for negative caching can cause
    permission problems for some backup software and disk usage checkers.
    Fix this by using empty files for negative caching instead.

    Also use each empty file's mtime to determine the time since
    last download attempt instead of the cache_miss_s file's mtime.

    https://sourceware.org/bugzilla/show_bug.cgi?id=29022

    Tested-by: Milian Wolff <mail@milianw.de>
    Signed-off-by: Aaron Merey <amerey@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-13 19:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04  9:42 [Bug debuginfod/29022] New: 000-permissions files cause problems for backups bugzilla at hadess dot net
2022-04-04 21:43 ` [Bug debuginfod/29022] " fche at redhat dot com
2022-04-04 22:08 ` mark at klomp dot org
2022-04-05 14:36 ` fche at redhat dot com
2022-04-07 11:39 ` mark at klomp dot org
2022-04-13 19:26 ` amerey at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).