[linux-yocto] [PATCH] aufs: fix "dynamic" goto "sibling call"

Bruce Ashfield bruce.ashfield at windriver.com
Wed Nov 7 14:07:19 PST 2018


On 2018-11-06 1:00 p.m., Mark Asselstine wrote:
> If you build with CONFIG_STACK_VALIDATION you will get
> 
>    CC      fs/aufs/cpup.o
>    fs/aufs/cpup.o: warning: objtool: au_cp_regular()+0x24c: sibling call from callable instruction with modified stack frame
> 
> As stated in tools/objtool/Documentation/stack-validation.txt the use
> of "Dynamic jumps and jumps to undefined symbols" has several
> conditions, neither of which we meet. The use of .label to dictate
> which label we 'goto' can be implemented in several ways that will be
> 'safe' from the stack validation point of view. Here we drop the
> .label and instead are able to use the .flags to decide which label to
> goto. This results in the same end result while ensuring we are a good
> citizen with respect to the stack validation.
> 
> Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
> ---
> 
> This has been sent to the aufs-users ML and will hopefully be merged
> upstream for upcoming releases. This patch is created for 4.18.y but
> should apply (with possibly some fuzz) to 4.19.x.

merged.

Bruce

> 
>   fs/aufs/cpup.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c
> index 93d6496aaf68..9a77b1217933 100644
> --- a/fs/aufs/cpup.c
> +++ b/fs/aufs/cpup.c
> @@ -438,13 +438,11 @@ static int au_cp_regular(struct au_cp_generic *cpg)
>   		{
>   			.bindex = cpg->bsrc,
>   			.flags = O_RDONLY | O_NOATIME | O_LARGEFILE,
> -			.label = &&out
>   		},
>   		{
>   			.bindex = cpg->bdst,
>   			.flags = O_WRONLY | O_NOATIME | O_LARGEFILE,
>   			.force_wr = !!au_ftest_cpup(cpg->flags, RWDST),
> -			.label = &&out_src
>   		}
>   	};
>   	struct super_block *sb, *h_src_sb;
> @@ -459,8 +457,12 @@ static int au_cp_regular(struct au_cp_generic *cpg)
>   		f->file = au_h_open(cpg->dentry, f->bindex, f->flags,
>   				    /*file*/NULL, f->force_wr);
>   		err = PTR_ERR(f->file);
> -		if (IS_ERR(f->file))
> -			goto *f->label;
> +		if (IS_ERR(f->file)) {
> +			if (f->flags & O_RDONLY)
> +				goto out;
> +			else
> +				goto out_src;
> +		}
>   	}
>   
>   	/* try stopping to update while we copyup */
> 



More information about the linux-yocto mailing list