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.

Reply via email to