WARNING: line length of 88 exceeds 80 columns #69: FILE: include/linux/bpf_verifier.h:732: + /* 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:1717: + if (!sl->in_free_list + || sl->state.branches != 0 CHECK: Logical continuations should be on the previous line #145: FILE: kernel/bpf/verifier.c:1718: + || sl->state.branches != 0 + || incomplete_read_marks(env, &sl->state)) WARNING: line length of 82 exceeds 80 columns #204: FILE: kernel/bpf/verifier.c:2010: + struct bpf_scc_callchain *callchain) WARNING: line length of 85 exceeds 80 columns #213: FILE: kernel/bpf/verifier.c:2019: + if (memcmp(callchain, &visits[i].callchain, sizeof(*callchain)) == 0) WARNING: line length of 81 exceeds 80 columns #223: FILE: kernel/bpf/verifier.c:2029: + struct bpf_scc_callchain *callchain) WARNING: line length of 81 exceeds 80 columns #233: FILE: kernel/bpf/verifier.c:2039: + 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:2052: +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:2064: + 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:2072: +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:2086: + verbose(env, "SCC enter %s\n", format_callchain(env, &callchain)); WARNING: line length of 90 exceeds 80 columns #285: FILE: kernel/bpf/verifier.c:2091: +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:2097: +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:2113: + verbose(env, "SCC exit %s\n", format_callchain(env, &callchain)); WARNING: line length of 91 exceeds 80 columns #323: FILE: kernel/bpf/verifier.c:2129: + 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:2135: + 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:2140: + verbose(env, "SCC backedge %s\n", format_callchain(env, &callchain)); WARNING: line length of 92 exceeds 80 columns #370: FILE: kernel/bpf/verifier.c:2176: +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:19164: +/* 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:19165: + * 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:19170: +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:19181: + verbose(env, "%s: too many iterations\n", __func__); WARNING: line length of 94 exceeds 80 columns #467: FILE: kernel/bpf/verifier.c:19182: + for (backedge = visit->backedges; backedge; backedge = backedge->next) WARNING: line length of 88 exceeds 80 columns #472: FILE: kernel/bpf/verifier.c:19187: + for (backedge = visit->backedges; backedge; backedge = backedge->next) { WARNING: line length of 85 exceeds 80 columns #474: FILE: kernel/bpf/verifier.c:19189: + err = propagate_liveness(env, st->equal_state, st, &changed); WARNING: line length of 86 exceeds 80 columns #477: FILE: kernel/bpf/verifier.c:19192: + err = propagate_precision(env, st->equal_state, st, &changed); WARNING: line length of 90 exceeds 80 columns #566: FILE: kernel/bpf/verifier.c:19468: + 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:19493: + /* When processing iterator based loops above propagate_liveness and WARNING: line length of 96 exceeds 80 columns #575: FILE: kernel/bpf/verifier.c:19494: + * propagate_precision calls are not sufficient to transfer all relevant WARNING: line length of 86 exceeds 80 columns #576: FILE: kernel/bpf/verifier.c:19495: + * read and precision marks. E.g. consider the following case: WARNING: line length of 90 exceeds 80 columns #578: FILE: kernel/bpf/verifier.c:19497: + * .-> 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:19498: + * | | | 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:19499: + * | 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:19500: + * '-- 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:19501: + * Thus, marks propagated from A to B are incomplete. WARNING: line length of 89 exceeds 80 columns #584: FILE: kernel/bpf/verifier.c:19503: + * The verifier mitigates this by performing the following steps: WARNING: line length of 95 exceeds 80 columns #586: FILE: kernel/bpf/verifier.c:19505: + * - Prior to the main verification pass, strongly connected components WARNING: line length of 87 exceeds 80 columns #587: FILE: kernel/bpf/verifier.c:19506: + * (SCCs) are computed over the program's control flow graph, WARNING: line length of 90 exceeds 80 columns #590: FILE: kernel/bpf/verifier.c:19509: + * - During the main verification pass, `maybe_enter_scc()` checks WARNING: line length of 93 exceeds 80 columns #591: FILE: kernel/bpf/verifier.c:19510: + * 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:19511: + * 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:19514: + * - 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:19515: + * `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:19516: + * the SCC and the SCC id. See `compute_scc_callchain()`. WARNING: line length of 85 exceeds 80 columns #599: FILE: kernel/bpf/verifier.c:19518: + * - When a verification path encounters a `states_equal(..., WARNING: line length of 95 exceeds 80 columns #600: FILE: kernel/bpf/verifier.c:19519: + * RANGE_WITHIN)` condition, there exists a call chain describing the WARNING: line length of 95 exceeds 80 columns #601: FILE: kernel/bpf/verifier.c:19520: + * 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:19524: + * - When a verification path terminates, `maybe_exit_scc()` is called WARNING: line length of 95 exceeds 80 columns #606: FILE: kernel/bpf/verifier.c:19525: + * from `update_branch_counts()`. For states with `branches == 0`, it WARNING: line length of 95 exceeds 80 columns #607: FILE: kernel/bpf/verifier.c:19526: + * 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:19527: + * 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:19528: + * this SCC visit have been explored. `propagate_backedges()` is then WARNING: line length of 90 exceeds 80 columns #610: FILE: kernel/bpf/verifier.c:19529: + * called, which propagates read and precision marks through the WARNING: line length of 93 exceeds 80 columns #612: FILE: kernel/bpf/verifier.c:19531: + * (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:19546: + * Here, there are two distinct callchains leading to SCC#1: WARNING: line length of 93 exceeds 80 columns #631: FILE: kernel/bpf/verifier.c:19550: + * Each callchain identifies a separate `bpf_scc_visit` instance that WARNING: line length of 94 exceeds 80 columns #632: FILE: kernel/bpf/verifier.c:19551: + * accumulates backedge states. The `propagate_{liveness,precision}()` WARNING: line length of 92 exceeds 80 columns #633: FILE: kernel/bpf/verifier.c:19552: + * functions traverse the parent state of each backedge state, which WARNING: line length of 94 exceeds 80 columns #634: FILE: kernel/bpf/verifier.c:19553: + * 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:19556: + * Associating `bpf_scc_visit` instances directly with SCCs instead of WARNING: line length of 92 exceeds 80 columns #639: FILE: kernel/bpf/verifier.c:19558: + * - States explored during `C: foo()` would contribute backedges to WARNING: line length of 90 exceeds 80 columns #640: FILE: kernel/bpf/verifier.c:19559: + * 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:19561: + * - 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:19562: + * (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:19568: + backedge = kzalloc(sizeof(*backedge), GFP_KERNEL); WARNING: line length of 81 exceeds 80 columns #652: FILE: kernel/bpf/verifier.c:19571: + err = copy_verifier_state(&backedge->state, cur); WARNING: line length of 89 exceeds 80 columns #655: FILE: kernel/bpf/verifier.c:19574: + err = err ?: add_scc_backedge(env, &sl->state, backedge); WARNING: line length of 85 exceeds 80 columns #657: FILE: kernel/bpf/verifier.c:19576: + free_verifier_state(&backedge->state, false); WARNING: line length of 82 exceeds 80 columns #728: FILE: kernel/bpf/verifier.c:24541: + 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 12bf781d754c ("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