From patchwork Fri Apr 13 12:21:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 897927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 40Mxhb0Qn2z9s0x; Fri, 13 Apr 2018 22:21:19 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1f6xha-0002bW-2T; Fri, 13 Apr 2018 12:21:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1f6xhX-0002at-TB for kernel-team@lists.ubuntu.com; Fri, 13 Apr 2018 12:21:11 +0000 Received: from mail-it0-f72.google.com ([209.85.214.72]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1f6xhX-0000dp-Iw for kernel-team@lists.ubuntu.com; Fri, 13 Apr 2018 12:21:11 +0000 Received: by mail-it0-f72.google.com with SMTP id o66-v6so2084764ita.3 for ; Fri, 13 Apr 2018 05:21:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=+LNAT/vBcJibgKYRgphVbz3Vh+EpiStuRbnwvdPL2EY=; b=dv0s+oNjmqAHapFFnplHdUkShNIqNADnE0Qs/Dz3Yx95K46TMSufbq+j1ZOBRz9gIP rBa48rSoGw7xO/n3Shkh4ApuyIP95DBRVVE/Uhga9z7SC8bP3s4u1kTuM5G60aX9rQ3K 5B5y2CqKMe35GsLED4gIb/wL0p/wurNGxjFRIOYEAvYC7lHcRTL/ZTj/EFPOWeQc/iIR zuMYmX7ucqpkzsoCfnz1yROYTiMKNU4YPd/dFjsosvf7kfe5fD9Pyma67xrYNli3n/AP h4oe6vU/csBQAvBKMXi/EvGNZNofNbL1pnv8Jbn0OttK+NjzgUnsInlawni8+UnPYu7N ud5A== X-Gm-Message-State: ALQs6tBGho6nrn3W1ikh3MW4dXln2WSmLEDVUWm320VyLuqefeOvFMUm 5ebtOh48zTwgqlBlB6lgZx78UB4++CG7/4+uoBWTgviDHXGUDXtQrlDtCj1ix325Hh1zJxrHOjj ssT8F0H2V+JpN+7Z3wDN2ybFaorenIBzj4sWVlw+M0w== X-Received: by 2002:a24:2b0b:: with SMTP id h11-v6mr5091462ita.68.1523622070318; Fri, 13 Apr 2018 05:21:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx486Cz2Xv0p9PHCpkmaHUoOm6lKiNz4OnxZgv/omJt3sPfs9IvuFhjOylg1F1rUemK6prPTj7g== X-Received: by 2002:a24:2b0b:: with SMTP id h11-v6mr5091436ita.68.1523622069853; Fri, 13 Apr 2018 05:21:09 -0700 (PDT) Received: from localhost ([2605:a601:ac6:1720:e547:b48d:257f:7b61]) by smtp.gmail.com with ESMTPSA id e9sm14613iob.22.2018.04.13.05.21.08 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Apr 2018 05:21:08 -0700 (PDT) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [SRU][Xenial][PATCH] UBUNTU: SAUCE: Add missing hunks from "bpf: fix branch pruning logic" Date: Fri, 13 Apr 2018 07:21:08 -0500 Message-Id: <20180413122108.871-1-seth.forshee@canonical.com> X-Mailer: git-send-email 2.15.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" 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 Acked-by: Colin Ian King Acked-by: Stefan Bader --- 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;