Re: [PATCH v2] Backport xfs security fix to 4.9 and 4.4 stable trees

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

 



On Wed, May 20, 2020 at 02:48:00PM +0530, Siddharth Chandrasekaran wrote:
> On Fri, May 15, 2020 at 09:28:38PM +0530, Siddharth Chandrasekaran wrote:
> > On Fri, May 15, 2020 at 05:22:30PM +0200, Greg KH wrote:
> > > On Fri, May 15, 2020 at 08:41:07PM +0530, Siddharth Chandrasekaran wrote:
> > > > Hello,
> > > >
> > > > Lack of proper validation that cached inodes are free during allocation can,
> > > > cause a crash in fs/xfs/xfs_icache.c (refer: CVE-2018-13093). To address this
> > > > issue, I'm backporting upstream commit [1] to 4.4 and 4.9 stable trees
> > > > (a backport of [1] to 4.14 already exists).
> > > >
> > > > Also, commit [1] references another commit [2] which added checks only to
> > > > xfs_iget_cache_miss(). In this patch, those checks have been moved into a
> > > > dedicated checker method and both xfs_iget_cache_miss() and
> > > > xfs_iget_cache_hit() are made to call that method. This code reorg in commit
> > > > [1], makes commit [2] redundant in the history of the 4.9 and 4.4 stable
> > > > trees. So commit [2] is not being backported.
> > > >
> > > > -- Sid
> > > >
> > > > [1]: afca6c5b2595 ("xfs: validate cached inodes are free when allocated")
> > > > [2]: ee457001ed6c ("xfs: catch inode allocation state mismatch corruption")
> > > >
> > > > change log:
> > > > v2:
> > > >  - Reword cover letter.
> > > >  - Fix accidental worong patch that got mailed.
> > > 
> > > As the XFS maintainers want to see xfstests pass with any changes made,
> > > have you done so for the 4.9 and 4.4 trees with this patch applied?
> > 
> > I haven't run them yet. I'll do so and get back with the results
> > shortly.
> > 
> Hi Greg,
> 
> I am having some issue setting up my xfstests testing environment. On a
> Ubuntu 20.04 LTS VM, I installed 4.9.223 kernel with this patch applied.
> Then cloned xfstests-dev repository from [1] and setup the test
> environment as explained in the top-level README file. After this, I did
> the following:
> 
>  - Added a new disk (/dev/sdb1) and created 2 partitions of (64 GB each).
>  - Formatted /dev/sdb1 to xfs and dropped a few kernel source tarballs
>    into to it.
>  - Copied local.config.example to local.config and modified it as:
> 	export TEST_DEV=/dev/sdb1
> 	export TEST_DIR=/mnt/t0
> 	export SCRATCH_DEV=/dev/sdb2
> 	export SCRATCH_MNT=/mnt/scratch
>  - Executed: sudo ./check -g all
> 
> When executing the tests, I observed multiple failures. In addition to
> test failures, the testing script just froze after executing some some
> test cases (more frequently test 269) when trying to perform a mount or

There are multiple "test 269"s.  generic/269? xfs/269?

> umount operation on either of the newly added partitions.
> 
> So I presumed the patch was buggy and reverted the change to re try the
> test. Interestingly, that too failed and produced similar results. dmesg
> is filled with xfs errors, with the most frequent being:
> 
>   XFS (dm-0): metadata I/O error: block 0x3 ("xfs_trans_read_buf_map") error 5 numblks 1
> 
> obviously, I must be doing something wrong; I can try to dig deeper
> figure it out myself but wanted to check with you first, if you can spot
> something obviously wrong in what I'm doing.

Dirty open secret of fstests: it's all A/B testing, where "A" involves
running fstests until you've established a baseline of which tests
actually pass on the base of your (4.4 and 4.9) kernels, and which tests
to exclude (e.g. "test 269") because they crash the kernel.

(Please do ask the xfs list about the ones that crash the kernel.)

You might also run the crashing tests on a recent linus release on the
off chance that the test is one of the ones that have been slowly fixed
over the intervening years but are too unwieldly/infrequently-hit of a
patchset to have been auto-backported to stable.

(The shutdown tests like xfs/057, generic/388, and generic/475 come to
mind here.)

Sorry for the slow response, I'm rather overwhelmed these days...

--D

> Thanks!
> 
> -- Sid.
> 
> [1]: https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux