Re: [PATCH] sg: protect against races between mmap() and SG_SET_RESERVED_SIZE

From: Martin K. Petersen
Date: Tue Aug 22 2017 - 22:21:24 EST



Todd,

> 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.

Applied to 4.14/scsi-queue (with a slight whitespace fix). Thanks!

--
Martin K. Petersen Oracle Linux Engineering