Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cause: Race condition and kernel bug around epoll_wait()
Consequence: gssproxy can hang, causing, e.g., NFS to block and fail.
Fix: Fix user-space portion of race and add epoll timeouts.
Result: Problem should be fixed, and any future similar problems will cause timeouts rather than hangs.
DescriptionDave Wysochanski
2019-03-12 15:12:18 UTC
Created attachment 1543238[details]
sample test program that shows thread1 calling epoll_wait with valid epoll_fd then thread2 calling close(epoll_fd) - thread1 will never wake up
Description of problem:
There is a possible race condition inside gssproxy where one thread may call into epoll_wait(gpmctx->epollfd, ...) and while inside, a second thread may call close on (gpmctx->epollfd). The thread inside epoll_wait is not woken up despite the second thread's close() operation but may hang inside epoll_wait().
We discovered this issue when studying a possible kernel bug where processes could hang indefinitely waiting for rpc.gssd upcall:
https://bugzilla.redhat.com/show_bug.cgi?id=1511706#c41
gpm_make_call() may release the mutex too early and as a result a thread race may be possible.
int gpm_make_call(int proc, union gp_rpc_arg *arg, union gp_rpc_res *res)
...
/* grab the lock for the whole conversation */
ret = gpm_grab_sock(gpmctx);
...
/* Send request, receive response with timeout */
ret = gpm_send_recv_loop(gpmctx, send_buffer, send_length, &recv_buffer,
&recv_length);
/* release the lock */
gpm_release_sock(gpmctx);
sockgrab = false; // at this point some other thread could grab the lock and race with this one
...
done:
gpm_timer_close(gpmctx); // sets timerfd = -1 as seen in corefile
gpm_epoll_close(gpmctx); // sets epollfd = -1 as seen in corefile
...
Version-Release number of selected component (if applicable):
gssproxy-0.7.0-21.el7
How reproducible:
TBD - should be reproducible with delay inserted in gssproxy code
Steps to Reproduce:
See attached program which demonstrates the possibility of a hang inside epoll_wait()
Actual results:
gssproxy thread may hang inside epoll_wait() indefinitely
Expected results:
no indefinite hang inside epoll_wait() in gssproxy
Additional info:
Since this problem is so well defined and has a patch under testing, it makes sense to file this as a specific bug.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2019:2050