* Re: [PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET
From: Willem de Bruijn @ 2019-06-20 13:41 UTC (permalink / raw)
To: Neil Horman; +Cc: Network Development, Matteo Croce, David S. Miller
In-Reply-To: <20190619202533.4856-1-nhorman@tuxdriver.com>
On Wed, Jun 19, 2019 at 4:26 PM Neil Horman <nhorman@tuxdriver.com> wrote:
>
> When an application is run that:
> a) Sets its scheduler to be SCHED_FIFO
> and
> b) Opens a memory mapped AF_PACKET socket, and sends frames with the
> MSG_DONTWAIT flag cleared, its possible for the application to hang
> forever in the kernel. This occurs because when waiting, the code in
> tpacket_snd calls schedule, which under normal circumstances allows
> other tasks to run, including ksoftirqd, which in some cases is
> responsible for freeing the transmitted skb (which in AF_PACKET calls a
> destructor that flips the status bit of the transmitted frame back to
> available, allowing the transmitting task to complete).
>
> However, when the calling application is SCHED_FIFO, its priority is
> such that the schedule call immediately places the task back on the cpu,
> preventing ksoftirqd from freeing the skb, which in turn prevents the
> transmitting task from detecting that the transmission is complete.
>
> We can fix this by converting the schedule call to a completion
> mechanism. By using a completion queue, we force the calling task, when
> it detects there are no more frames to send, to schedule itself off the
> cpu until such time as the last transmitted skb is freed, allowing
> forward progress to be made.
>
> Tested by myself and the reporter, with good results
>
> Appies to the net tree
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Matteo Croce <mcroce@redhat.com>
> CC: "David S. Miller" <davem@davemloft.net>
> ---
This is a complex change for a narrow configuration. Isn't a
SCHED_FIFO process preempting ksoftirqd a potential problem for other
networking workloads as well? And the right configuration to always
increase ksoftirqd priority when increasing another process's
priority? Also, even when ksoftirqd kicks in, isn't some progress
still made on the local_bh_enable reached from schedule()?
^ permalink raw reply
* Re: [PATCH v2 05/17] soc: qcom: ipa: clocking, interrupts, and memory
From: Hillf Danton @ 2019-06-20 13:41 UTC (permalink / raw)
To: Alex Elder
Cc: devicetree, syadagir, ejcaruso, arnd, netdev, ilias.apalodimas,
linux-kernel, evgreen, bjorn.andersson, abhishek.esse,
linux-arm-kernel, linux-arm-msm, subashab, linux-soc, davem,
cpratapa, benchan
In-Reply-To: <20190531035348.7194-1-elder@linaro.org>
Hello
On Thu, 30 May 2019 20:54:01 -0700 (PDT) Alex Elder wrote:
> +
> +void ipa_interrupt_teardown(struct ipa_interrupt *interrupt)
> +{
> + free_irq(interrupt->irq, interrupt);
Looks like that there is something missed.
kfree(interrupt);
> +}
Hillf
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [v7 00/16] Add Plane Color Properties
From: Shankar, Uma @ 2019-06-20 13:42 UTC (permalink / raw)
To: Ville Syrjälä, Ezequiel Garcia
Cc: Syrjala, Ville, intel-gfx@lists.freedesktop.org, dri-devel,
Andrzej Pietrasiewicz, Sean Paul, Ezequiel Garcia,
Lankhorst, Maarten
In-Reply-To: <20190619162940.GB5942@intel.com>
>-----Original Message-----
>From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of Ville
>Syrjälä
>Sent: Wednesday, June 19, 2019 10:00 PM
>To: Ezequiel Garcia <ezequiel@collabora.com>
>Cc: Syrjala, Ville <ville.syrjala@intel.com>; intel-gfx@lists.freedesktop.org; Emil
>Velikov <emil.l.velikov@gmail.com>; dri-devel <dri-devel@lists.freedesktop.org>;
>Andrzej Pietrasiewicz <andrzej.p@collabora.com>; Shankar, Uma
><uma.shankar@intel.com>; Sean Paul <seanpaul@chromium.org>; Ezequiel Garcia
><ezequiel@vanguardiasur.com.ar>; Boris Brezillon <boris.brezillon@collabora.com>;
>Lankhorst, Maarten <maarten.lankhorst@intel.com>
>Subject: Re: [v7 00/16] Add Plane Color Properties
>
>On Wed, Jun 19, 2019 at 12:33:33PM -0300, Ezequiel Garcia wrote:
>> On Wed, 2019-06-19 at 18:03 +0300, Ville Syrjälä wrote:
>> > On Wed, Jun 19, 2019 at 10:18:18AM -0300, Ezequiel Garcia wrote:
>> > > On Wed, 2019-06-19 at 06:20 +0000, Shankar, Uma wrote:
>> > > > > -----Original Message-----
>> > > > > From: dri-devel
>> > > > > [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
>> > > > > Ezequiel Garcia
>> > > > > Sent: Friday, June 14, 2019 9:48 PM
>> > > > > To: Shankar, Uma <uma.shankar@intel.com>
>> > > > > Cc: Emil Velikov <emil.l.velikov@gmail.com>;
>> > > > > intel-gfx@lists.freedesktop.org; Syrjala, Ville
>> > > > > <ville.syrjala@intel.com>; Lankhorst, Maarten
>> > > > > <maarten.lankhorst@intel.com>; dri-devel
>> > > > > <dri-devel@lists.freedesktop.org>
>> > > > > Subject: Re: [v7 00/16] Add Plane Color Properties
>> > > > >
>> > > > > On Thu, 28 Mar 2019 at 16:50, Uma Shankar <uma.shankar@intel.com>
>wrote:
>> > > > > > This is how a typical display color hardware pipeline looks like:
>> > > > > > +-------------------------------------------+
>> > > > > > | RAM |
>> > > > > > | +------+ +---------+ +---------+ |
>> > > > > > | | FB 1 | | FB 2 | | FB N | |
>> > > > > > | +------+ +---------+ +---------+ |
>> > > > > > +-------------------------------------------+
>> > > > > > | Plane Color Hardware Block |
>> > > > > > +--------------------------------------------+
>> > > > > > | +---v-----+ +---v-------+ +---v------+ |
>> > > > > > | | Plane A | | Plane B | | Plane N | |
>> > > > > > | | DeGamma | | Degamma | | Degamma | |
>> > > > > > | +---+-----+ +---+-------+ +---+------+ |
>> > > > > > | | | | |
>> > > > > > | +---v-----+ +---v-------+ +---v------+ |
>> > > > > > | |Plane A | | Plane B | | Plane N | |
>> > > > > > | |CSC/CTM | | CSC/CTM | | CSC/CTM | |
>> > > > > > | +---+-----+ +----+------+ +----+-----+ |
>> > > > > > | | | | |
>> > > > > > | +---v-----+ +----v------+ +----v-----+ |
>> > > > > > | | Plane A | | Plane B | | Plane N | |
>> > > > > > | | Gamma | | Gamma | | Gamma | |
>> > > > > > | +---+-----+ +----+------+ +----+-----+ |
>> > > > > > | | | | |
>> > > > > > +--------------------------------------------+
>> > > > > > +------v--------------v---------------v-------|
>> > > > > > > > ||
>> > > > > > > > Pipe Blender ||
>> > > > > > +--------------------+------------------------+
>> > > > > > > | |
>> > > > > > > +-----------v----------+ |
>> > > > > > > | Pipe DeGamma | |
>> > > > > > > | | |
>> > > > > > > +-----------+----------+ |
>> > > > > > > | Pipe Color |
>> > > > > > > +-----------v----------+ Hardware |
>> > > > > > > | Pipe CSC/CTM | |
>> > > > > > > | | |
>> > > > > > > +-----------+----------+ |
>> > > > > > > | |
>> > > > > > > +-----------v----------+ |
>> > > > > > > | Pipe Gamma | |
>> > > > > > > | | |
>> > > > > > > +-----------+----------+ |
>> > > > > > > | |
>> > > > > > +---------------------------------------------+
>> > > > > > |
>> > > > > > v
>> > > > > > Pipe Output
>> > > > > >
>> > > > > > This patch series adds properties for plane color features.
>> > > > > > It adds properties for degamma used to linearize data, CSC
>> > > > > > used for gamut conversion, and gamma used to again
>> > > > > > non-linearize data as per panel supported color space. These
>> > > > > > can be utilize by user space to convert planes from one format to another,
>one color space to another etc.
>> > > > > >
>> > > > > > Usersapce can take smart blending decisions and utilize
>> > > > > > these hardware supported plane color features to get
>> > > > > > accurate color profile. The same can help in consistent
>> > > > > > color quality from source to panel taking advantage of advanced color
>features in hardware.
>> > > > > >
>> > > > > > These patches just add the property interfaces and enable
>> > > > > > helper functions.
>> > > > > >
>> > > > > > This series adds Intel Gen9 specific plane gamma feature. We
>> > > > > > can build up and add other platform/hardware specific
>> > > > > > implementation on top of this series
>> > > > > >
>> > > > > > Note: This is just to get a design feedback whether these
>> > > > > > interfaces look ok. Based on community feedback on
>> > > > > > interfaces, we will implement IGT tests to validate plane color features.
>This is un-tested currently.
>> > > > > >
>> > > > > > Userspace implementation using these properties have been
>> > > > > > done in drm hwcomposer by "Alexandru-Cosmin Gheorghe
>> > > > > > Alexandru-
>> > > > > Cosmin.Gheorghe@arm.com"
>> > > > > > from ARM. A merge request has been opened by Alexandru for
>> > > > > > drm_hwcomposer, implementing the property changes for the
>> > > > > > same. Please review
>> > > > > that as well:
>> > > > > > https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer
>> > > > > > /merge_req
>> > > > > > uests/25
>> > > > > >
>> > > > > > v2: Dropped legacy gamma table for plane as suggested by Maarten.
>> > > > > > Added Gen9/BDW plane gamma feature and rebase on tot.
>> > > > > >
>> > > > > > v3: Added a new drm_color_lut_ext structure to accommodate
>> > > > > > 32 bit precision entries, pointed to by Brian, Starkey for HDR usecases.
>> > > > > > Addressed Sean,Paul comments and moved plane color
>> > > > > > properties to drm_plane instead of mode_config. Added
>> > > > > > property documentation as suggested by
>> > > > > Daniel, Vetter.
>> > > > > > Fixed a rebase fumble which occurred in v2, pointed by Emil Velikov.
>> > > > > >
>> > > > > > v4: Rebase
>> > > > > >
>> > > > > > v5: Added "Display Color Hardware Pipeline" flow to kernel
>> > > > > > documentation as suggested by "Ville Syrjala" and "Brian Starkey".
>> > > > > > Moved the property creation to drm_color_mgmt.c file to
>> > > > > > consolidate all color operations at one place. Addressed Alexandru's
>review comments.
>> > > > > >
>> > > > > > v6: Rebase. Added support for ICL Color features. Enhanced
>> > > > > > Lut precision to accept input values in u32.32 format. This
>> > > > > > is needed for higher precision required in HDR data processing.
>> > > > > >
>> > > > > > v7: Fixed Lut roundup and extraction function in patch 1 and
>> > > > > > address definitions for Degamma index in patch 10. Rest of
>> > > > > > the patches are just rebased.
>> > > > > >
>> > > > >
>> > > > > I can't find any comments on this one.
>> > > > >
>> > > > > What's the status of this?
>> > > >
>> > > > Hi Eze,
>> > > > This was blocked due to lack of a userspace consumer. Since its
>> > > > adds a new UAPI, we need a userspace consumer using this for it to get merge.
>We have some folks signed up in Intel who can help here.
>> > > > Hopefully we can see some movement on this soon.
>> > > >
>> > >
>> > > Hi Uma,
>> > >
>> > > Thanks a lot for your reply.
>> > >
>> > > We do have a userspace consumer in chromeos [1]. This is being
>> > > shipped since some time now, and I have been (perhaps too
>> > > silently) waiting for this series to be merged.
>> >
>> > I don't think the proposed uapi will be good enough and instead we
>> > need something like the gamma_mode prop for planes as well. Eg. even
>> > bunch of Intel platforms have plane gamma where the input points are
>> > not evenly spaced, so we again have the problem of either lying to
>> > userspace and throwing away a bunch of the user provided LUT
>> > entries, or we add the gamma_mode prop that actually describes the
>> > LUT capabilities.
>> >
>> > Another idea that was thrown around was supporting hardware that
>> > supports only hardcoded gamma curves. We need to describe those
>> > somehow and let userspace select the right one.
>> >
>>
>> Is the uapi "not good enough" or "incorrect"? For the chromeos usage,
>> it seems this PLANE_CTM property is enough, so it's not clear to me
>> exactly what we should fix or change.
>
>The ctm is probably OK. Should be the same as what we have for the crtc I think. The
>degamma/gamma probably need more work.
Hi Ville,
Ok, I will try to add gamma mode programming as well so that we can control that from userspace.
Will send out an RFC version for review soon.
Regards,
Uma Shankar
>--
>Ville Syrjälä
>Intel
>_______________________________________________
>dri-devel mailing list
>dri-devel@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH v2 05/17] soc: qcom: ipa: clocking, interrupts, and memory
From: Hillf Danton @ 2019-06-20 13:41 UTC (permalink / raw)
To: Alex Elder
Cc: devicetree, syadagir, ejcaruso, arnd, netdev, ilias.apalodimas,
linux-kernel, evgreen, bjorn.andersson, abhishek.esse,
linux-arm-kernel, linux-arm-msm, subashab, linux-soc, davem,
cpratapa, benchan
In-Reply-To: <20190531035348.7194-1-elder@linaro.org>
Hello
On Thu, 30 May 2019 20:54:01 -0700 (PDT) Alex Elder wrote:
> +
> +void ipa_interrupt_teardown(struct ipa_interrupt *interrupt)
> +{
> + free_irq(interrupt->irq, interrupt);
Looks like that there is something missed.
kfree(interrupt);
> +}
Hillf
^ permalink raw reply
* Re: ✗ Fi.CI.BAT: failure for drm/i915: CTS fixes (rev2)
From: Chris Wilson @ 2019-06-20 13:41 UTC (permalink / raw)
To: Lionel Landwerlin, Patchwork; +Cc: intel-gfx
In-Reply-To: <20190620133527.12829.31886@emeril.freedesktop.org>
Quoting Patchwork (2019-06-20 14:35:27)
> == Series Details ==
>
> Series: drm/i915: CTS fixes (rev2)
> URL : https://patchwork.freedesktop.org/series/62437/
> State : failure
>
> == Summary ==
>
> CI Bug Log - changes from CI_DRM_6312 -> Patchwork_13362
> ====================================================
>
> Summary
> -------
>
> **FAILURE**
They all complain about:
<3> [403.297791] rcs0: Unable to write to whitelisted register 2348
[PS_INVOCATION_COUNT]
Is the complaint valid?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [f2fs-dev] [PATCH 3/4] fs: teach vfs_ioc_fssetxattr_check to check project id info
From: Jan Kara @ 2019-06-20 13:41 UTC (permalink / raw)
To: Darrick J. Wong
Cc: shaggy, jfs-discussion, linux-efi, linux-btrfs, clm,
adilger.kernel, matthew.garrett, linux-nilfs, cluster-devel,
linux-ext4, josef, reiserfs-devel, viro, dsterba, jaegeuk, tytso,
ard.biesheuvel, linux-kernel, linux-f2fs-devel, linux-xfs, jk,
jack, linux-fsdevel, linux-mtd, ocfs2-devel
In-Reply-To: <156022835712.3227089.13380623784109583024.stgit@magnolia>
On Mon 10-06-19 21:45:57, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Standardize the project id checks for FSSETXATTR.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/ioctl.c | 27 ---------------------------
> fs/f2fs/file.c | 27 ---------------------------
> fs/inode.c | 13 +++++++++++++
> fs/xfs/xfs_ioctl.c | 15 ---------------
> 4 files changed, 13 insertions(+), 69 deletions(-)
>
>
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index c2f48c90ca45..6aa1df1918f7 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -697,30 +697,6 @@ static long ext4_ioctl_group_add(struct file *file,
> return err;
> }
>
> -static int ext4_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(EXT4_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (ext4_test_inode_flag(inode, EXT4_INODE_PROJINHERIT)) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static void ext4_fsgetxattr(struct inode *inode, struct fsxattr *fa)
> {
> struct ext4_inode_info *ei = EXT4_I(inode);
> @@ -1135,9 +1111,6 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>
> inode_lock(inode);
> ext4_fsgetxattr(inode, &old_fa);
> - err = ext4_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index f707de6bd4a8..183ed1ac60e1 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2799,30 +2799,6 @@ static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> return 0;
> }
>
> -static int f2fs_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(F2FS_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (F2FS_I(inode)->i_flags & F2FS_PROJINHERIT_FL) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> @@ -2850,9 +2826,6 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> return err;
>
> inode_lock(inode);
> - err = f2fs_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
>
> __f2fs_ioc_fsgetxattr(inode, &old_fa);
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> diff --git a/fs/inode.c b/fs/inode.c
> index 026955258a47..40ecd3a6a188 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2201,6 +2201,19 @@ int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> !capable(CAP_LINUX_IMMUTABLE))
> return -EPERM;
>
> + /*
> + * Project Quota ID state is only allowed to change from within the init
> + * namespace. Enforce that restriction only if we are trying to change
> + * the quota ID state. Everything else is allowed in user namespaces.
> + */
> + if (current_user_ns() != &init_user_ns) {
> + if (old_fa->fsx_projid != fa->fsx_projid)
> + return -EINVAL;
> + if ((old_fa->fsx_xflags ^ fa->fsx_xflags) &
> + FS_XFLAG_PROJINHERIT)
> + return -EINVAL;
> + }
> +
> return 0;
> }
> EXPORT_SYMBOL(vfs_ioc_fssetxattr_check);
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 08c24f2f55c3..82961de98900 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -1299,21 +1299,6 @@ xfs_ioctl_setattr_check_projid(
> if (fa->fsx_projid > (uint16_t)-1 &&
> !xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb))
> return -EINVAL;
> -
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (xfs_get_projid(ip) != fa->fsx_projid)
> - return -EINVAL;
> - if ((fa->fsx_xflags & FS_XFLAG_PROJINHERIT) !=
> - (ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT))
> - return -EINVAL;
> -
> return 0;
> }
>
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply
* Re: [PATCH 3/4] fs: teach vfs_ioc_fssetxattr_check to check project id info
From: Jan Kara @ 2019-06-20 13:41 UTC (permalink / raw)
To: Darrick J. Wong
Cc: matthew.garrett, yuchao0, tytso, shaggy, ard.biesheuvel, josef,
clm, adilger.kernel, jk, jack, dsterba, jaegeuk, viro,
cluster-devel, jfs-discussion, linux-efi, reiserfs-devel,
linux-kernel, linux-f2fs-devel, linux-xfs, linux-nilfs, linux-mtd,
ocfs2-devel, linux-fsdevel, linux-ext4, linux-btrfs
In-Reply-To: <156022835712.3227089.13380623784109583024.stgit@magnolia>
On Mon 10-06-19 21:45:57, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Standardize the project id checks for FSSETXATTR.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/ioctl.c | 27 ---------------------------
> fs/f2fs/file.c | 27 ---------------------------
> fs/inode.c | 13 +++++++++++++
> fs/xfs/xfs_ioctl.c | 15 ---------------
> 4 files changed, 13 insertions(+), 69 deletions(-)
>
>
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index c2f48c90ca45..6aa1df1918f7 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -697,30 +697,6 @@ static long ext4_ioctl_group_add(struct file *file,
> return err;
> }
>
> -static int ext4_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(EXT4_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (ext4_test_inode_flag(inode, EXT4_INODE_PROJINHERIT)) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static void ext4_fsgetxattr(struct inode *inode, struct fsxattr *fa)
> {
> struct ext4_inode_info *ei = EXT4_I(inode);
> @@ -1135,9 +1111,6 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>
> inode_lock(inode);
> ext4_fsgetxattr(inode, &old_fa);
> - err = ext4_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index f707de6bd4a8..183ed1ac60e1 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2799,30 +2799,6 @@ static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> return 0;
> }
>
> -static int f2fs_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(F2FS_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (F2FS_I(inode)->i_flags & F2FS_PROJINHERIT_FL) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> @@ -2850,9 +2826,6 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> return err;
>
> inode_lock(inode);
> - err = f2fs_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
>
> __f2fs_ioc_fsgetxattr(inode, &old_fa);
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> diff --git a/fs/inode.c b/fs/inode.c
> index 026955258a47..40ecd3a6a188 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2201,6 +2201,19 @@ int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> !capable(CAP_LINUX_IMMUTABLE))
> return -EPERM;
>
> + /*
> + * Project Quota ID state is only allowed to change from within the init
> + * namespace. Enforce that restriction only if we are trying to change
> + * the quota ID state. Everything else is allowed in user namespaces.
> + */
> + if (current_user_ns() != &init_user_ns) {
> + if (old_fa->fsx_projid != fa->fsx_projid)
> + return -EINVAL;
> + if ((old_fa->fsx_xflags ^ fa->fsx_xflags) &
> + FS_XFLAG_PROJINHERIT)
> + return -EINVAL;
> + }
> +
> return 0;
> }
> EXPORT_SYMBOL(vfs_ioc_fssetxattr_check);
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 08c24f2f55c3..82961de98900 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -1299,21 +1299,6 @@ xfs_ioctl_setattr_check_projid(
> if (fa->fsx_projid > (uint16_t)-1 &&
> !xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb))
> return -EINVAL;
> -
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (xfs_get_projid(ip) != fa->fsx_projid)
> - return -EINVAL;
> - if ((fa->fsx_xflags & FS_XFLAG_PROJINHERIT) !=
> - (ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT))
> - return -EINVAL;
> -
> return 0;
> }
>
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply
* Re: [PATCH 3/4] fs: teach vfs_ioc_fssetxattr_check to check project id info
From: Jan Kara @ 2019-06-20 13:41 UTC (permalink / raw)
To: Darrick J. Wong
Cc: shaggy, jfs-discussion, linux-efi, linux-btrfs, yuchao0, clm,
adilger.kernel, matthew.garrett, linux-nilfs, cluster-devel,
linux-ext4, josef, reiserfs-devel, viro, dsterba, jaegeuk, tytso,
ard.biesheuvel, linux-kernel, linux-f2fs-devel, linux-xfs, jk,
jack, linux-fsdevel, linux-mtd, ocfs2-devel
In-Reply-To: <156022835712.3227089.13380623784109583024.stgit@magnolia>
On Mon 10-06-19 21:45:57, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Standardize the project id checks for FSSETXATTR.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/ioctl.c | 27 ---------------------------
> fs/f2fs/file.c | 27 ---------------------------
> fs/inode.c | 13 +++++++++++++
> fs/xfs/xfs_ioctl.c | 15 ---------------
> 4 files changed, 13 insertions(+), 69 deletions(-)
>
>
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index c2f48c90ca45..6aa1df1918f7 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -697,30 +697,6 @@ static long ext4_ioctl_group_add(struct file *file,
> return err;
> }
>
> -static int ext4_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(EXT4_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (ext4_test_inode_flag(inode, EXT4_INODE_PROJINHERIT)) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static void ext4_fsgetxattr(struct inode *inode, struct fsxattr *fa)
> {
> struct ext4_inode_info *ei = EXT4_I(inode);
> @@ -1135,9 +1111,6 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>
> inode_lock(inode);
> ext4_fsgetxattr(inode, &old_fa);
> - err = ext4_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index f707de6bd4a8..183ed1ac60e1 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2799,30 +2799,6 @@ static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> return 0;
> }
>
> -static int f2fs_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(F2FS_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (F2FS_I(inode)->i_flags & F2FS_PROJINHERIT_FL) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> @@ -2850,9 +2826,6 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> return err;
>
> inode_lock(inode);
> - err = f2fs_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
>
> __f2fs_ioc_fsgetxattr(inode, &old_fa);
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> diff --git a/fs/inode.c b/fs/inode.c
> index 026955258a47..40ecd3a6a188 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2201,6 +2201,19 @@ int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> !capable(CAP_LINUX_IMMUTABLE))
> return -EPERM;
>
> + /*
> + * Project Quota ID state is only allowed to change from within the init
> + * namespace. Enforce that restriction only if we are trying to change
> + * the quota ID state. Everything else is allowed in user namespaces.
> + */
> + if (current_user_ns() != &init_user_ns) {
> + if (old_fa->fsx_projid != fa->fsx_projid)
> + return -EINVAL;
> + if ((old_fa->fsx_xflags ^ fa->fsx_xflags) &
> + FS_XFLAG_PROJINHERIT)
> + return -EINVAL;
> + }
> +
> return 0;
> }
> EXPORT_SYMBOL(vfs_ioc_fssetxattr_check);
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 08c24f2f55c3..82961de98900 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -1299,21 +1299,6 @@ xfs_ioctl_setattr_check_projid(
> if (fa->fsx_projid > (uint16_t)-1 &&
> !xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb))
> return -EINVAL;
> -
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (xfs_get_projid(ip) != fa->fsx_projid)
> - return -EINVAL;
> - if ((fa->fsx_xflags & FS_XFLAG_PROJINHERIT) !=
> - (ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT))
> - return -EINVAL;
> -
> return 0;
> }
>
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply
* [Ocfs2-devel] [PATCH 3/4] fs: teach vfs_ioc_fssetxattr_check to check project id info
From: Jan Kara @ 2019-06-20 13:41 UTC (permalink / raw)
To: Darrick J. Wong
Cc: matthew.garrett, yuchao0, tytso, shaggy, ard.biesheuvel, josef,
clm, adilger.kernel, jk, jack, dsterba, jaegeuk, viro,
cluster-devel, jfs-discussion, linux-efi, reiserfs-devel,
linux-kernel, linux-f2fs-devel, linux-xfs, linux-nilfs, linux-mtd,
ocfs2-devel, linux-fsdevel, linux-ext4, linux-btrfs
In-Reply-To: <156022835712.3227089.13380623784109583024.stgit@magnolia>
On Mon 10-06-19 21:45:57, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Standardize the project id checks for FSSETXATTR.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/ioctl.c | 27 ---------------------------
> fs/f2fs/file.c | 27 ---------------------------
> fs/inode.c | 13 +++++++++++++
> fs/xfs/xfs_ioctl.c | 15 ---------------
> 4 files changed, 13 insertions(+), 69 deletions(-)
>
>
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index c2f48c90ca45..6aa1df1918f7 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -697,30 +697,6 @@ static long ext4_ioctl_group_add(struct file *file,
> return err;
> }
>
> -static int ext4_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(EXT4_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (ext4_test_inode_flag(inode, EXT4_INODE_PROJINHERIT)) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static void ext4_fsgetxattr(struct inode *inode, struct fsxattr *fa)
> {
> struct ext4_inode_info *ei = EXT4_I(inode);
> @@ -1135,9 +1111,6 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>
> inode_lock(inode);
> ext4_fsgetxattr(inode, &old_fa);
> - err = ext4_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index f707de6bd4a8..183ed1ac60e1 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2799,30 +2799,6 @@ static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> return 0;
> }
>
> -static int f2fs_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(F2FS_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (F2FS_I(inode)->i_flags & F2FS_PROJINHERIT_FL) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> @@ -2850,9 +2826,6 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> return err;
>
> inode_lock(inode);
> - err = f2fs_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
>
> __f2fs_ioc_fsgetxattr(inode, &old_fa);
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> diff --git a/fs/inode.c b/fs/inode.c
> index 026955258a47..40ecd3a6a188 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2201,6 +2201,19 @@ int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> !capable(CAP_LINUX_IMMUTABLE))
> return -EPERM;
>
> + /*
> + * Project Quota ID state is only allowed to change from within the init
> + * namespace. Enforce that restriction only if we are trying to change
> + * the quota ID state. Everything else is allowed in user namespaces.
> + */
> + if (current_user_ns() != &init_user_ns) {
> + if (old_fa->fsx_projid != fa->fsx_projid)
> + return -EINVAL;
> + if ((old_fa->fsx_xflags ^ fa->fsx_xflags) &
> + FS_XFLAG_PROJINHERIT)
> + return -EINVAL;
> + }
> +
> return 0;
> }
> EXPORT_SYMBOL(vfs_ioc_fssetxattr_check);
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 08c24f2f55c3..82961de98900 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -1299,21 +1299,6 @@ xfs_ioctl_setattr_check_projid(
> if (fa->fsx_projid > (uint16_t)-1 &&
> !xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb))
> return -EINVAL;
> -
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (xfs_get_projid(ip) != fa->fsx_projid)
> - return -EINVAL;
> - if ((fa->fsx_xflags & FS_XFLAG_PROJINHERIT) !=
> - (ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT))
> - return -EINVAL;
> -
> return 0;
> }
>
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply
* [Cluster-devel] [PATCH 3/4] fs: teach vfs_ioc_fssetxattr_check to check project id info
From: Jan Kara @ 2019-06-20 13:41 UTC (permalink / raw)
To: cluster-devel.redhat.com
In-Reply-To: <156022835712.3227089.13380623784109583024.stgit@magnolia>
On Mon 10-06-19 21:45:57, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Standardize the project id checks for FSSETXATTR.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/ioctl.c | 27 ---------------------------
> fs/f2fs/file.c | 27 ---------------------------
> fs/inode.c | 13 +++++++++++++
> fs/xfs/xfs_ioctl.c | 15 ---------------
> 4 files changed, 13 insertions(+), 69 deletions(-)
>
>
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index c2f48c90ca45..6aa1df1918f7 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -697,30 +697,6 @@ static long ext4_ioctl_group_add(struct file *file,
> return err;
> }
>
> -static int ext4_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(EXT4_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (ext4_test_inode_flag(inode, EXT4_INODE_PROJINHERIT)) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static void ext4_fsgetxattr(struct inode *inode, struct fsxattr *fa)
> {
> struct ext4_inode_info *ei = EXT4_I(inode);
> @@ -1135,9 +1111,6 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>
> inode_lock(inode);
> ext4_fsgetxattr(inode, &old_fa);
> - err = ext4_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index f707de6bd4a8..183ed1ac60e1 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2799,30 +2799,6 @@ static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> return 0;
> }
>
> -static int f2fs_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> -{
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (__kprojid_val(F2FS_I(inode)->i_projid) != fa->fsx_projid)
> - return -EINVAL;
> -
> - if (F2FS_I(inode)->i_flags & F2FS_PROJINHERIT_FL) {
> - if (!(fa->fsx_xflags & FS_XFLAG_PROJINHERIT))
> - return -EINVAL;
> - } else {
> - if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT)
> - return -EINVAL;
> - }
> -
> - return 0;
> -}
> -
> static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> @@ -2850,9 +2826,6 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> return err;
>
> inode_lock(inode);
> - err = f2fs_ioctl_check_project(inode, &fa);
> - if (err)
> - goto out;
>
> __f2fs_ioc_fsgetxattr(inode, &old_fa);
> err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> diff --git a/fs/inode.c b/fs/inode.c
> index 026955258a47..40ecd3a6a188 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2201,6 +2201,19 @@ int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> !capable(CAP_LINUX_IMMUTABLE))
> return -EPERM;
>
> + /*
> + * Project Quota ID state is only allowed to change from within the init
> + * namespace. Enforce that restriction only if we are trying to change
> + * the quota ID state. Everything else is allowed in user namespaces.
> + */
> + if (current_user_ns() != &init_user_ns) {
> + if (old_fa->fsx_projid != fa->fsx_projid)
> + return -EINVAL;
> + if ((old_fa->fsx_xflags ^ fa->fsx_xflags) &
> + FS_XFLAG_PROJINHERIT)
> + return -EINVAL;
> + }
> +
> return 0;
> }
> EXPORT_SYMBOL(vfs_ioc_fssetxattr_check);
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 08c24f2f55c3..82961de98900 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -1299,21 +1299,6 @@ xfs_ioctl_setattr_check_projid(
> if (fa->fsx_projid > (uint16_t)-1 &&
> !xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb))
> return -EINVAL;
> -
> - /*
> - * Project Quota ID state is only allowed to change from within the init
> - * namespace. Enforce that restriction only if we are trying to change
> - * the quota ID state. Everything else is allowed in user namespaces.
> - */
> - if (current_user_ns() == &init_user_ns)
> - return 0;
> -
> - if (xfs_get_projid(ip) != fa->fsx_projid)
> - return -EINVAL;
> - if ((fa->fsx_xflags & FS_XFLAG_PROJINHERIT) !=
> - (ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT))
> - return -EINVAL;
> -
> return 0;
> }
>
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply
* Re: [PATCH v5 06/11] ima-evm-utils: Start converting find_keyid to use EVP_PKEY API
From: Mimi Zohar @ 2019-06-20 13:40 UTC (permalink / raw)
To: Vitaly Chikunov; +Cc: Mimi Zohar, Dmitry Kasatkin, linux-integrity
In-Reply-To: <1561036909.4525.29.camel@linux.ibm.com>
On Thu, 2019-06-20 at 09:21 -0400, Mimi Zohar wrote:
> Hi Vitaly,
>
> > > > > If so, why are there other changes in this patch?
> > > >
> > > > There is no other changes beside stated in description.
> > >
> > > Are the changes from read_pub_key() to read_pub_pkey() and
> > > calc_keyid_v2() to calc_pkeyid_v2() needed for making find_keyid() a
> > > wrapper for find_keyid_pkey()?
> >
> > Of course. `entry->key' now have different type. If we keep old type
> > (RSA) where will be nothing to wrap.
>
> The question wasn't if the changes in init_public_keys() need to be
> made, the question is its correlation to find_keyid(). Unlesss I'm
> missing something, find_keyid() is only called by verify_hash_v2(),
> not calc_keyid_v2().
Ah, the list of keys needs to be in the appropriate format. Perhaps
add that info in the patch description.
Mimi
^ permalink raw reply
* Re: [PATCH 1/6] block: initialize the write priority in blk_rq_bio_prep
From: Minwoo Im @ 2019-06-20 13:40 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: axboe, Matias Bjorling, linux-block, Chaitanya Kulkarni
In-Reply-To: <20190606102904.4024-2-hch@lst.de>
Looks good to me"
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
^ permalink raw reply
* Re: [PATCH v3 1/6] crypto: essiv - create wrapper template for ESSIV generation
From: Herbert Xu @ 2019-06-20 13:40 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Eric Biggers, open list:HARDWARE RANDOM NUMBER GENERATOR CORE,
device-mapper development, linux-fscrypt, Gilad Ben-Yossef,
Milan Broz
In-Reply-To: <CAKv+Gu_z3oMB-XBHRrNWpXNbSmb4CFC8VNn8s+8bOd-JjiakqQ@mail.gmail.com>
On Thu, Jun 20, 2019 at 03:02:04PM +0200, Ard Biesheuvel wrote:
>
> It also depend on how realistic it is that we will need to support
> arbitrary sector sizes in the future. I mean, if we decide today that
> essiv() uses an implicit sector size of 4k, we can always add
> essiv64k() later, rather than adding lots of complexity now that we
> are never going to use. Note that ESSIV is already more or less
> deprecated, so there is really no point in inventing these weird and
> wonderful things if we want people to move to XTS and plain IV
> generation instead.
Well whatever we do for ESSIV should also extend to other IV
generators in dm-crypt so that potentially we can have a single
interface for dm-crypt multi-sector processing in future (IOW
you don't have special code for ESSIV vs. other algos).
That is why we should get the ESSIV interface right as it could
serve as an example for future implementations.
What do the dm-crypt people think? Are you ever going to need
processing in units other than 4K?
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH v3 1/6] crypto: essiv - create wrapper template for ESSIV generation
From: Herbert Xu @ 2019-06-20 13:40 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: linux-fscrypt, Eric Biggers, Gilad Ben-Yossef,
device-mapper development,
open list:HARDWARE RANDOM NUMBER GENERATOR CORE, Milan Broz
In-Reply-To: <CAKv+Gu_z3oMB-XBHRrNWpXNbSmb4CFC8VNn8s+8bOd-JjiakqQ@mail.gmail.com>
On Thu, Jun 20, 2019 at 03:02:04PM +0200, Ard Biesheuvel wrote:
>
> It also depend on how realistic it is that we will need to support
> arbitrary sector sizes in the future. I mean, if we decide today that
> essiv() uses an implicit sector size of 4k, we can always add
> essiv64k() later, rather than adding lots of complexity now that we
> are never going to use. Note that ESSIV is already more or less
> deprecated, so there is really no point in inventing these weird and
> wonderful things if we want people to move to XTS and plain IV
> generation instead.
Well whatever we do for ESSIV should also extend to other IV
generators in dm-crypt so that potentially we can have a single
interface for dm-crypt multi-sector processing in future (IOW
you don't have special code for ESSIV vs. other algos).
That is why we should get the ESSIV interface right as it could
serve as an example for future implementations.
What do the dm-crypt people think? Are you ever going to need
processing in units other than 4K?
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* [Buildroot] [PATCH 11/27] package/prboom: avoid using hardcoded optimization flags
From: Giulio Benetti @ 2019-06-20 13:40 UTC (permalink / raw)
To: buildroot
In-Reply-To: <20190619213707.68d086b3@windsurf>
Hello Thomas,
Il 19/06/2019 21:37, Thomas Petazzoni ha scritto:
> Hello Giulio,
>
> On Fri, 14 Jun 2019 23:03:30 +0200
> Giulio Benetti <giulio.benetti@micronovasrl.com> wrote:
>
>> Package prboom builds using -O2 flag ignoring Buildroot settings, this
>> is due to the fact that -O2 is appended at the end of CFLAGS.
>>
>> Remove -O2 from 'configure' file, this way CFLAGS will contain Buildroot
>> CFLAGS.
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
>> ---
>> package/prboom/prboom.mk | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/package/prboom/prboom.mk b/package/prboom/prboom.mk
>> index d370ae3fa5..6d9b55e9f6 100644
>> --- a/package/prboom/prboom.mk
>> +++ b/package/prboom/prboom.mk
>> @@ -11,6 +11,13 @@ PRBOOM_DEPENDENCIES = sdl sdl_net sdl_mixer
>> PRBOOM_LICENSE = GPL-2.0+
>> PRBOOM_LICENSE_FILES = COPYING
>>
>> +# Remove imposed -O2 CFLAG to use TARGET_CFLAGS
>> +define PRBOOM_FIXUP_CONFIGURE
>> + sed -i 's:-O2::g' $(@D)/configure
>> +endef
>> +
>> +PRBOOM_PRE_CONFIGURE_HOOKS += PRBOOM_FIXUP_CONFIGURE
>
> I am not a big fan of this "blind" sed that replaces every -O2 in the
> configure script with nothing.
>
> Patching configure.ac + autoreconf would be nicer, especially since
> anyway prboom depends on sdl, and sdl already depends on the autotools
> machinery.
Yes, it's really cleaner.
> However, ideally the configure.ac script should be fixed to *not* add
> flags to CFLAGS. CFLAGS is a user variable, the configure script is not
> supposed to use it. See
> https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html.
Interesting document.
> But well, fixing the prboom configure.ac is probably too much effort
> comparing to the benefits.
I agree.
> So just do a patch that gets rid of the -O2 in the configure.ac, and
> that will be good enough.
Ok
Thank you
--
Giulio Benetti
CTO
MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale ? 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
^ permalink raw reply
* Re: [PATCH] ath11k: add wrapper function to ath11k_dbg
From: Kalle Valo @ 2019-06-20 13:40 UTC (permalink / raw)
To: Venkateswara Naralasetty; +Cc: ath11k
In-Reply-To: <1560855152-2609-1-git-send-email-vnaralas@codeaurora.org>
Venkateswara Naralasetty <vnaralas@codeaurora.org> wrote:
> This patch define a macro for ath11k_dbg() which improves
> the Rx performance by avoid calling ath11k_dbg() from
> ath11k_dp_rx_deliver_msdu() when no dbg_mask set.
>
> Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath11k-bringup branch of ath.git, thanks.
6b4ad0ceb075 ath11k: add wrapper function to ath11k_dbg
--
https://patchwork.kernel.org/patch/11001381/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
^ permalink raw reply
* [U-Boot] [PATCH] fastboot: Add "is-userspace" variable
From: Sam Protsenko @ 2019-06-20 13:40 UTC (permalink / raw)
To: u-boot
As per documentation [1], Android-Q requires for bootloader to provide
"is-userspace" variable. "no" value should be always returned. This
patch implements this fastboot variable.
[1] https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md#client-variables
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
drivers/fastboot/fb_getvar.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
index 9ee5054485..fd0823b2bf 100644
--- a/drivers/fastboot/fb_getvar.c
+++ b/drivers/fastboot/fb_getvar.c
@@ -28,6 +28,7 @@ static void getvar_partition_type(char *part_name, char *response);
#if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
static void getvar_partition_size(char *part_name, char *response);
#endif
+static void getvar_is_userspace(char *var_parameter, char *response);
static const struct {
const char *variable;
@@ -78,6 +79,9 @@ static const struct {
.variable = "partition-size",
.dispatch = getvar_partition_size
#endif
+ }, {
+ .variable = "is-userspace",
+ .dispatch = getvar_is_userspace
}
};
@@ -243,6 +247,11 @@ static void getvar_partition_size(char *part_name, char *response)
}
#endif
+static void getvar_is_userspace(char *var_parameter, char *response)
+{
+ fastboot_okay("no", response);
+}
+
/**
* fastboot_getvar() - Writes variable indicated by cmd_parameter to response.
*
--
2.20.1
^ permalink raw reply related
* Re: [PATCH 1/2] ath11k: clean up in htt extd stats
From: Kalle Valo @ 2019-06-20 13:39 UTC (permalink / raw)
To: Venkateswara Naralasetty; +Cc: ath11k
In-Reply-To: <1560854534-29013-1-git-send-email-vnaralas@codeaurora.org>
Venkateswara Naralasetty <vnaralas@codeaurora.org> wrote:
> Removed pointer arithmetic and the magic numbers
>
> Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2 patches applied to ath11k-bringup branch of ath.git, thanks.
8c04d1c544fd ath11k: clean up in htt extd stats
049a795bb88e ath11k: fix invalid htt extd stats processing
--
https://patchwork.kernel.org/patch/11001373/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
^ permalink raw reply
* Re: [PATCH net] ipvs: defer hook registration to avoid leaks
From: Simon Horman @ 2019-06-20 13:39 UTC (permalink / raw)
To: Julian Anastasov; +Cc: lvs-devel, Pablo Neira Ayuso, netfilter-devel
In-Reply-To: <20190604185635.16823-1-ja@ssi.bg>
On Tue, Jun 04, 2019 at 09:56:35PM +0300, Julian Anastasov wrote:
> syzkaller reports for memory leak when registering hooks [1]
>
> As we moved the nf_unregister_net_hooks() call into
> __ip_vs_dev_cleanup(), defer the nf_register_net_hooks()
> call, so that hooks are allocated and freed from same
> pernet_operations (ipvs_core_dev_ops).
>
> [1]
> BUG: memory leak
> unreferenced object 0xffff88810acd8a80 (size 96):
> comm "syz-executor073", pid 7254, jiffies 4294950560 (age 22.250s)
> hex dump (first 32 bytes):
> 02 00 00 00 00 00 00 00 50 8b bb 82 ff ff ff ff ........P.......
> 00 00 00 00 00 00 00 00 00 77 bb 82 ff ff ff ff .........w......
> backtrace:
> [<0000000013db61f1>] kmemleak_alloc_recursive include/linux/kmemleak.h:55 [inline]
> [<0000000013db61f1>] slab_post_alloc_hook mm/slab.h:439 [inline]
> [<0000000013db61f1>] slab_alloc_node mm/slab.c:3269 [inline]
> [<0000000013db61f1>] kmem_cache_alloc_node_trace+0x15b/0x2a0 mm/slab.c:3597
> [<000000001a27307d>] __do_kmalloc_node mm/slab.c:3619 [inline]
> [<000000001a27307d>] __kmalloc_node+0x38/0x50 mm/slab.c:3627
> [<0000000025054add>] kmalloc_node include/linux/slab.h:590 [inline]
> [<0000000025054add>] kvmalloc_node+0x4a/0xd0 mm/util.c:431
> [<0000000050d1bc00>] kvmalloc include/linux/mm.h:637 [inline]
> [<0000000050d1bc00>] kvzalloc include/linux/mm.h:645 [inline]
> [<0000000050d1bc00>] allocate_hook_entries_size+0x3b/0x60 net/netfilter/core.c:61
> [<00000000e8abe142>] nf_hook_entries_grow+0xae/0x270 net/netfilter/core.c:128
> [<000000004b94797c>] __nf_register_net_hook+0x9a/0x170 net/netfilter/core.c:337
> [<00000000d1545cbc>] nf_register_net_hook+0x34/0xc0 net/netfilter/core.c:464
> [<00000000876c9b55>] nf_register_net_hooks+0x53/0xc0 net/netfilter/core.c:480
> [<000000002ea868e0>] __ip_vs_init+0xe8/0x170 net/netfilter/ipvs/ip_vs_core.c:2280
> [<000000002eb2d451>] ops_init+0x4c/0x140 net/core/net_namespace.c:130
> [<000000000284ec48>] setup_net+0xde/0x230 net/core/net_namespace.c:316
> [<00000000a70600fa>] copy_net_ns+0xf0/0x1e0 net/core/net_namespace.c:439
> [<00000000ff26c15e>] create_new_namespaces+0x141/0x2a0 kernel/nsproxy.c:107
> [<00000000b103dc79>] copy_namespaces+0xa1/0xe0 kernel/nsproxy.c:165
> [<000000007cc008a2>] copy_process.part.0+0x11fd/0x2150 kernel/fork.c:2035
> [<00000000c344af7c>] copy_process kernel/fork.c:1800 [inline]
> [<00000000c344af7c>] _do_fork+0x121/0x4f0 kernel/fork.c:2369
>
> Reported-by: syzbot+722da59ccb264bc19910@syzkaller.appspotmail.com
> Fixes: 719c7d563c17 ("ipvs: Fix use-after-free in ip_vs_in")
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
Thanks Julian.
Pablo, please consider applying this to nf.
Acked-by: Simon Horman <horms@verge.net.au>
^ permalink raw reply
* ✗ Fi.CI.IGT: failure for series starting with [1/6] drm/i915/sdvo: Fix handling if zero hbuf size
From: Patchwork @ 2019-06-20 13:39 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
In-Reply-To: <20190619180312.31817-1-ville.syrjala@linux.intel.com>
== Series Details ==
Series: series starting with [1/6] drm/i915/sdvo: Fix handling if zero hbuf size
URL : https://patchwork.freedesktop.org/series/62400/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_6310_full -> Patchwork_13350_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_13350_full absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_13350_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_13350_full:
### IGT changes ###
#### Possible regressions ####
* igt@kms_addfb_basic@addfb25-x-tiled-mismatch:
- shard-skl: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-skl1/igt@kms_addfb_basic@addfb25-x-tiled-mismatch.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-skl3/igt@kms_addfb_basic@addfb25-x-tiled-mismatch.html
Known issues
------------
Here are the changes found in Patchwork_13350_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_softpin@noreloc-s3:
- shard-skl: [PASS][3] -> [INCOMPLETE][4] ([fdo#104108])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-skl2/igt@gem_softpin@noreloc-s3.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-skl9/igt@gem_softpin@noreloc-s3.html
* igt@gem_tiled_swapping@non-threaded:
- shard-hsw: [PASS][5] -> [FAIL][6] ([fdo#108686])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-hsw1/igt@gem_tiled_swapping@non-threaded.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-hsw1/igt@gem_tiled_swapping@non-threaded.html
* igt@gem_userptr_blits@map-fixed-invalidate-busy:
- shard-apl: [PASS][7] -> [DMESG-WARN][8] ([fdo#110913 ])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-apl6/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-apl5/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
- shard-kbl: [PASS][9] -> [DMESG-WARN][10] ([fdo#110913 ]) +1 similar issue
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-kbl2/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-kbl2/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
* igt@gem_userptr_blits@map-fixed-invalidate-busy-gup:
- shard-snb: [PASS][11] -> [DMESG-WARN][12] ([fdo#110913 ])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-snb1/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-snb6/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html
* igt@i915_suspend@sysfs-reader:
- shard-kbl: [PASS][13] -> [INCOMPLETE][14] ([fdo#103665] / [fdo#108767])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-kbl3/igt@i915_suspend@sysfs-reader.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-kbl4/igt@i915_suspend@sysfs-reader.html
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
- shard-glk: [PASS][15] -> [FAIL][16] ([fdo#104873])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-glk3/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-glk9/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-hsw: [PASS][17] -> [SKIP][18] ([fdo#109271]) +24 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-hsw6/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-hsw1/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-kbl: [PASS][19] -> [INCOMPLETE][20] ([fdo#103665])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-kbl3/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-kbl4/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-apl: [PASS][21] -> [DMESG-WARN][22] ([fdo#108566]) +2 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-apl3/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-apl4/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [PASS][23] -> [FAIL][24] ([fdo#108145])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-skl8/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-skl8/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
* igt@kms_sysfs_edid_timing:
- shard-hsw: [PASS][25] -> [FAIL][26] ([fdo#100047])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-hsw7/igt@kms_sysfs_edid_timing.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-hsw1/igt@kms_sysfs_edid_timing.html
* igt@kms_vblank@pipe-a-wait-busy-hang:
- shard-apl: [PASS][27] -> [INCOMPLETE][28] ([fdo#103927])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-apl6/igt@kms_vblank@pipe-a-wait-busy-hang.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-apl5/igt@kms_vblank@pipe-a-wait-busy-hang.html
#### Possible fixes ####
* igt@gem_userptr_blits@map-fixed-invalidate-busy-gup:
- shard-kbl: [DMESG-WARN][29] ([fdo#110913 ]) -> [PASS][30] +2 similar issues
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-kbl3/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-kbl4/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html
* igt@i915_selftest@mock_sanitycheck:
- shard-apl: [DMESG-WARN][31] ([fdo#110913 ]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-apl1/igt@i915_selftest@mock_sanitycheck.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-apl6/igt@i915_selftest@mock_sanitycheck.html
* igt@i915_suspend@debugfs-reader:
- shard-apl: [DMESG-WARN][33] ([fdo#108566]) -> [PASS][34] +2 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-apl1/igt@i915_suspend@debugfs-reader.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-apl2/igt@i915_suspend@debugfs-reader.html
* igt@kms_draw_crc@draw-method-rgb565-blt-ytiled:
- shard-skl: [FAIL][35] ([fdo#103184] / [fdo#103232]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-skl5/igt@kms_draw_crc@draw-method-rgb565-blt-ytiled.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-skl5/igt@kms_draw_crc@draw-method-rgb565-blt-ytiled.html
* igt@kms_flip@modeset-vs-vblank-race:
- shard-glk: [FAIL][37] ([fdo#103060]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-glk6/igt@kms_flip@modeset-vs-vblank-race.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-glk7/igt@kms_flip@modeset-vs-vblank-race.html
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-mmap-wc:
- shard-hsw: [SKIP][39] ([fdo#109271]) -> [PASS][40] +23 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-hsw1/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-mmap-wc.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-hsw5/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-shrfb-draw-mmap-wc.html
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-pwrite:
- shard-skl: [FAIL][41] ([fdo#108040]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-skl5/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-pwrite.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-skl6/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-pwrite.html
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
- shard-skl: [FAIL][43] ([fdo#103191]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-skl3/igt@kms_pipe_crc_basic@hang-read-crc-pipe-c.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-skl9/igt@kms_pipe_crc_basic@hang-read-crc-pipe-c.html
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [FAIL][45] ([fdo#108145]) -> [PASS][46] +1 similar issue
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-skl3/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-skl9/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
* igt@kms_vblank@pipe-b-wait-idle:
- shard-snb: [SKIP][47] ([fdo#109271]) -> [PASS][48] +2 similar issues
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-snb7/igt@kms_vblank@pipe-b-wait-idle.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-snb5/igt@kms_vblank@pipe-b-wait-idle.html
* igt@prime_busy@wait-hang-bsd:
- shard-hsw: [INCOMPLETE][49] ([fdo#103540]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-hsw4/igt@prime_busy@wait-hang-bsd.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-hsw4/igt@prime_busy@wait-hang-bsd.html
#### Warnings ####
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-skl: [FAIL][51] ([fdo#103167]) -> [FAIL][52] ([fdo#108040])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6310/shard-skl7/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/shard-skl7/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt.html
[fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
[fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
[fdo#108040]: https://bugs.freedesktop.org/show_bug.cgi?id=108040
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#108767]: https://bugs.freedesktop.org/show_bug.cgi?id=108767
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#110913 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110913
Participating hosts (10 -> 9)
------------------------------
Missing (1): shard-iclb
Build changes
-------------
* Linux: CI_DRM_6310 -> Patchwork_13350
CI_DRM_6310: dc88bdb699786ec5c75f0fd0fb6f8b0c3e58eb8e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5061: c88ced79a7b71aec58f1d9c5c599ac2f431bcf7a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13350: 90de88680a230ae783cbdb8abd56189c04b7423e @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13350/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH] ath11k: cleanup in HTC and tx data path
From: Kalle Valo @ 2019-06-20 13:39 UTC (permalink / raw)
To: Karthikeyan Periyasamy; +Cc: ath11k
In-Reply-To: <1560832368-17047-1-git-send-email-periyasa@codeaurora.org>
Karthikeyan Periyasamy <periyasa@codeaurora.org> wrote:
> Removed the unnecessary parenthesis in ath11k_dp_tx().
> Replaced the Hard code value to the HTC header structure
> size while reserve the skb. Modify the WARN_ONCE to WARN_ON
> in ath11k_htc_build_tx_ctrl_skb().
>
> Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath11k-bringup branch of ath.git, thanks.
4d57f3c14410 ath11k: cleanup in HTC and tx data path
--
https://patchwork.kernel.org/patch/11000875/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
^ permalink raw reply
* Re: [f2fs-dev] [PATCH 2/4] vfs: create a generic checking function for FS_IOC_FSSETXATTR
From: Jan Kara @ 2019-06-20 13:38 UTC (permalink / raw)
To: Darrick J. Wong
Cc: shaggy, jfs-discussion, linux-efi, linux-btrfs, clm,
adilger.kernel, matthew.garrett, linux-nilfs, cluster-devel,
linux-ext4, josef, reiserfs-devel, viro, dsterba, jaegeuk, tytso,
ard.biesheuvel, linux-kernel, linux-f2fs-devel, linux-xfs, jk,
jack, linux-fsdevel, linux-mtd, ocfs2-devel
In-Reply-To: <156022834894.3227089.18246471175409784122.stgit@magnolia>
On Mon 10-06-19 21:45:49, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Create a generic checking function for the incoming FS_IOC_FSSETXATTR
> fsxattr values so that we can standardize some of the implementation
> behaviors.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/btrfs/ioctl.c | 21 +++++++++-------
> fs/ext4/ioctl.c | 27 ++++++++++++++------
> fs/f2fs/file.c | 26 ++++++++++++++-----
> fs/inode.c | 17 +++++++++++++
> fs/xfs/xfs_ioctl.c | 70 ++++++++++++++++++++++++++++++----------------------
> include/linux/fs.h | 3 ++
> 6 files changed, 111 insertions(+), 53 deletions(-)
>
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index f408aa93b0cf..7ddda5b4b6a6 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -366,6 +366,13 @@ static int check_xflags(unsigned int flags)
> return 0;
> }
>
> +static void __btrfs_ioctl_fsgetxattr(struct btrfs_inode *binode,
> + struct fsxattr *fa)
> +{
> + memset(fa, 0, sizeof(*fa));
> + fa->fsx_xflags = btrfs_inode_flags_to_xflags(binode->flags);
> +}
> +
> /*
> * Set the xflags from the internal inode flags. The remaining items of fsxattr
> * are zeroed.
> @@ -375,8 +382,7 @@ static int btrfs_ioctl_fsgetxattr(struct file *file, void __user *arg)
> struct btrfs_inode *binode = BTRFS_I(file_inode(file));
> struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(fa));
> - fa.fsx_xflags = btrfs_inode_flags_to_xflags(binode->flags);
> + __btrfs_ioctl_fsgetxattr(binode, &fa);
>
> if (copy_to_user(arg, &fa, sizeof(fa)))
> return -EFAULT;
> @@ -390,7 +396,7 @@ static int btrfs_ioctl_fssetxattr(struct file *file, void __user *arg)
> struct btrfs_inode *binode = BTRFS_I(inode);
> struct btrfs_root *root = binode->root;
> struct btrfs_trans_handle *trans;
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> unsigned old_flags;
> unsigned old_i_flags;
> int ret = 0;
> @@ -421,13 +427,10 @@ static int btrfs_ioctl_fssetxattr(struct file *file, void __user *arg)
> old_flags = binode->flags;
> old_i_flags = inode->i_flags;
>
> - /* We need the capabilities to change append-only or immutable inode */
> - if (((old_flags & (BTRFS_INODE_APPEND | BTRFS_INODE_IMMUTABLE)) ||
> - (fa.fsx_xflags & (FS_XFLAG_APPEND | FS_XFLAG_IMMUTABLE))) &&
> - !capable(CAP_LINUX_IMMUTABLE)) {
> - ret = -EPERM;
> + __btrfs_ioctl_fsgetxattr(binode, &old_fa);
> + ret = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> + if (ret)
> goto out_unlock;
> - }
>
> if (fa.fsx_xflags & FS_XFLAG_SYNC)
> binode->flags |= BTRFS_INODE_SYNC;
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index 5126ee351a84..c2f48c90ca45 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -721,6 +721,19 @@ static int ext4_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> return 0;
> }
>
> +static void ext4_fsgetxattr(struct inode *inode, struct fsxattr *fa)
> +{
> + struct ext4_inode_info *ei = EXT4_I(inode);
> +
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = ext4_iflags_to_xflags(ei->i_flags & EXT4_FL_USER_VISIBLE);
> +
> + if (ext4_has_feature_project(inode->i_sb)) {
> + fa->fsx_projid = (__u32)from_kprojid(&init_user_ns,
> + ei->i_projid);
> + }
> +}
> +
> long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> @@ -1089,13 +1102,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> {
> struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(struct fsxattr));
> - fa.fsx_xflags = ext4_iflags_to_xflags(ei->i_flags & EXT4_FL_USER_VISIBLE);
> -
> - if (ext4_has_feature_project(inode->i_sb)) {
> - fa.fsx_projid = (__u32)from_kprojid(&init_user_ns,
> - EXT4_I(inode)->i_projid);
> - }
> + ext4_fsgetxattr(inode, &fa);
>
> if (copy_to_user((struct fsxattr __user *)arg,
> &fa, sizeof(fa)))
> @@ -1104,7 +1111,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> }
> case EXT4_IOC_FSSETXATTR:
> {
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> int err;
>
> if (copy_from_user(&fa, (struct fsxattr __user *)arg,
> @@ -1127,7 +1134,11 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> return err;
>
> inode_lock(inode);
> + ext4_fsgetxattr(inode, &old_fa);
> err = ext4_ioctl_check_project(inode, &fa);
> + if (err)
> + goto out;
> + err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> flags = (ei->i_flags & ~EXT4_FL_XFLAG_VISIBLE) |
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index a969d5497e03..f707de6bd4a8 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2773,19 +2773,26 @@ static inline unsigned long f2fs_xflags_to_iflags(__u32 xflags)
> return iflags;
> }
>
> -static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> +static void __f2fs_ioc_fsgetxattr(struct inode *inode,
> + struct fsxattr *fa)
> {
> - struct inode *inode = file_inode(filp);
> struct f2fs_inode_info *fi = F2FS_I(inode);
> - struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(struct fsxattr));
> - fa.fsx_xflags = f2fs_iflags_to_xflags(fi->i_flags &
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = f2fs_iflags_to_xflags(fi->i_flags &
> F2FS_FL_USER_VISIBLE);
>
> if (f2fs_sb_has_project_quota(F2FS_I_SB(inode)))
> - fa.fsx_projid = (__u32)from_kprojid(&init_user_ns,
> + fa->fsx_projid = (__u32)from_kprojid(&init_user_ns,
> fi->i_projid);
> +}
> +
> +static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> +{
> + struct inode *inode = file_inode(filp);
> + struct fsxattr fa;
> +
> + __f2fs_ioc_fsgetxattr(inode, &fa);
>
> if (copy_to_user((struct fsxattr __user *)arg, &fa, sizeof(fa)))
> return -EFAULT;
> @@ -2820,7 +2827,7 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> struct f2fs_inode_info *fi = F2FS_I(inode);
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> unsigned int flags;
> int err;
>
> @@ -2844,6 +2851,11 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
>
> inode_lock(inode);
> err = f2fs_ioctl_check_project(inode, &fa);
> + if (err)
> + goto out;
> +
> + __f2fs_ioc_fsgetxattr(inode, &old_fa);
> + err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> flags = (fi->i_flags & ~F2FS_FL_XFLAG_VISIBLE) |
> diff --git a/fs/inode.c b/fs/inode.c
> index 0ce60b720608..026955258a47 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2187,3 +2187,20 @@ int vfs_ioc_setflags_check(struct inode *inode, int oldflags, int flags)
> return 0;
> }
> EXPORT_SYMBOL(vfs_ioc_setflags_check);
> +
> +/* Generic function to check FS_IOC_FSSETXATTR values. */
> +int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> + struct fsxattr *fa)
> +{
> + /*
> + * Can't modify an immutable/append-only file unless we have
> + * appropriate permission.
> + */
> + if ((old_fa->fsx_xflags ^ fa->fsx_xflags) &
> + (FS_XFLAG_IMMUTABLE | FS_XFLAG_APPEND) &&
> + !capable(CAP_LINUX_IMMUTABLE))
> + return -EPERM;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(vfs_ioc_fssetxattr_check);
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index d7dfc13f30f5..08c24f2f55c3 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -879,37 +879,45 @@ xfs_di2lxflags(
> return flags;
> }
>
> -STATIC int
> -xfs_ioc_fsgetxattr(
> - xfs_inode_t *ip,
> - int attr,
> - void __user *arg)
> +static void
> +__xfs_ioc_fsgetxattr(
> + struct xfs_inode *ip,
> + bool attr,
> + struct fsxattr *fa)
> {
> - struct fsxattr fa;
> -
> - memset(&fa, 0, sizeof(struct fsxattr));
> -
> - xfs_ilock(ip, XFS_ILOCK_SHARED);
> - fa.fsx_xflags = xfs_ip2xflags(ip);
> - fa.fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
> - fa.fsx_cowextsize = ip->i_d.di_cowextsize <<
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = xfs_ip2xflags(ip);
> + fa->fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
> + fa->fsx_cowextsize = ip->i_d.di_cowextsize <<
> ip->i_mount->m_sb.sb_blocklog;
> - fa.fsx_projid = xfs_get_projid(ip);
> + fa->fsx_projid = xfs_get_projid(ip);
>
> if (attr) {
> if (ip->i_afp) {
> if (ip->i_afp->if_flags & XFS_IFEXTENTS)
> - fa.fsx_nextents = xfs_iext_count(ip->i_afp);
> + fa->fsx_nextents = xfs_iext_count(ip->i_afp);
> else
> - fa.fsx_nextents = ip->i_d.di_anextents;
> + fa->fsx_nextents = ip->i_d.di_anextents;
> } else
> - fa.fsx_nextents = 0;
> + fa->fsx_nextents = 0;
> } else {
> if (ip->i_df.if_flags & XFS_IFEXTENTS)
> - fa.fsx_nextents = xfs_iext_count(&ip->i_df);
> + fa->fsx_nextents = xfs_iext_count(&ip->i_df);
> else
> - fa.fsx_nextents = ip->i_d.di_nextents;
> + fa->fsx_nextents = ip->i_d.di_nextents;
> }
> +}
> +
> +STATIC int
> +xfs_ioc_fsgetxattr(
> + xfs_inode_t *ip,
> + int attr,
> + void __user *arg)
> +{
> + struct fsxattr fa;
> +
> + xfs_ilock(ip, XFS_ILOCK_SHARED);
> + __xfs_ioc_fsgetxattr(ip, attr, &fa);
> xfs_iunlock(ip, XFS_ILOCK_SHARED);
>
> if (copy_to_user(arg, &fa, sizeof(fa)))
> @@ -1035,15 +1043,6 @@ xfs_ioctl_setattr_xflags(
> if ((fa->fsx_xflags & FS_XFLAG_DAX) && xfs_is_reflink_inode(ip))
> return -EINVAL;
>
> - /*
> - * Can't modify an immutable/append-only file unless
> - * we have appropriate permission.
> - */
> - if (((ip->i_d.di_flags & (XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND)) ||
> - (fa->fsx_xflags & (FS_XFLAG_IMMUTABLE | FS_XFLAG_APPEND))) &&
> - !capable(CAP_LINUX_IMMUTABLE))
> - return -EPERM;
> -
> /* diflags2 only valid for v3 inodes. */
> di_flags2 = xfs_flags2diflags2(ip, fa->fsx_xflags);
> if (di_flags2 && ip->i_d.di_version < 3)
> @@ -1323,6 +1322,7 @@ xfs_ioctl_setattr(
> xfs_inode_t *ip,
> struct fsxattr *fa)
> {
> + struct fsxattr old_fa;
> struct xfs_mount *mp = ip->i_mount;
> struct xfs_trans *tp;
> struct xfs_dquot *udqp = NULL;
> @@ -1370,7 +1370,6 @@ xfs_ioctl_setattr(
> goto error_free_dquots;
> }
>
> -
> if (XFS_IS_QUOTA_RUNNING(mp) && XFS_IS_PQUOTA_ON(mp) &&
> xfs_get_projid(ip) != fa->fsx_projid) {
> code = xfs_qm_vop_chown_reserve(tp, ip, udqp, NULL, pdqp,
> @@ -1379,6 +1378,11 @@ xfs_ioctl_setattr(
> goto error_trans_cancel;
> }
>
> + __xfs_ioc_fsgetxattr(ip, false, &old_fa);
> + code = vfs_ioc_fssetxattr_check(VFS_I(ip), &old_fa, fa);
> + if (code)
> + goto error_trans_cancel;
> +
> code = xfs_ioctl_setattr_check_extsize(ip, fa);
> if (code)
> goto error_trans_cancel;
> @@ -1489,6 +1493,7 @@ xfs_ioc_setxflags(
> {
> struct xfs_trans *tp;
> struct fsxattr fa;
> + struct fsxattr old_fa;
> unsigned int flags;
> int join_flags = 0;
> int error;
> @@ -1524,6 +1529,13 @@ xfs_ioc_setxflags(
> goto out_drop_write;
> }
>
> + __xfs_ioc_fsgetxattr(ip, false, &old_fa);
> + error = vfs_ioc_fssetxattr_check(VFS_I(ip), &old_fa, &fa);
> + if (error) {
> + xfs_trans_cancel(tp);
> + goto out_drop_write;
> + }
> +
> error = xfs_ioctl_setattr_xflags(tp, ip, &fa);
> if (error) {
> xfs_trans_cancel(tp);
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 1825d055808c..8dad3c80b611 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -3548,4 +3548,7 @@ static inline struct sock *io_uring_get_socket(struct file *file)
>
> int vfs_ioc_setflags_check(struct inode *inode, int oldflags, int flags);
>
> +int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> + struct fsxattr *fa);
> +
> #endif /* _LINUX_FS_H */
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply
* Re: [PATCH 2/4] vfs: create a generic checking function for FS_IOC_FSSETXATTR
From: Jan Kara @ 2019-06-20 13:38 UTC (permalink / raw)
To: Darrick J. Wong
Cc: shaggy, jfs-discussion, linux-efi, linux-btrfs, yuchao0, clm,
adilger.kernel, matthew.garrett, linux-nilfs, cluster-devel,
linux-ext4, josef, reiserfs-devel, viro, dsterba, jaegeuk, tytso,
ard.biesheuvel, linux-kernel, linux-f2fs-devel, linux-xfs, jk,
jack, linux-fsdevel, linux-mtd, ocfs2-devel
In-Reply-To: <156022834894.3227089.18246471175409784122.stgit@magnolia>
On Mon 10-06-19 21:45:49, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Create a generic checking function for the incoming FS_IOC_FSSETXATTR
> fsxattr values so that we can standardize some of the implementation
> behaviors.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/btrfs/ioctl.c | 21 +++++++++-------
> fs/ext4/ioctl.c | 27 ++++++++++++++------
> fs/f2fs/file.c | 26 ++++++++++++++-----
> fs/inode.c | 17 +++++++++++++
> fs/xfs/xfs_ioctl.c | 70 ++++++++++++++++++++++++++++++----------------------
> include/linux/fs.h | 3 ++
> 6 files changed, 111 insertions(+), 53 deletions(-)
>
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index f408aa93b0cf..7ddda5b4b6a6 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -366,6 +366,13 @@ static int check_xflags(unsigned int flags)
> return 0;
> }
>
> +static void __btrfs_ioctl_fsgetxattr(struct btrfs_inode *binode,
> + struct fsxattr *fa)
> +{
> + memset(fa, 0, sizeof(*fa));
> + fa->fsx_xflags = btrfs_inode_flags_to_xflags(binode->flags);
> +}
> +
> /*
> * Set the xflags from the internal inode flags. The remaining items of fsxattr
> * are zeroed.
> @@ -375,8 +382,7 @@ static int btrfs_ioctl_fsgetxattr(struct file *file, void __user *arg)
> struct btrfs_inode *binode = BTRFS_I(file_inode(file));
> struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(fa));
> - fa.fsx_xflags = btrfs_inode_flags_to_xflags(binode->flags);
> + __btrfs_ioctl_fsgetxattr(binode, &fa);
>
> if (copy_to_user(arg, &fa, sizeof(fa)))
> return -EFAULT;
> @@ -390,7 +396,7 @@ static int btrfs_ioctl_fssetxattr(struct file *file, void __user *arg)
> struct btrfs_inode *binode = BTRFS_I(inode);
> struct btrfs_root *root = binode->root;
> struct btrfs_trans_handle *trans;
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> unsigned old_flags;
> unsigned old_i_flags;
> int ret = 0;
> @@ -421,13 +427,10 @@ static int btrfs_ioctl_fssetxattr(struct file *file, void __user *arg)
> old_flags = binode->flags;
> old_i_flags = inode->i_flags;
>
> - /* We need the capabilities to change append-only or immutable inode */
> - if (((old_flags & (BTRFS_INODE_APPEND | BTRFS_INODE_IMMUTABLE)) ||
> - (fa.fsx_xflags & (FS_XFLAG_APPEND | FS_XFLAG_IMMUTABLE))) &&
> - !capable(CAP_LINUX_IMMUTABLE)) {
> - ret = -EPERM;
> + __btrfs_ioctl_fsgetxattr(binode, &old_fa);
> + ret = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> + if (ret)
> goto out_unlock;
> - }
>
> if (fa.fsx_xflags & FS_XFLAG_SYNC)
> binode->flags |= BTRFS_INODE_SYNC;
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index 5126ee351a84..c2f48c90ca45 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -721,6 +721,19 @@ static int ext4_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> return 0;
> }
>
> +static void ext4_fsgetxattr(struct inode *inode, struct fsxattr *fa)
> +{
> + struct ext4_inode_info *ei = EXT4_I(inode);
> +
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = ext4_iflags_to_xflags(ei->i_flags & EXT4_FL_USER_VISIBLE);
> +
> + if (ext4_has_feature_project(inode->i_sb)) {
> + fa->fsx_projid = (__u32)from_kprojid(&init_user_ns,
> + ei->i_projid);
> + }
> +}
> +
> long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> @@ -1089,13 +1102,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> {
> struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(struct fsxattr));
> - fa.fsx_xflags = ext4_iflags_to_xflags(ei->i_flags & EXT4_FL_USER_VISIBLE);
> -
> - if (ext4_has_feature_project(inode->i_sb)) {
> - fa.fsx_projid = (__u32)from_kprojid(&init_user_ns,
> - EXT4_I(inode)->i_projid);
> - }
> + ext4_fsgetxattr(inode, &fa);
>
> if (copy_to_user((struct fsxattr __user *)arg,
> &fa, sizeof(fa)))
> @@ -1104,7 +1111,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> }
> case EXT4_IOC_FSSETXATTR:
> {
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> int err;
>
> if (copy_from_user(&fa, (struct fsxattr __user *)arg,
> @@ -1127,7 +1134,11 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> return err;
>
> inode_lock(inode);
> + ext4_fsgetxattr(inode, &old_fa);
> err = ext4_ioctl_check_project(inode, &fa);
> + if (err)
> + goto out;
> + err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> flags = (ei->i_flags & ~EXT4_FL_XFLAG_VISIBLE) |
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index a969d5497e03..f707de6bd4a8 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2773,19 +2773,26 @@ static inline unsigned long f2fs_xflags_to_iflags(__u32 xflags)
> return iflags;
> }
>
> -static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> +static void __f2fs_ioc_fsgetxattr(struct inode *inode,
> + struct fsxattr *fa)
> {
> - struct inode *inode = file_inode(filp);
> struct f2fs_inode_info *fi = F2FS_I(inode);
> - struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(struct fsxattr));
> - fa.fsx_xflags = f2fs_iflags_to_xflags(fi->i_flags &
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = f2fs_iflags_to_xflags(fi->i_flags &
> F2FS_FL_USER_VISIBLE);
>
> if (f2fs_sb_has_project_quota(F2FS_I_SB(inode)))
> - fa.fsx_projid = (__u32)from_kprojid(&init_user_ns,
> + fa->fsx_projid = (__u32)from_kprojid(&init_user_ns,
> fi->i_projid);
> +}
> +
> +static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> +{
> + struct inode *inode = file_inode(filp);
> + struct fsxattr fa;
> +
> + __f2fs_ioc_fsgetxattr(inode, &fa);
>
> if (copy_to_user((struct fsxattr __user *)arg, &fa, sizeof(fa)))
> return -EFAULT;
> @@ -2820,7 +2827,7 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> struct f2fs_inode_info *fi = F2FS_I(inode);
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> unsigned int flags;
> int err;
>
> @@ -2844,6 +2851,11 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
>
> inode_lock(inode);
> err = f2fs_ioctl_check_project(inode, &fa);
> + if (err)
> + goto out;
> +
> + __f2fs_ioc_fsgetxattr(inode, &old_fa);
> + err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> flags = (fi->i_flags & ~F2FS_FL_XFLAG_VISIBLE) |
> diff --git a/fs/inode.c b/fs/inode.c
> index 0ce60b720608..026955258a47 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2187,3 +2187,20 @@ int vfs_ioc_setflags_check(struct inode *inode, int oldflags, int flags)
> return 0;
> }
> EXPORT_SYMBOL(vfs_ioc_setflags_check);
> +
> +/* Generic function to check FS_IOC_FSSETXATTR values. */
> +int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> + struct fsxattr *fa)
> +{
> + /*
> + * Can't modify an immutable/append-only file unless we have
> + * appropriate permission.
> + */
> + if ((old_fa->fsx_xflags ^ fa->fsx_xflags) &
> + (FS_XFLAG_IMMUTABLE | FS_XFLAG_APPEND) &&
> + !capable(CAP_LINUX_IMMUTABLE))
> + return -EPERM;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(vfs_ioc_fssetxattr_check);
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index d7dfc13f30f5..08c24f2f55c3 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -879,37 +879,45 @@ xfs_di2lxflags(
> return flags;
> }
>
> -STATIC int
> -xfs_ioc_fsgetxattr(
> - xfs_inode_t *ip,
> - int attr,
> - void __user *arg)
> +static void
> +__xfs_ioc_fsgetxattr(
> + struct xfs_inode *ip,
> + bool attr,
> + struct fsxattr *fa)
> {
> - struct fsxattr fa;
> -
> - memset(&fa, 0, sizeof(struct fsxattr));
> -
> - xfs_ilock(ip, XFS_ILOCK_SHARED);
> - fa.fsx_xflags = xfs_ip2xflags(ip);
> - fa.fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
> - fa.fsx_cowextsize = ip->i_d.di_cowextsize <<
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = xfs_ip2xflags(ip);
> + fa->fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
> + fa->fsx_cowextsize = ip->i_d.di_cowextsize <<
> ip->i_mount->m_sb.sb_blocklog;
> - fa.fsx_projid = xfs_get_projid(ip);
> + fa->fsx_projid = xfs_get_projid(ip);
>
> if (attr) {
> if (ip->i_afp) {
> if (ip->i_afp->if_flags & XFS_IFEXTENTS)
> - fa.fsx_nextents = xfs_iext_count(ip->i_afp);
> + fa->fsx_nextents = xfs_iext_count(ip->i_afp);
> else
> - fa.fsx_nextents = ip->i_d.di_anextents;
> + fa->fsx_nextents = ip->i_d.di_anextents;
> } else
> - fa.fsx_nextents = 0;
> + fa->fsx_nextents = 0;
> } else {
> if (ip->i_df.if_flags & XFS_IFEXTENTS)
> - fa.fsx_nextents = xfs_iext_count(&ip->i_df);
> + fa->fsx_nextents = xfs_iext_count(&ip->i_df);
> else
> - fa.fsx_nextents = ip->i_d.di_nextents;
> + fa->fsx_nextents = ip->i_d.di_nextents;
> }
> +}
> +
> +STATIC int
> +xfs_ioc_fsgetxattr(
> + xfs_inode_t *ip,
> + int attr,
> + void __user *arg)
> +{
> + struct fsxattr fa;
> +
> + xfs_ilock(ip, XFS_ILOCK_SHARED);
> + __xfs_ioc_fsgetxattr(ip, attr, &fa);
> xfs_iunlock(ip, XFS_ILOCK_SHARED);
>
> if (copy_to_user(arg, &fa, sizeof(fa)))
> @@ -1035,15 +1043,6 @@ xfs_ioctl_setattr_xflags(
> if ((fa->fsx_xflags & FS_XFLAG_DAX) && xfs_is_reflink_inode(ip))
> return -EINVAL;
>
> - /*
> - * Can't modify an immutable/append-only file unless
> - * we have appropriate permission.
> - */
> - if (((ip->i_d.di_flags & (XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND)) ||
> - (fa->fsx_xflags & (FS_XFLAG_IMMUTABLE | FS_XFLAG_APPEND))) &&
> - !capable(CAP_LINUX_IMMUTABLE))
> - return -EPERM;
> -
> /* diflags2 only valid for v3 inodes. */
> di_flags2 = xfs_flags2diflags2(ip, fa->fsx_xflags);
> if (di_flags2 && ip->i_d.di_version < 3)
> @@ -1323,6 +1322,7 @@ xfs_ioctl_setattr(
> xfs_inode_t *ip,
> struct fsxattr *fa)
> {
> + struct fsxattr old_fa;
> struct xfs_mount *mp = ip->i_mount;
> struct xfs_trans *tp;
> struct xfs_dquot *udqp = NULL;
> @@ -1370,7 +1370,6 @@ xfs_ioctl_setattr(
> goto error_free_dquots;
> }
>
> -
> if (XFS_IS_QUOTA_RUNNING(mp) && XFS_IS_PQUOTA_ON(mp) &&
> xfs_get_projid(ip) != fa->fsx_projid) {
> code = xfs_qm_vop_chown_reserve(tp, ip, udqp, NULL, pdqp,
> @@ -1379,6 +1378,11 @@ xfs_ioctl_setattr(
> goto error_trans_cancel;
> }
>
> + __xfs_ioc_fsgetxattr(ip, false, &old_fa);
> + code = vfs_ioc_fssetxattr_check(VFS_I(ip), &old_fa, fa);
> + if (code)
> + goto error_trans_cancel;
> +
> code = xfs_ioctl_setattr_check_extsize(ip, fa);
> if (code)
> goto error_trans_cancel;
> @@ -1489,6 +1493,7 @@ xfs_ioc_setxflags(
> {
> struct xfs_trans *tp;
> struct fsxattr fa;
> + struct fsxattr old_fa;
> unsigned int flags;
> int join_flags = 0;
> int error;
> @@ -1524,6 +1529,13 @@ xfs_ioc_setxflags(
> goto out_drop_write;
> }
>
> + __xfs_ioc_fsgetxattr(ip, false, &old_fa);
> + error = vfs_ioc_fssetxattr_check(VFS_I(ip), &old_fa, &fa);
> + if (error) {
> + xfs_trans_cancel(tp);
> + goto out_drop_write;
> + }
> +
> error = xfs_ioctl_setattr_xflags(tp, ip, &fa);
> if (error) {
> xfs_trans_cancel(tp);
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 1825d055808c..8dad3c80b611 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -3548,4 +3548,7 @@ static inline struct sock *io_uring_get_socket(struct file *file)
>
> int vfs_ioc_setflags_check(struct inode *inode, int oldflags, int flags);
>
> +int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> + struct fsxattr *fa);
> +
> #endif /* _LINUX_FS_H */
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply
* Re: [Linux-kernel-mentees] [PATCH] Documentation: platform: convert x86-laptop-drivers.txt to reST
From: Shuah Khan @ 2019-06-20 13:38 UTC (permalink / raw)
To: Andy Shevchenko, Puranjay Mohan
Cc: Greg KH, Jonathan Corbet, Cezary Jackiewicz, Darren Hart,
Andy Shevchenko, Linux Documentation List, linux-kernel-mentees,
Linux Kernel Mailing List, Platform Driver, Shuah Khan
In-Reply-To: <CAHp75Vf__EtLVTOf0XvA3w7RPj+bnoQOud3gCXr1Fya0b_o4cw@mail.gmail.com>
On 6/20/19 12:19 AM, Andy Shevchenko wrote:
> On Tue, Jun 18, 2019 at 6:06 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>> On 6/18/19 7:39 AM, Greg KH wrote:
>>> On Tue, Jun 18, 2019 at 07:17:17AM -0600, Jonathan Corbet wrote:
>>>> On Tue, 18 Jun 2019 07:41:58 +0200
>>>> Greg KH <gregkh@linuxfoundation.org> wrote:
>>>>> On Tue, Jun 18, 2019 at 11:02:27AM +0530, Puranjay Mohan wrote:
>
>>> I bet it should be deleted, but we should ask the platform driver
>>> maintainers first before we do that :)
>
>> Adding Platform driver maintainers Darren Hart and Andy Shevchenko, and
>> Compal laptop maintainer Cezary Jackiewicz to the discussion.
>>
>> + platform-driver-x86@vger.kernel.org
>>
>> Hi Darren, Andy, and Cezary,
>>
>> Would it be okay to remove the x86-laptop-drivers.txt or should it be
>> converted to .rst and kept around?
>
> Shuan, thanks for heads up.
> The list of laptops supported by drivers in PDx86 subsystem is quite
> big and growing. The mentioned file contains less than per cent out of
> it and I don't think there is sense to make it up to date with
> thousands lines. Agree on removal.
>
Thanks Andy!
Puranjay!
Please remove the file and cc everybody on this list on the v2 patch.
Make sure to build docs and see if this removal doesn't cause errors.
thanks,
-- Shuah
^ permalink raw reply
* Re: [PATCH 2/4] vfs: create a generic checking function for FS_IOC_FSSETXATTR
From: Jan Kara @ 2019-06-20 13:38 UTC (permalink / raw)
To: Darrick J. Wong
Cc: matthew.garrett, yuchao0, tytso, shaggy, ard.biesheuvel, josef,
clm, adilger.kernel, jk, jack, dsterba, jaegeuk, viro,
cluster-devel, jfs-discussion, linux-efi, reiserfs-devel,
linux-kernel, linux-f2fs-devel, linux-xfs, linux-nilfs, linux-mtd,
ocfs2-devel, linux-fsdevel, linux-ext4, linux-btrfs
In-Reply-To: <156022834894.3227089.18246471175409784122.stgit@magnolia>
On Mon 10-06-19 21:45:49, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Create a generic checking function for the incoming FS_IOC_FSSETXATTR
> fsxattr values so that we can standardize some of the implementation
> behaviors.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
The patch looks good to me. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/btrfs/ioctl.c | 21 +++++++++-------
> fs/ext4/ioctl.c | 27 ++++++++++++++------
> fs/f2fs/file.c | 26 ++++++++++++++-----
> fs/inode.c | 17 +++++++++++++
> fs/xfs/xfs_ioctl.c | 70 ++++++++++++++++++++++++++++++----------------------
> include/linux/fs.h | 3 ++
> 6 files changed, 111 insertions(+), 53 deletions(-)
>
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index f408aa93b0cf..7ddda5b4b6a6 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -366,6 +366,13 @@ static int check_xflags(unsigned int flags)
> return 0;
> }
>
> +static void __btrfs_ioctl_fsgetxattr(struct btrfs_inode *binode,
> + struct fsxattr *fa)
> +{
> + memset(fa, 0, sizeof(*fa));
> + fa->fsx_xflags = btrfs_inode_flags_to_xflags(binode->flags);
> +}
> +
> /*
> * Set the xflags from the internal inode flags. The remaining items of fsxattr
> * are zeroed.
> @@ -375,8 +382,7 @@ static int btrfs_ioctl_fsgetxattr(struct file *file, void __user *arg)
> struct btrfs_inode *binode = BTRFS_I(file_inode(file));
> struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(fa));
> - fa.fsx_xflags = btrfs_inode_flags_to_xflags(binode->flags);
> + __btrfs_ioctl_fsgetxattr(binode, &fa);
>
> if (copy_to_user(arg, &fa, sizeof(fa)))
> return -EFAULT;
> @@ -390,7 +396,7 @@ static int btrfs_ioctl_fssetxattr(struct file *file, void __user *arg)
> struct btrfs_inode *binode = BTRFS_I(inode);
> struct btrfs_root *root = binode->root;
> struct btrfs_trans_handle *trans;
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> unsigned old_flags;
> unsigned old_i_flags;
> int ret = 0;
> @@ -421,13 +427,10 @@ static int btrfs_ioctl_fssetxattr(struct file *file, void __user *arg)
> old_flags = binode->flags;
> old_i_flags = inode->i_flags;
>
> - /* We need the capabilities to change append-only or immutable inode */
> - if (((old_flags & (BTRFS_INODE_APPEND | BTRFS_INODE_IMMUTABLE)) ||
> - (fa.fsx_xflags & (FS_XFLAG_APPEND | FS_XFLAG_IMMUTABLE))) &&
> - !capable(CAP_LINUX_IMMUTABLE)) {
> - ret = -EPERM;
> + __btrfs_ioctl_fsgetxattr(binode, &old_fa);
> + ret = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> + if (ret)
> goto out_unlock;
> - }
>
> if (fa.fsx_xflags & FS_XFLAG_SYNC)
> binode->flags |= BTRFS_INODE_SYNC;
> diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
> index 5126ee351a84..c2f48c90ca45 100644
> --- a/fs/ext4/ioctl.c
> +++ b/fs/ext4/ioctl.c
> @@ -721,6 +721,19 @@ static int ext4_ioctl_check_project(struct inode *inode, struct fsxattr *fa)
> return 0;
> }
>
> +static void ext4_fsgetxattr(struct inode *inode, struct fsxattr *fa)
> +{
> + struct ext4_inode_info *ei = EXT4_I(inode);
> +
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = ext4_iflags_to_xflags(ei->i_flags & EXT4_FL_USER_VISIBLE);
> +
> + if (ext4_has_feature_project(inode->i_sb)) {
> + fa->fsx_projid = (__u32)from_kprojid(&init_user_ns,
> + ei->i_projid);
> + }
> +}
> +
> long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> @@ -1089,13 +1102,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> {
> struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(struct fsxattr));
> - fa.fsx_xflags = ext4_iflags_to_xflags(ei->i_flags & EXT4_FL_USER_VISIBLE);
> -
> - if (ext4_has_feature_project(inode->i_sb)) {
> - fa.fsx_projid = (__u32)from_kprojid(&init_user_ns,
> - EXT4_I(inode)->i_projid);
> - }
> + ext4_fsgetxattr(inode, &fa);
>
> if (copy_to_user((struct fsxattr __user *)arg,
> &fa, sizeof(fa)))
> @@ -1104,7 +1111,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> }
> case EXT4_IOC_FSSETXATTR:
> {
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> int err;
>
> if (copy_from_user(&fa, (struct fsxattr __user *)arg,
> @@ -1127,7 +1134,11 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> return err;
>
> inode_lock(inode);
> + ext4_fsgetxattr(inode, &old_fa);
> err = ext4_ioctl_check_project(inode, &fa);
> + if (err)
> + goto out;
> + err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> flags = (ei->i_flags & ~EXT4_FL_XFLAG_VISIBLE) |
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index a969d5497e03..f707de6bd4a8 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -2773,19 +2773,26 @@ static inline unsigned long f2fs_xflags_to_iflags(__u32 xflags)
> return iflags;
> }
>
> -static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> +static void __f2fs_ioc_fsgetxattr(struct inode *inode,
> + struct fsxattr *fa)
> {
> - struct inode *inode = file_inode(filp);
> struct f2fs_inode_info *fi = F2FS_I(inode);
> - struct fsxattr fa;
>
> - memset(&fa, 0, sizeof(struct fsxattr));
> - fa.fsx_xflags = f2fs_iflags_to_xflags(fi->i_flags &
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = f2fs_iflags_to_xflags(fi->i_flags &
> F2FS_FL_USER_VISIBLE);
>
> if (f2fs_sb_has_project_quota(F2FS_I_SB(inode)))
> - fa.fsx_projid = (__u32)from_kprojid(&init_user_ns,
> + fa->fsx_projid = (__u32)from_kprojid(&init_user_ns,
> fi->i_projid);
> +}
> +
> +static int f2fs_ioc_fsgetxattr(struct file *filp, unsigned long arg)
> +{
> + struct inode *inode = file_inode(filp);
> + struct fsxattr fa;
> +
> + __f2fs_ioc_fsgetxattr(inode, &fa);
>
> if (copy_to_user((struct fsxattr __user *)arg, &fa, sizeof(fa)))
> return -EFAULT;
> @@ -2820,7 +2827,7 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
> {
> struct inode *inode = file_inode(filp);
> struct f2fs_inode_info *fi = F2FS_I(inode);
> - struct fsxattr fa;
> + struct fsxattr fa, old_fa;
> unsigned int flags;
> int err;
>
> @@ -2844,6 +2851,11 @@ static int f2fs_ioc_fssetxattr(struct file *filp, unsigned long arg)
>
> inode_lock(inode);
> err = f2fs_ioctl_check_project(inode, &fa);
> + if (err)
> + goto out;
> +
> + __f2fs_ioc_fsgetxattr(inode, &old_fa);
> + err = vfs_ioc_fssetxattr_check(inode, &old_fa, &fa);
> if (err)
> goto out;
> flags = (fi->i_flags & ~F2FS_FL_XFLAG_VISIBLE) |
> diff --git a/fs/inode.c b/fs/inode.c
> index 0ce60b720608..026955258a47 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2187,3 +2187,20 @@ int vfs_ioc_setflags_check(struct inode *inode, int oldflags, int flags)
> return 0;
> }
> EXPORT_SYMBOL(vfs_ioc_setflags_check);
> +
> +/* Generic function to check FS_IOC_FSSETXATTR values. */
> +int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> + struct fsxattr *fa)
> +{
> + /*
> + * Can't modify an immutable/append-only file unless we have
> + * appropriate permission.
> + */
> + if ((old_fa->fsx_xflags ^ fa->fsx_xflags) &
> + (FS_XFLAG_IMMUTABLE | FS_XFLAG_APPEND) &&
> + !capable(CAP_LINUX_IMMUTABLE))
> + return -EPERM;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(vfs_ioc_fssetxattr_check);
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index d7dfc13f30f5..08c24f2f55c3 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -879,37 +879,45 @@ xfs_di2lxflags(
> return flags;
> }
>
> -STATIC int
> -xfs_ioc_fsgetxattr(
> - xfs_inode_t *ip,
> - int attr,
> - void __user *arg)
> +static void
> +__xfs_ioc_fsgetxattr(
> + struct xfs_inode *ip,
> + bool attr,
> + struct fsxattr *fa)
> {
> - struct fsxattr fa;
> -
> - memset(&fa, 0, sizeof(struct fsxattr));
> -
> - xfs_ilock(ip, XFS_ILOCK_SHARED);
> - fa.fsx_xflags = xfs_ip2xflags(ip);
> - fa.fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
> - fa.fsx_cowextsize = ip->i_d.di_cowextsize <<
> + memset(fa, 0, sizeof(struct fsxattr));
> + fa->fsx_xflags = xfs_ip2xflags(ip);
> + fa->fsx_extsize = ip->i_d.di_extsize << ip->i_mount->m_sb.sb_blocklog;
> + fa->fsx_cowextsize = ip->i_d.di_cowextsize <<
> ip->i_mount->m_sb.sb_blocklog;
> - fa.fsx_projid = xfs_get_projid(ip);
> + fa->fsx_projid = xfs_get_projid(ip);
>
> if (attr) {
> if (ip->i_afp) {
> if (ip->i_afp->if_flags & XFS_IFEXTENTS)
> - fa.fsx_nextents = xfs_iext_count(ip->i_afp);
> + fa->fsx_nextents = xfs_iext_count(ip->i_afp);
> else
> - fa.fsx_nextents = ip->i_d.di_anextents;
> + fa->fsx_nextents = ip->i_d.di_anextents;
> } else
> - fa.fsx_nextents = 0;
> + fa->fsx_nextents = 0;
> } else {
> if (ip->i_df.if_flags & XFS_IFEXTENTS)
> - fa.fsx_nextents = xfs_iext_count(&ip->i_df);
> + fa->fsx_nextents = xfs_iext_count(&ip->i_df);
> else
> - fa.fsx_nextents = ip->i_d.di_nextents;
> + fa->fsx_nextents = ip->i_d.di_nextents;
> }
> +}
> +
> +STATIC int
> +xfs_ioc_fsgetxattr(
> + xfs_inode_t *ip,
> + int attr,
> + void __user *arg)
> +{
> + struct fsxattr fa;
> +
> + xfs_ilock(ip, XFS_ILOCK_SHARED);
> + __xfs_ioc_fsgetxattr(ip, attr, &fa);
> xfs_iunlock(ip, XFS_ILOCK_SHARED);
>
> if (copy_to_user(arg, &fa, sizeof(fa)))
> @@ -1035,15 +1043,6 @@ xfs_ioctl_setattr_xflags(
> if ((fa->fsx_xflags & FS_XFLAG_DAX) && xfs_is_reflink_inode(ip))
> return -EINVAL;
>
> - /*
> - * Can't modify an immutable/append-only file unless
> - * we have appropriate permission.
> - */
> - if (((ip->i_d.di_flags & (XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND)) ||
> - (fa->fsx_xflags & (FS_XFLAG_IMMUTABLE | FS_XFLAG_APPEND))) &&
> - !capable(CAP_LINUX_IMMUTABLE))
> - return -EPERM;
> -
> /* diflags2 only valid for v3 inodes. */
> di_flags2 = xfs_flags2diflags2(ip, fa->fsx_xflags);
> if (di_flags2 && ip->i_d.di_version < 3)
> @@ -1323,6 +1322,7 @@ xfs_ioctl_setattr(
> xfs_inode_t *ip,
> struct fsxattr *fa)
> {
> + struct fsxattr old_fa;
> struct xfs_mount *mp = ip->i_mount;
> struct xfs_trans *tp;
> struct xfs_dquot *udqp = NULL;
> @@ -1370,7 +1370,6 @@ xfs_ioctl_setattr(
> goto error_free_dquots;
> }
>
> -
> if (XFS_IS_QUOTA_RUNNING(mp) && XFS_IS_PQUOTA_ON(mp) &&
> xfs_get_projid(ip) != fa->fsx_projid) {
> code = xfs_qm_vop_chown_reserve(tp, ip, udqp, NULL, pdqp,
> @@ -1379,6 +1378,11 @@ xfs_ioctl_setattr(
> goto error_trans_cancel;
> }
>
> + __xfs_ioc_fsgetxattr(ip, false, &old_fa);
> + code = vfs_ioc_fssetxattr_check(VFS_I(ip), &old_fa, fa);
> + if (code)
> + goto error_trans_cancel;
> +
> code = xfs_ioctl_setattr_check_extsize(ip, fa);
> if (code)
> goto error_trans_cancel;
> @@ -1489,6 +1493,7 @@ xfs_ioc_setxflags(
> {
> struct xfs_trans *tp;
> struct fsxattr fa;
> + struct fsxattr old_fa;
> unsigned int flags;
> int join_flags = 0;
> int error;
> @@ -1524,6 +1529,13 @@ xfs_ioc_setxflags(
> goto out_drop_write;
> }
>
> + __xfs_ioc_fsgetxattr(ip, false, &old_fa);
> + error = vfs_ioc_fssetxattr_check(VFS_I(ip), &old_fa, &fa);
> + if (error) {
> + xfs_trans_cancel(tp);
> + goto out_drop_write;
> + }
> +
> error = xfs_ioctl_setattr_xflags(tp, ip, &fa);
> if (error) {
> xfs_trans_cancel(tp);
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 1825d055808c..8dad3c80b611 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -3548,4 +3548,7 @@ static inline struct sock *io_uring_get_socket(struct file *file)
>
> int vfs_ioc_setflags_check(struct inode *inode, int oldflags, int flags);
>
> +int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
> + struct fsxattr *fa);
> +
> #endif /* _LINUX_FS_H */
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.