Re: [PATCH] Prevent mmap command to map beyond EOF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 06, 2021 at 06:54:07PM +0200, Carlos Maiolino wrote:
> > > My biggest motivation was actually seeing xfs_io crashing due a sigbus
> > > while running generic/172 and generic/173. And personally, I'd rather see an
> > > error message like "attempt to mmap/mwrite beyond EOF" than seeing it crash.
> > > Also, as you mentioned, programs are allowed to set up such kind of
> > > configuration (IIUC what you mean, mixing mmap, extend, truncate, etc), so, I
> > > believe such userspace programs should also ensure they are not attempting to
> > > write to invalid memory.
> > 
> > This patch would /also/ prevent us from writing an fstest to check that
> > a process /does/ get SIGBUS when writing to a mapping beyond EOF.  Huh,
> > we don't have a test for that...

After looking closer into g/173, I see what you mean now.
> 
> The whole command that ends up receiving a SIGBUS is:
> 
> xfs_io -i -f -c 'mmap -rw 0 41943040' -c 'mwrite -S 0x62 0 41943040'

And...

> At a later point, I just did some tests using an empty, 0
> sized file.

And playing around with a 0 sized file without coming back to look closer into
g/173 was what had been blinding me.
Please just disregard this patch and my apologies for the noise.

-- 
Carlos




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux