public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug debuginfod/28240] New: debuginfod client cache falsely sticky for root user
@ 2021-08-17 10:25 fche at redhat dot com
  2021-10-22 16:59 ` [Bug debuginfod/28240] " fche at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: fche at redhat dot com @ 2021-08-17 10:25 UTC (permalink / raw)
  To: elfutils-devel

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

            Bug ID: 28240
           Summary: debuginfod client cache falsely sticky for root user
           Product: elfutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: debuginfod
          Assignee: unassigned at sourceware dot org
          Reporter: fche at redhat dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

bug #25628 introduced a negative-hit caching facility in the debuginfod client,
which represents upstream misses with short-lived permission-000 files in the
cache.  These files are used to shortcut repeated queries that are expected to
fail, for a limited time.

The logic works for normal users, but breaks for root users.  The problem is
that the way the client recognizes a 000 negative-hit file in the cache, vs. a
good file, is by looking for -EACCES upon opening the file.  Unfortunately,
root users never get -EACCES, even for perm-000 files.  So a 000 file for root
is treated as though it was a successful fetch of a 0-length file, and poisons
the cache indefinitely.

    745   struct stat st;
    746   time_t cache_miss;
    747   /* Check if the file exists and it's of permission 000*/
    748   if (errno == EACCES
    749       && stat(target_cache_path, &st) == 0
    750       && (st.st_mode & 0777) == 0)

Probably the simplest fix is to ditch the "errno == EACCESS" part of the test,
and perform the stat every time.

-- 
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:[~2023-10-16 15:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 10:25 [Bug debuginfod/28240] New: debuginfod client cache falsely sticky for root user fche at redhat dot com
2021-10-22 16:59 ` [Bug debuginfod/28240] " fche at redhat dot com
2021-10-25 12:35 ` mark at klomp dot org
2022-04-24 18:48 ` mark at klomp dot org
2023-10-09 16:14 ` mark at klomp dot org
2023-10-16 15:11 ` mark at klomp dot org

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).