Re: [PATCH v1 2/2] generic/513,675: check for security namespace support

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



(Resend due to previous email being rejected. Sorry)

Hi Darrick,

I find the problem when I run xfstests generic/513,675 on nfs

```
FSTYP         -- nfs
PLATFORM      -- Linux/x86_64 kvm103 5.14.0-71.el9.x86_64 #1 SMP
PREEMPT Tue Mar 8 17:49:53 EST 2022
MKFS_OPTIONS  -- localhost:/scratch_TMP
MOUNT_OPTIONS -- -o vers=4.2 -o context=system_u:object_r:root_t:s0
localhost:/scratch_TMP /scratch

generic/513     - output mismatch (see
/root/repo_xfstests/results//generic/513.out.bad)
    --- tests/generic/513.out   2022-03-09 05:26:45.450331405 -0500
    +++ /root/repo_xfstests/results//generic/513.out.bad
2022-03-17 09:34:17.190818281 -0400
    @@ -1,2 +1,18 @@
     QA output created by 513
    +Failed to set capabilities on file '/scratch/bar' (Operation not supported)
```

So nfs doesn't support capabilities, I think we should run a check and
not run the test on filesystems like nfs that don't support it.
I find the file capabilities are implemented by using "security
attribute namespace", and running "_require_attrs security" can do the
check.
After applying this patch, running generic/513, 675 on nfs will be like

```
FSTYP         -- nfs
PLATFORM      -- Linux/x86_64 kvm103 5.14.0-71.el9.x86_64 #1 SMP
PREEMPT Tue Mar 8 17:49:53 EST 2022
MKFS_OPTIONS  -- localhost:/scratch_TMP
MOUNT_OPTIONS -- -o vers=4.2 -o context=system_u:object_r:root_t:s0
localhost:/scratch_TMP /scratch

generic/513     [not run] attr namespace security not supported by
this filesystem type: nfs
generic/675     [not run] attr namespace security not supported by
this filesystem type: nfs
Ran: generic/513 generic/675
Not run: generic/513 generic/675
Passed all 2 tests
```

Thanks,
Boyang


On Thu, Mar 17, 2022 at 11:30 PM Darrick J. Wong <djwong@xxxxxxxxxx> wrote:
>
> On Thu, Mar 17, 2022 at 06:08:42PM +0800, bxue@xxxxxxxxxx wrote:
> > From: Boyang Xue <bxue@xxxxxxxxxx>
> >
>
> Er... what does this patch do, and why?
>
> --D
>
> > Signed-off-by: Boyang Xue <bxue@xxxxxxxxxx>
> > ---
> >  tests/generic/513 | 2 ++
> >  tests/generic/675 | 2 ++
> >  2 files changed, 4 insertions(+)
> >
> > diff --git a/tests/generic/513 b/tests/generic/513
> > index dc082787..6e897fa0 100755
> > --- a/tests/generic/513
> > +++ b/tests/generic/513
> > @@ -12,10 +12,12 @@ _begin_fstest auto quick clone
> >  # Import common functions.
> >  . ./common/filter
> >  . ./common/reflink
> > +. ./common/attr
> >
> >  # real QA test starts here
> >  _supported_fs generic
> >  _require_scratch_reflink
> > +_require_attrs security
> >  _require_command "$GETCAP_PROG" getcap
> >  _require_command "$SETCAP_PROG" setcap
> >
> > diff --git a/tests/generic/675 b/tests/generic/675
> > index 23b7e545..311860dc 100755
> > --- a/tests/generic/675
> > +++ b/tests/generic/675
> > @@ -12,12 +12,14 @@ _begin_fstest auto clone quick
> >  # Import common functions.
> >  . ./common/filter
> >  . ./common/reflink
> > +. ./common/attr
> >
> >  # real QA test starts here
> >
> >  # Modify as appropriate.
> >  _supported_fs generic
> >  _require_user
> > +_require_attrs security
> >  _require_command "$GETCAP_PROG" getcap
> >  _require_command "$SETCAP_PROG" setcap
> >  _require_scratch_reflink
> > --
> > 2.27.0
> >
>




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux