ACK: [SRU][Xenial][PATCH] UBUNTU: SAUCE: Add missing hunks from "bpf: fix branch pruning logic"

Stefan Bader stefan.bader at canonical.com
Fri Apr 13 14:14:54 UTC 2018


On 13.04.2018 14:21, Seth Forshee wrote:
> BugLink: http://bugs.launchpad.net/bugs/1763454
> 
> At the time this commit was backported some of the code it
> modifies was not present. When the code was later introduced from
> upstream stable it did not get the changes from this commit.
> Backport those changes now.
> 
> Signed-off-by: Seth Forshee <seth.forshee at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>

> ---
>  kernel/bpf/verifier.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 8a40719c6ae5..c2b2743cec83 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -2005,6 +2005,7 @@ process_bpf_exit:
>  					return err;
>  
>  				insn_idx++;
> +				env->insn_aux_data[insn_idx].seen = true;
>  			} else {
>  				verbose("invalid BPF_LD mode\n");
>  				return -EINVAL;
> @@ -2161,6 +2162,7 @@ static int adjust_insn_aux_data(struct verifier_env *env, u32 prog_len,
>  				u32 off, u32 cnt)
>  {
>  	struct bpf_insn_aux_data *new_data, *old_data = env->insn_aux_data;
> +	int i;
>  
>  	if (cnt == 1)
>  		return 0;
> @@ -2170,6 +2172,8 @@ static int adjust_insn_aux_data(struct verifier_env *env, u32 prog_len,
>  	memcpy(new_data, old_data, sizeof(struct bpf_insn_aux_data) * off);
>  	memcpy(new_data + off + cnt - 1, old_data + off,
>  	       sizeof(struct bpf_insn_aux_data) * (prog_len - off - cnt + 1));
> +	for (i = off; i < off + cnt - 1; i++)
> +		new_data[i].seen = true;
>  	env->insn_aux_data = new_data;
>  	vfree(old_data);
>  	return 0;
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20180413/d50b20e2/attachment.sig>


More information about the kernel-team mailing list