c5bde2388e
Currently, nothing protects zram table from concurrent access. For instance, ZRAM_UNCOMPRESSED bit can be cleared by zram_free_page() called from a concurrent write between the time ZRAM_UNCOMPRESSED has been set and the time it is tested to unmap KM_USER0 in zram_bvec_write(). This ultimately leads to kernel panic. Also, a read request can occurs when the page has been freed by a running write request and before it has been updated, leading to zero filled block being incorrectly read and "Read before write" error message. This patch replace the current mutex by a rw_semaphore. It extends the protection to zram table (currently, only compression buffers are protected) and read requests (currently, only write requests are protected). Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
||
---|---|---|
.. | ||
altera-stapl | ||
asus_oled | ||
ath6kl | ||
bcm | ||
brcm80211 | ||
comedi | ||
cptm1217 | ||
crystalhd | ||
cx25821 | ||
cxd2099 | ||
cxt1e1 | ||
dt3155v4l | ||
easycap | ||
echo | ||
et131x | ||
frontier | ||
ft1000 | ||
generic_serial | ||
gma500 | ||
go7007 | ||
hv | ||
iio | ||
intel_sst | ||
keucr | ||
line6 | ||
lirc | ||
mei | ||
msm | ||
nvec | ||
octeon | ||
olpc_dcon | ||
panel | ||
phison | ||
pohmelfs | ||
quatech_usb2 | ||
quickstart | ||
rtl8187se | ||
rtl8192e | ||
rtl8192u | ||
rtl8712 | ||
rts_pstor | ||
sbe-2t3e3 | ||
sep | ||
serqt_usb2 | ||
slicoss | ||
sm7xx | ||
solo6x10 | ||
speakup | ||
spectra | ||
ste_rmi4 | ||
tidspbridge | ||
tm6000 | ||
tty | ||
usbip | ||
vme | ||
vt6655 | ||
vt6656 | ||
westbridge | ||
winbond | ||
wlags49_h2 | ||
wlags49_h25 | ||
wlan-ng | ||
xgifb | ||
zcache | ||
zram | ||
Kconfig | ||
Makefile | ||
staging.c |