All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: viro@zeniv.linux.org.uk, tytso@mit.edu, adilger.kernel@dilger.ca,
	clm@fb.com, jbacik@fb.com, dsterba@suse.com, sandeen@sandeen.net,
	dhowells@redhat.com, fliu@suse.com, jack@suse.cz, jeffm@suse.com,
	nborisov@suse.com, jake.norris@suse.com, mtk.manpages@gmail.com,
	linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC v2 2/4] xfs: add verifier check for symlink with append/immutable flags
Date: Thu, 10 May 2018 19:20:20 -0700	[thread overview]
Message-ID: <20180511022020.GG11261@magnolia> (raw)
In-Reply-To: <20180510231359.16899-3-mcgrof@kernel.org>

On Thu, May 10, 2018 at 04:13:57PM -0700, Luis R. Rodriguez wrote:
> The Linux VFS does not allow a way to set append/immuttable attributes
> to symlinks, this is just not possible. If this is detected we can
> correct this with xfs_repair, so inform the user.
> 
> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
> ---
>  fs/xfs/libxfs/xfs_symlink_remote.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/fs/xfs/libxfs/xfs_symlink_remote.c b/fs/xfs/libxfs/xfs_symlink_remote.c
> index 5ef5f354587e..42dd81ede3d6 100644
> --- a/fs/xfs/libxfs/xfs_symlink_remote.c
> +++ b/fs/xfs/libxfs/xfs_symlink_remote.c
> @@ -242,5 +242,10 @@ xfs_symlink_shortform_verify(
>  	/* We /did/ null-terminate the buffer, right? */
>  	if (*endp != 0)
>  		return __this_address;
> +
> +	/* Immutable and append flags are not allowed on symlinks */
> +	if (ip->i_d.di_flags & (XFS_DIFLAG_APPEND | XFS_DIFLAG_IMMUTABLE))
> +		return __this_address;

This belongs in xfs_dinode_verify so that it checks all symlinks, not
just the one shortform ones.

--D

> +
>  	return NULL;
>  }
> -- 
> 2.17.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-05-11  2:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 23:13 [RFC v2 0/4] vfs: detect symlink corruption with attributes Luis R. Rodriguez
2018-05-10 23:13 ` [RFC v2 1/4] vfs: skip extra attributes check on removal for symlinks Luis R. Rodriguez
2018-05-10 23:13 ` [RFC v2 2/4] xfs: add verifier check for symlink with append/immutable flags Luis R. Rodriguez
2018-05-11  2:20   ` Darrick J. Wong [this message]
2018-05-10 23:13 ` [RFC v2 3/4] ext4: " Luis R. Rodriguez
2018-05-11 21:12   ` Jan Kara
2018-05-13 20:51     ` Theodore Y. Ts'o
2018-05-10 23:13 ` [RFC v2 4/4] btrfs: verify symlinks " Luis R. Rodriguez
2018-05-11 14:04   ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180511022020.GG11261@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=clm@fb.com \
    --cc=dhowells@redhat.com \
    --cc=dsterba@suse.com \
    --cc=fliu@suse.com \
    --cc=jack@suse.cz \
    --cc=jake.norris@suse.com \
    --cc=jbacik@fb.com \
    --cc=jeffm@suse.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=nborisov@suse.com \
    --cc=sandeen@sandeen.net \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.