From: Ben Hutchings Date: Sun, 12 Feb 2012 06:00:41 +0000 (+0000) Subject: cdc-wdm: Fix more races on the read path X-Git-Tag: v3.4-rc1~184^2~22^2~108 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=711c68b3c0f7a924ffbee4aa962d8f62b85188ff;p=pandora-kernel.git cdc-wdm: Fix more races on the read path We must not allow the input buffer length to change while we're shuffling the buffer contents. We also mustn't clear the WDM_READ flag after more data might have arrived. Therefore move both of these into the spinlocked region at the bottom of wdm_read(). When reading desc->length without holding the iuspin lock, use ACCESS_ONCE() to ensure the compiler doesn't re-read it with inconsistent results. Signed-off-by: Ben Hutchings Tested-by: Bjørn Mork Cc: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed