From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4005B3835C2F; Tue, 17 Aug 2021 10:25:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4005B3835C2F From: "fche at redhat dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: debuginfod X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fche at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 10:25:14 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28240 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 cli= ent, which represents upstream misses with short-lived permission-000 files in t= he 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 r= oot is treated as though it was a successful fetch of a 0-length file, and pois= ons 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 =3D=3D EACCES 749 && stat(target_cache_path, &st) =3D=3D 0 750 && (st.st_mode & 0777) =3D=3D 0) Probably the simplest fix is to ditch the "errno =3D=3D EACCESS" part of th= e test, and perform the stat every time. --=20 You are receiving this mail because: You are on the CC list for the bug.=