Bug 449809 - gnbd race between sender and receiver process
gnbd race between sender and receiver process
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gnbd-kmod (Show other bugs)
5.2
All Linux
high Severity high
: rc
: ---
Assigned To: Ben Marzinski
Cluster QE
:
Depends On:
Blocks: 391501
  Show dependency treegraph
 
Reported: 2008-06-03 14:18 EDT by Ben Marzinski
Modified: 2010-10-22 21:40 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 16:08:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to wait before ending the request, if it is currently being sent. (3.74 KB, patch)
2008-06-03 14:25 EDT, Ben Marzinski
no flags Details | Diff

  None (edit)
Description Ben Marzinski 2008-06-03 14:18:44 EDT
Description of problem:
It is possible to have the gnbd receiver process finish and end a request before
the sending process has finished using the request structure.  This can cause a
kernel panic.

Version-Release number of selected component (if applicable):
gnbd-kmod-0.1.4-12.el5

How reproducible:
Not sure.  It is possible that a customer has seen this.

Additional info:
This bug was originally mentioned in comment #14 of BZ #444074, but is possibly
unrelated to issue that bugzilla was opened to track.

The race can happen under the following conditions:
1. the request gets sent
2. reply comes in, the the receiver process frees up the request
3. now the sender process wakes up and tries to the kunmap, but because
the request block has already been freed-up, kunmap will crash.
Comment 1 Ben Marzinski 2008-06-03 14:25:10 EDT
Created attachment 308274 [details]
patch to wait before ending the request, if it is currently being sent.

This patch adds a waitqueue (tx_wait) and a pointer to the request currently
being send (current_request) to the gnbd device structure.  current_request is
set before any request is sent to the server. When the send is complete, it is
cleared and the wait_queue is woken.  A new function, wait_for_send() is called
whenever it is possible for a call to gnbd_end_request() to interleave with a
send. It waits on the waitqueue if the request about to be ended is currently
being sent.
Comment 2 RHEL Product and Program Management 2008-06-05 15:54:51 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 8 errata-xmlrpc 2009-01-20 16:08:22 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0215.html

Note You need to log in before you can comment on or make changes to this bug.