* [PATCH] ovl: support the FS_IOC_FS[SG]ETXATTR ioctls
@ 2019-05-26 6:28 Amir Goldstein
2019-05-27 8:04 ` Miklos Szeredi
0 siblings, 1 reply; 2+ messages in thread
From: Amir Goldstein @ 2019-05-26 6:28 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: Dave Chinner, linux-unionfs, linux-xfs
They are the extended version of FS_IOC_FS[SG]ETFLAGS ioctls.
xfs_io -c "chattr <flags>" uses the new ioctls for setting flags.
This used to work in kernel pre v4.19, before stacked file ops
introduced the ovl_ioctl whitelist.
Reported-by: Dave Chinner <david@fromorbit.com>
Fixes: d1d04ef8572b ("ovl: stack file ops")
Cc: <stable@vger.kernel.org> # v4.19
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
fs/overlayfs/file.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
index 540a8b845145..340a6ad45914 100644
--- a/fs/overlayfs/file.c
+++ b/fs/overlayfs/file.c
@@ -426,7 +426,8 @@ static unsigned int ovl_get_inode_flags(struct inode *inode)
return ovl_iflags;
}
-static long ovl_ioctl_set_flags(struct file *file, unsigned long arg)
+static long ovl_ioctl_set_flags(struct file *file, unsigned int cmd,
+ unsigned long arg)
{
long ret;
struct inode *inode = file_inode(file);
@@ -456,7 +457,7 @@ static long ovl_ioctl_set_flags(struct file *file, unsigned long arg)
if (ret)
goto unlock;
- ret = ovl_real_ioctl(file, FS_IOC_SETFLAGS, arg);
+ ret = ovl_real_ioctl(file, cmd, arg);
ovl_copyflags(ovl_inode_real(inode), inode);
unlock:
@@ -474,11 +475,13 @@ static long ovl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
switch (cmd) {
case FS_IOC_GETFLAGS:
+ case FS_IOC_FSGETXATTR:
ret = ovl_real_ioctl(file, cmd, arg);
break;
case FS_IOC_SETFLAGS:
- ret = ovl_ioctl_set_flags(file, arg);
+ case FS_IOC_FSSETXATTR:
+ ret = ovl_ioctl_set_flags(file, cmd, arg);
break;
default:
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ovl: support the FS_IOC_FS[SG]ETXATTR ioctls
2019-05-26 6:28 [PATCH] ovl: support the FS_IOC_FS[SG]ETXATTR ioctls Amir Goldstein
@ 2019-05-27 8:04 ` Miklos Szeredi
0 siblings, 0 replies; 2+ messages in thread
From: Miklos Szeredi @ 2019-05-27 8:04 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Dave Chinner, overlayfs, linux-xfs
On Sun, May 26, 2019 at 8:28 AM Amir Goldstein <amir73il@gmail.com> wrote:
>
> They are the extended version of FS_IOC_FS[SG]ETFLAGS ioctls.
> xfs_io -c "chattr <flags>" uses the new ioctls for setting flags.
>
> This used to work in kernel pre v4.19, before stacked file ops
> introduced the ovl_ioctl whitelist.
>
> Reported-by: Dave Chinner <david@fromorbit.com>
> Fixes: d1d04ef8572b ("ovl: stack file ops")
> Cc: <stable@vger.kernel.org> # v4.19
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Thanks, applied.
Miklos
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-27 8:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-26 6:28 [PATCH] ovl: support the FS_IOC_FS[SG]ETXATTR ioctls Amir Goldstein
2019-05-27 8:04 ` Miklos Szeredi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox