Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Issue 6694028: CHROMIUM: qcusbnet: fix devqmi_close() races. (Closed)

Created:
9 years, 9 months ago by Elly Fong-Jones
Modified:
9 years, 3 months ago
CC:
chromium-os-reviews_chromium.org, vb+kernel_google.com, Olof Johansson, sleffler+cc_chromium.org, msb+croskernel_chromium.org
Visibility:
Public.

Description

CHROMIUM: qcusbnet: fix devqmi_close() races. Originally, devqmi_close() was attached to the flush hook (instead of the release hook), meaning it would be called whenever a userspace task called close() (instead of just when the last ref to the file was dropped), which necessitated the task-list-walking song and dance. Instead, add a new ioctl which userspace can use to tear down the QMI connection and remove the refcount check stuff. This fixes a whole raft of nasty races in devqmi_close(). Note that it is not required that userspace use the ioctl; if it doesn't (because, for example, it crashes), we'll still clean up any dangling QMI contexts at release time. BUG=chromium-os:10360 TEST=Adhoc Reproducing the bug this fixes (see 10360) is almost impossible. :( Change-Id: Ic64f64d89757f2ad95d2df9e8da04ddda3209bda Signed-off-by: Elly Jones <ellyjones@chromium.org>; Signed-off-by: Jason Glasgow <jglasgow@chromium.org>; Signed-off-by: Mandeep Singh Baines <msb@chromium.org>; Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=4b00239

Patch Set 1 #

Patch Set 2 : Update comment to reflect reality. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -73 lines) Patch
M drivers/net/usb/gobi/qmidevice.c View 1 8 chunks +41 lines, -73 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
Elly Fong-Jones
9 years, 9 months ago (2011-03-15 16:40:44 UTC) #1
Jason Glasgow
LGTM after discussion, but requires kernel expert review too.
9 years, 9 months ago (2011-03-15 17:20:06 UTC) #2
Mandeep Singh Baines
Nice cleanup. A few questions about the ioctl. http://codereview.chromium.org/6694028/diff/3001/drivers/net/usb/gobi/qmidevice.c File drivers/net/usb/gobi/qmidevice.c (right): http://codereview.chromium.org/6694028/diff/3001/drivers/net/usb/gobi/qmidevice.c#newcode1022 drivers/net/usb/gobi/qmidevice.c:1022: */ ...
9 years, 9 months ago (2011-03-15 20:56:31 UTC) #3
Mandeep Singh Baines
9 years, 9 months ago (2011-03-15 21:47:44 UTC) #4
Discussed over chat.

LGTM

Powered by Google App Engine
This is Rietveld 408576698