Skip to content
Commit 6a8dadcc authored by Todd Poynor's avatar Todd Poynor Committed by Martin K. Petersen
Browse files

scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE



Take f_mutex around mmap() processing to protect against races with the
SG_SET_RESERVED_SIZE ioctl.  Ensure the reserve buffer length remains
consistent during the mapping operation, and set the "mmap called" flag
to prevent further changes to the reserved buffer size as an atomic
operation with the mapping.

[mkp: fixed whitespace]

Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Acked-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8d26f491
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment