From: "fche at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug debuginfod/28240] New: debuginfod client cache falsely sticky for root user
Date: Tue, 17 Aug 2021 10:25:13 +0000 [thread overview]
Message-ID: <bug-28240-10460@http.sourceware.org/bugzilla/> (raw)
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.
next reply other threads:[~2021-08-17 10:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-17 10:25 fche at redhat dot com [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-28240-10460@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=elfutils-devel@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).