WARNING: line length of 88 exceeds 80 columns #69: FILE: include/linux/bpf_verifier.h:731: + /* call sites from bpf_verifier_state->frame[*]->callsite leading to this SCC */ CHECK: Logical continuations should be on the previous line #144: FILE: kernel/bpf/verifier.c:1716: + if (!sl->in_free_list + || sl->state.branches != 0 CHECK: Logical continuations should be on the previous line #145: FILE: kernel/bpf/verifier.c:1717: + || sl->state.branches != 0 + || incomplete_read_marks(env, &sl->state)) WARNING: line length of 82 exceeds 80 columns #204: FILE: kernel/bpf/verifier.c:2009: + struct bpf_scc_callchain *callchain) WARNING: line length of 85 exceeds 80 columns #213: FILE: kernel/bpf/verifier.c:2018: + if (memcmp(callchain, &visits[i].callchain, sizeof(*callchain)) == 0) WARNING: line length of 81 exceeds 80 columns #223: FILE: kernel/bpf/verifier.c:2028: + struct bpf_scc_callchain *callchain) WARNING: line length of 81 exceeds 80 columns #233: FILE: kernel/bpf/verifier.c:2038: + new_sz = sizeof(*info) + sizeof(struct bpf_scc_visit) * (num_visits + 1); WARNING: line length of 96 exceeds 80 columns #246: FILE: kernel/bpf/verifier.c:2051: +static char *format_callchain(struct bpf_verifier_env *env, struct bpf_scc_callchain *callchain) WARNING: line length of 87 exceeds 80 columns #258: FILE: kernel/bpf/verifier.c:2063: + delta += snprintf(buf + delta, TMP_STR_BUF_LEN - delta, "%u)", callchain->scc); WARNING: line length of 87 exceeds 80 columns #266: FILE: kernel/bpf/verifier.c:2071: +static int maybe_enter_scc(struct bpf_verifier_env *env, struct bpf_verifier_state *st) WARNING: line length of 90 exceeds 80 columns #280: FILE: kernel/bpf/verifier.c:2085: + verbose(env, "SCC enter %s\n", format_callchain(env, &callchain)); WARNING: line length of 90 exceeds 80 columns #285: FILE: kernel/bpf/verifier.c:2090: +static int propagate_backedges(struct bpf_verifier_env *env, struct bpf_scc_visit *visit); WARNING: line length of 86 exceeds 80 columns #291: FILE: kernel/bpf/verifier.c:2096: +static int maybe_exit_scc(struct bpf_verifier_env *env, struct bpf_verifier_state *st) WARNING: line length of 81 exceeds 80 columns #307: FILE: kernel/bpf/verifier.c:2112: + verbose(env, "SCC exit %s\n", format_callchain(env, &callchain)); WARNING: line length of 91 exceeds 80 columns #323: FILE: kernel/bpf/verifier.c:2128: + verifier_bug(env, "add backedge: no SCC in verification path, insn_idx %d", WARNING: line length of 82 exceeds 80 columns #329: FILE: kernel/bpf/verifier.c:2134: + verifier_bug(env, "add backedge: no visit info for call chain %s", WARNING: line length of 85 exceeds 80 columns #334: FILE: kernel/bpf/verifier.c:2139: + verbose(env, "SCC backedge %s\n", format_callchain(env, &callchain)); WARNING: line length of 92 exceeds 80 columns #370: FILE: kernel/bpf/verifier.c:2175: +static int update_branch_counts(struct bpf_verifier_env *env, struct bpf_verifier_state *st) WARNING: line length of 81 exceeds 80 columns #449: FILE: kernel/bpf/verifier.c:19149: +/* Propagate read and precision marks from visit->backedges[*].state->equal_state WARNING: line length of 92 exceeds 80 columns #450: FILE: kernel/bpf/verifier.c:19150: + * to corresponding parent states of visit->backedges[*].state until fixed point is reached, WARNING: line length of 89 exceeds 80 columns #455: FILE: kernel/bpf/verifier.c:19155: +static int propagate_backedges(struct bpf_verifier_env *env, struct bpf_scc_visit *visit) WARNING: line length of 84 exceeds 80 columns #466: FILE: kernel/bpf/verifier.c:19166: + verbose(env, "%s: too many iterations\n", __func__); WARNING: line length of 94 exceeds 80 columns #467: FILE: kernel/bpf/verifier.c:19167: + for (backedge = visit->backedges; backedge; backedge = backedge->next) WARNING: line length of 88 exceeds 80 columns #472: FILE: kernel/bpf/verifier.c:19172: + for (backedge = visit->backedges; backedge; backedge = backedge->next) { WARNING: line length of 85 exceeds 80 columns #474: FILE: kernel/bpf/verifier.c:19174: + err = propagate_liveness(env, st->equal_state, st, &changed); WARNING: line length of 86 exceeds 80 columns #477: FILE: kernel/bpf/verifier.c:19177: + err = propagate_precision(env, st->equal_state, st, &changed); WARNING: line length of 90 exceeds 80 columns #566: FILE: kernel/bpf/verifier.c:19453: + if (states_equal(env, &sl->state, cur, loop ? RANGE_WITHIN : NOT_EXACT)) { WARNING: line length of 92 exceeds 80 columns #574: FILE: kernel/bpf/verifier.c:19478: + /* When processing iterator based loops above propagate_liveness and WARNING: line length of 96 exceeds 80 columns #575: FILE: kernel/bpf/verifier.c:19479: + * propagate_precision calls are not sufficient to transfer all relevant WARNING: line length of 86 exceeds 80 columns #576: FILE: kernel/bpf/verifier.c:19480: + * read and precision marks. E.g. consider the following case: WARNING: line length of 90 exceeds 80 columns #578: FILE: kernel/bpf/verifier.c:19482: + * .-> A --. Assume the states are visited in the order A, B, C. WARNING: line length of 97 exceeds 80 columns #579: FILE: kernel/bpf/verifier.c:19483: + * | | | Assume that state B reaches a state equivalent to state A. WARNING: line length of 94 exceeds 80 columns #580: FILE: kernel/bpf/verifier.c:19484: + * | v v At this point, state C is not processed yet, so state A WARNING: line length of 91 exceeds 80 columns #581: FILE: kernel/bpf/verifier.c:19485: + * '-- B C has not received any read or precision marks from C. WARNING: line length of 89 exceeds 80 columns #582: FILE: kernel/bpf/verifier.c:19486: + * Thus, marks propagated from A to B are incomplete. WARNING: line length of 89 exceeds 80 columns #584: FILE: kernel/bpf/verifier.c:19488: + * The verifier mitigates this by performing the following steps: WARNING: line length of 95 exceeds 80 columns #586: FILE: kernel/bpf/verifier.c:19490: + * - Prior to the main verification pass, strongly connected components WARNING: line length of 87 exceeds 80 columns #587: FILE: kernel/bpf/verifier.c:19491: + * (SCCs) are computed over the program's control flow graph, WARNING: line length of 90 exceeds 80 columns #590: FILE: kernel/bpf/verifier.c:19494: + * - During the main verification pass, `maybe_enter_scc()` checks WARNING: line length of 93 exceeds 80 columns #591: FILE: kernel/bpf/verifier.c:19495: + * whether the current verifier state is entering an SCC. If so, an WARNING: line length of 91 exceeds 80 columns #592: FILE: kernel/bpf/verifier.c:19496: + * instance of a `bpf_scc_visit` object is created, and the state WARNING: line length of 92 exceeds 80 columns #595: FILE: kernel/bpf/verifier.c:19499: + * - This instance is associated not with the SCC itself, but with a WARNING: line length of 97 exceeds 80 columns #596: FILE: kernel/bpf/verifier.c:19500: + * `bpf_scc_callchain`: a tuple consisting of the call sites leading to WARNING: line length of 83 exceeds 80 columns #597: FILE: kernel/bpf/verifier.c:19501: + * the SCC and the SCC id. See `compute_scc_callchain()`. WARNING: line length of 85 exceeds 80 columns #599: FILE: kernel/bpf/verifier.c:19503: + * - When a verification path encounters a `states_equal(..., WARNING: line length of 95 exceeds 80 columns #600: FILE: kernel/bpf/verifier.c:19504: + * RANGE_WITHIN)` condition, there exists a call chain describing the WARNING: line length of 95 exceeds 80 columns #601: FILE: kernel/bpf/verifier.c:19505: + * current state and a corresponding `bpf_scc_visit` instance. A copy WARNING: line length of 94 exceeds 80 columns #605: FILE: kernel/bpf/verifier.c:19509: + * - When a verification path terminates, `maybe_exit_scc()` is called WARNING: line length of 95 exceeds 80 columns #606: FILE: kernel/bpf/verifier.c:19510: + * from `update_branch_counts()`. For states with `branches == 0`, it WARNING: line length of 95 exceeds 80 columns #607: FILE: kernel/bpf/verifier.c:19511: + * checks whether the state is the entry state of any `bpf_scc_visit` WARNING: line length of 95 exceeds 80 columns #608: FILE: kernel/bpf/verifier.c:19512: + * instance. If it is, this indicates that all paths originating from WARNING: line length of 95 exceeds 80 columns #609: FILE: kernel/bpf/verifier.c:19513: + * this SCC visit have been explored. `propagate_backedges()` is then WARNING: line length of 90 exceeds 80 columns #610: FILE: kernel/bpf/verifier.c:19514: + * called, which propagates read and precision marks through the WARNING: line length of 93 exceeds 80 columns #612: FILE: kernel/bpf/verifier.c:19516: + * (In the earlier example, this would propagate marks from A to B, WARNING: line length of 84 exceeds 80 columns #627: FILE: kernel/bpf/verifier.c:19531: + * Here, there are two distinct callchains leading to SCC#1: WARNING: line length of 93 exceeds 80 columns #631: FILE: kernel/bpf/verifier.c:19535: + * Each callchain identifies a separate `bpf_scc_visit` instance that WARNING: line length of 94 exceeds 80 columns #632: FILE: kernel/bpf/verifier.c:19536: + * accumulates backedge states. The `propagate_{liveness,precision}()` WARNING: line length of 92 exceeds 80 columns #633: FILE: kernel/bpf/verifier.c:19537: + * functions traverse the parent state of each backedge state, which WARNING: line length of 94 exceeds 80 columns #634: FILE: kernel/bpf/verifier.c:19538: + * means these parent states must remain valid (i.e., not freed) while WARNING: line length of 94 exceeds 80 columns #637: FILE: kernel/bpf/verifier.c:19541: + * Associating `bpf_scc_visit` instances directly with SCCs instead of WARNING: line length of 92 exceeds 80 columns #639: FILE: kernel/bpf/verifier.c:19543: + * - States explored during `C: foo()` would contribute backedges to WARNING: line length of 90 exceeds 80 columns #640: FILE: kernel/bpf/verifier.c:19544: + * SCC#1, but SCC#1 would only be exited once the exploration of WARNING: line length of 96 exceeds 80 columns #642: FILE: kernel/bpf/verifier.c:19546: + * - By that time, the states explored between `A: foo()` and `C: foo()` WARNING: line length of 93 exceeds 80 columns #643: FILE: kernel/bpf/verifier.c:19547: + * (i.e., `B: ...`) may have already been freed, causing the parent WARNING: line length of 82 exceeds 80 columns #649: FILE: kernel/bpf/verifier.c:19553: + backedge = kzalloc(sizeof(*backedge), GFP_KERNEL); WARNING: line length of 81 exceeds 80 columns #652: FILE: kernel/bpf/verifier.c:19556: + err = copy_verifier_state(&backedge->state, cur); WARNING: line length of 89 exceeds 80 columns #655: FILE: kernel/bpf/verifier.c:19559: + err = err ?: add_scc_backedge(env, &sl->state, backedge); WARNING: line length of 85 exceeds 80 columns #657: FILE: kernel/bpf/verifier.c:19561: + free_verifier_state(&backedge->state, false); WARNING: line length of 82 exceeds 80 columns #728: FILE: kernel/bpf/verifier.c:24452: + env->scc_info = kvcalloc(next_scc_id, sizeof(*env->scc_info), GFP_KERNEL); total: 0 errors, 67 warnings, 2 checks, 662 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit dcf6d4a8e3f5 ("bpf: propagate read/precision marks over state graph backedges") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 67 warnings, 2 checks, 662 lines checked