WARNING: line length of 90 exceeds 80 columns #30: FILE: include/linux/bpf_verifier.h:1072: +int bpf_update_branch_counts(struct bpf_verifier_env *env, struct bpf_verifier_state *st); WARNING: line length of 86 exceeds 80 columns #38: FILE: include/linux/bpf_verifier.h:1080: +int bpf_push_jmp_history(struct bpf_verifier_env *env, struct bpf_verifier_state *cur, WARNING: line length of 89 exceeds 80 columns #45: FILE: include/linux/bpf_verifier.h:1087: +void bpf_clear_singular_ids(struct bpf_verifier_env *env, struct bpf_verifier_state *st); WARNING: line length of 87 exceeds 80 columns #85: FILE: include/linux/bpf_verifier.h:1127: +static inline void bpf_bt_set_frame_reg(struct backtrack_state *bt, u32 frame, u32 reg) WARNING: line length of 89 exceeds 80 columns #90: FILE: include/linux/bpf_verifier.h:1132: +static inline void bpf_bt_set_frame_slot(struct backtrack_state *bt, u32 frame, u32 slot) WARNING: line length of 90 exceeds 80 columns #141: FILE: kernel/bpf/states.c:25: + cur_states = env->explored_states_size + env->free_list_size + env->num_backedges; WARNING: line length of 90 exceeds 80 columns #149: FILE: kernel/bpf/states.c:33: +static struct bpf_verifier_state_list *state_parent_as_list(struct bpf_verifier_state *st) WARNING: line length of 87 exceeds 80 columns #152: FILE: kernel/bpf/states.c:36: + return container_of(st->parent, struct bpf_verifier_state_list, state); CHECK: Logical continuations should be on the previous line #167: FILE: kernel/bpf/states.c:51: + if (!sl->in_free_list + || sl->state.branches != 0 CHECK: Logical continuations should be on the previous line #168: FILE: kernel/bpf/states.c:52: + || sl->state.branches != 0 + || incomplete_read_marks(env, &sl->state)) WARNING: line length of 82 exceeds 80 columns #201: FILE: kernel/bpf/states.c:85: + struct bpf_scc_callchain *callchain) WARNING: line length of 85 exceeds 80 columns #210: FILE: kernel/bpf/states.c:94: + if (memcmp(callchain, &visits[i].callchain, sizeof(*callchain)) == 0) WARNING: line length of 81 exceeds 80 columns #220: FILE: kernel/bpf/states.c:104: + struct bpf_scc_callchain *callchain) WARNING: line length of 81 exceeds 80 columns #230: FILE: kernel/bpf/states.c:114: + new_sz = sizeof(*info) + sizeof(struct bpf_scc_visit) * (num_visits + 1); WARNING: line length of 96 exceeds 80 columns #243: FILE: kernel/bpf/states.c:127: +static char *format_callchain(struct bpf_verifier_env *env, struct bpf_scc_callchain *callchain) WARNING: line length of 87 exceeds 80 columns #255: FILE: kernel/bpf/states.c:139: + delta += snprintf(buf + delta, TMP_STR_BUF_LEN - delta, "%u)", callchain->scc); WARNING: line length of 87 exceeds 80 columns #263: FILE: kernel/bpf/states.c:147: +static int maybe_enter_scc(struct bpf_verifier_env *env, struct bpf_verifier_state *st) WARNING: line length of 89 exceeds 80 columns #277: FILE: kernel/bpf/states.c:161: + verbose(env, "SCC enter %s\n", format_callchain(env, callchain)); WARNING: line length of 90 exceeds 80 columns #282: FILE: kernel/bpf/states.c:166: +static int propagate_backedges(struct bpf_verifier_env *env, struct bpf_scc_visit *visit); WARNING: line length of 86 exceeds 80 columns #288: FILE: kernel/bpf/states.c:172: +static int maybe_exit_scc(struct bpf_verifier_env *env, struct bpf_verifier_state *st) WARNING: line length of 85 exceeds 80 columns #298: FILE: kernel/bpf/states.c:182: + * If path traversal stops inside an SCC, corresponding bpf_scc_visit WARNING: line length of 82 exceeds 80 columns #299: FILE: kernel/bpf/states.c:183: + * must exist for non-speculative paths. For non-speculative paths WARNING: line length of 82 exceeds 80 columns #301: FILE: kernel/bpf/states.c:185: + * a. Verification error is found, maybe_exit_scc() is not called. WARNING: line length of 87 exceeds 80 columns #302: FILE: kernel/bpf/states.c:186: + * b. Top level BPF_EXIT is reached. Top level BPF_EXIT is not a member WARNING: line length of 85 exceeds 80 columns #304: FILE: kernel/bpf/states.c:188: + * c. A checkpoint is reached and matched. Checkpoints are created by WARNING: line length of 88 exceeds 80 columns #305: FILE: kernel/bpf/states.c:189: + * is_state_visited(), which calls maybe_enter_scc(), which allocates WARNING: line length of 86 exceeds 80 columns #310: FILE: kernel/bpf/states.c:194: + verifier_bug(env, "scc exit: no visit info for call chain %s", WARNING: line length of 91 exceeds 80 columns #338: FILE: kernel/bpf/states.c:222: + verifier_bug(env, "add backedge: no SCC in verification path, insn_idx %d", WARNING: line length of 82 exceeds 80 columns #344: FILE: kernel/bpf/states.c:228: + verifier_bug(env, "add backedge: no visit info for call chain %s", WARNING: line length of 84 exceeds 80 columns #349: FILE: kernel/bpf/states.c:233: + verbose(env, "SCC backedge %s\n", format_callchain(env, callchain)); WARNING: line length of 89 exceeds 80 columns #376: FILE: kernel/bpf/states.c:260: +int bpf_update_branch_counts(struct bpf_verifier_env *env, struct bpf_verifier_state *st) WARNING: line length of 93 exceeds 80 columns #388: FILE: kernel/bpf/states.c:272: + verifier_bug_if((int)br < 0, env, "%s:branches_to_explore=%d", __func__, br); WARNING: line length of 83 exceeds 80 columns #534: FILE: kernel/bpf/states.c:418: + * detect overwrites and invalidate associated data slices. WARNING: line length of 88 exceeds 80 columns #535: FILE: kernel/bpf/states.c:419: + * is_iter_reg_valid_uninit() and is_irq_flag_reg_valid_uninit() WARNING: line length of 89 exceeds 80 columns #536: FILE: kernel/bpf/states.c:420: + * check for their respective slot types to detect double-create. WARNING: line length of 85 exceeds 80 columns #548: FILE: kernel/bpf/states.c:432: + * is_spilled_scalar_after() check either slot_type[0] or [4] WARNING: line length of 88 exceeds 80 columns #551: FILE: kernel/bpf/states.c:435: + struct bpf_reg_state *spill = &st->stack[i].spilled_ptr; WARNING: line length of 91 exceeds 80 columns #557: FILE: kernel/bpf/states.c:441: + * 8 byte spill of scalar 0 where half slot is dead WARNING: line length of 82 exceeds 80 columns #558: FILE: kernel/bpf/states.c:442: + * should become STACK_ZERO in lo 4 bytes. WARNING: line length of 83 exceeds 80 columns #563: FILE: kernel/bpf/states.c:447: + u8 *t = &st->stack[i].slot_type[j]; WARNING: Too many leading tabs - consider code refactoring #565: FILE: kernel/bpf/states.c:449: + if (*t == STACK_SPILL) CHECK: Alignment should match open parenthesis #578: FILE: kernel/bpf/states.c:462: +static int clean_verifier_state(struct bpf_verifier_env *env, + struct bpf_verifier_state *st) WARNING: line length of 83 exceeds 80 columns #650: FILE: kernel/bpf/states.c:534: + /* explore_alu_limits disables tnum_in() and range_within() WARNING: line length of 93 exceeds 80 columns #653: FILE: kernel/bpf/states.c:537: + return memcmp(rold, rcur, offsetof(struct bpf_reg_state, id)) == 0 && WARNING: line length of 82 exceeds 80 columns #659: FILE: kernel/bpf/states.c:543: + * Linked register tracking uses rold->id to detect relationships. WARNING: line length of 82 exceeds 80 columns #660: FILE: kernel/bpf/states.c:544: + * When rold->id == 0, the register is independent and any linking WARNING: line length of 84 exceeds 80 columns #661: FILE: kernel/bpf/states.c:545: + * in rcur only adds constraints. When rold->id != 0, we must verify WARNING: line length of 86 exceeds 80 columns #664: FILE: kernel/bpf/states.c:548: + * +------------------+-----------+------------------+---------------+ WARNING: line length of 86 exceeds 80 columns #665: FILE: kernel/bpf/states.c:549: + * | | rold->id | rold + ADD_CONST | rold->id == 0 | WARNING: line length of 86 exceeds 80 columns #666: FILE: kernel/bpf/states.c:550: + * |------------------+-----------+------------------+---------------| WARNING: line length of 86 exceeds 80 columns #667: FILE: kernel/bpf/states.c:551: + * | rcur->id | range,ids | false | range | WARNING: line length of 86 exceeds 80 columns #668: FILE: kernel/bpf/states.c:552: + * | rcur + ADD_CONST | false | range,ids,off | range | WARNING: line length of 86 exceeds 80 columns #669: FILE: kernel/bpf/states.c:553: + * | rcur->id == 0 | range,ids | false | range | WARNING: line length of 86 exceeds 80 columns #670: FILE: kernel/bpf/states.c:554: + * +------------------+-----------+------------------+---------------+ WARNING: line length of 86 exceeds 80 columns #683: FILE: kernel/bpf/states.c:567: + * - at (4) same bpf_reg_state::id (b) would be assigned to r6 and r7; WARNING: line length of 87 exceeds 80 columns #684: FILE: kernel/bpf/states.c:568: + * - at (5) r6 would be marked <= X, sync_linked_regs() would also mark WARNING: line length of 82 exceeds 80 columns #694: FILE: kernel/bpf/states.c:578: + * Also verify that new value satisfies old value range knowledge. WARNING: line length of 89 exceeds 80 columns #714: FILE: kernel/bpf/states.c:598: + return range_within(rold, rcur) && tnum_in(rold->var_off, rcur->var_off); WARNING: line length of 90 exceeds 80 columns #723: FILE: kernel/bpf/states.c:607: + return memcmp(rold, rcur, offsetof(struct bpf_reg_state, var_off)) == 0 && WARNING: line length of 87 exceeds 80 columns #753: FILE: kernel/bpf/states.c:637: + return regs_exact(rold, rcur, idmap) && rold->frameno == rcur->frameno; WARNING: line length of 90 exceeds 80 columns #757: FILE: kernel/bpf/states.c:641: + return memcmp(rold, rcur, offsetof(struct bpf_reg_state, var_off)) == 0 && WARNING: line length of 89 exceeds 80 columns #758: FILE: kernel/bpf/states.c:642: + range_within(rold, rcur) && tnum_in(rold->var_off, rcur->var_off); CHECK: Unnecessary parentheses around 'stack->slot_type[i] == STACK_MISC' #785: FILE: kernel/bpf/states.c:669: + if ((stack->slot_type[i] == STACK_MISC) || + ((stack->slot_type[i] == STACK_INVALID || stack->slot_type[i] == STACK_POISON) && + env->allow_uninit_stack)) WARNING: line length of 101 exceeds 80 columns #786: FILE: kernel/bpf/states.c:670: + ((stack->slot_type[i] == STACK_INVALID || stack->slot_type[i] == STACK_POISON) && WARNING: line length of 88 exceeds 80 columns #796: FILE: kernel/bpf/states.c:680: + struct bpf_stack_state *stack, int im) WARNING: line length of 82 exceeds 80 columns #824: FILE: kernel/bpf/states.c:708: + u8 old_type = old->stack[spi].slot_type[i % BPF_REG_SIZE]; WARNING: line length of 98 exceeds 80 columns #826: FILE: kernel/bpf/states.c:710: + cur->stack[spi].slot_type[i % BPF_REG_SIZE] : STACK_INVALID; WARNING: line length of 87 exceeds 80 columns #828: FILE: kernel/bpf/states.c:712: + /* STACK_INVALID and STACK_POISON are equivalent for pruning */ WARNING: line length of 83 exceeds 80 columns #837: FILE: kernel/bpf/states.c:721: + if (old->stack[spi].slot_type[i % BPF_REG_SIZE] == STACK_INVALID || WARNING: line length of 84 exceeds 80 columns #852: FILE: kernel/bpf/states.c:736: + * 64 and 32-bit scalar spills vs MISC/INVALID slots and vice versa. WARNING: line length of 82 exceeds 80 columns #858: FILE: kernel/bpf/states.c:742: + old_reg = scalar_reg_for_stack(env, &old->stack[spi], im); WARNING: line length of 82 exceeds 80 columns #859: FILE: kernel/bpf/states.c:743: + cur_reg = scalar_reg_for_stack(env, &cur->stack[spi], im); WARNING: line length of 82 exceeds 80 columns #861: FILE: kernel/bpf/states.c:745: + if (!regsafe(env, old_reg, cur_reg, idmap, exact)) WARNING: line length of 81 exceeds 80 columns #899: FILE: kernel/bpf/states.c:783: + &cur->stack[spi].spilled_ptr, idmap, exact)) WARNING: line length of 87 exceeds 80 columns #906: FILE: kernel/bpf/states.c:790: + old_reg->dynptr.first_slot != cur_reg->dynptr.first_slot || WARNING: line length of 88 exceeds 80 columns #907: FILE: kernel/bpf/states.c:791: + !check_ids(old_reg->ref_obj_id, cur_reg->ref_obj_id, idmap)) WARNING: line length of 81 exceeds 80 columns #922: FILE: kernel/bpf/states.c:806: + /* ignore {old_reg,cur_reg}->iter.depth, see above */ WARNING: line length of 88 exceeds 80 columns #923: FILE: kernel/bpf/states.c:807: + !check_ids(old_reg->ref_obj_id, cur_reg->ref_obj_id, idmap)) WARNING: line length of 90 exceeds 80 columns #929: FILE: kernel/bpf/states.c:813: + if (!check_ids(old_reg->ref_obj_id, cur_reg->ref_obj_id, idmap) || WARNING: line length of 81 exceeds 80 columns #930: FILE: kernel/bpf/states.c:814: + old_reg->irq.kfunc_class != cur_reg->irq.kfunc_class) WARNING: line length of 82 exceeds 80 columns #938: FILE: kernel/bpf/states.c:822: + /* Ensure that new unhandled slot types return false by default */ WARNING: line length of 83 exceeds 80 columns #946: FILE: kernel/bpf/states.c:830: +static bool refsafe(struct bpf_verifier_state *old, struct bpf_verifier_state *cur, WARNING: line length of 105 exceeds 80 columns #985: FILE: kernel/bpf/states.c:869: + WARN_ONCE(1, "Unhandled enum type for reference state: %d\n", old->refs[i].type); WARNING: line length of 87 exceeds 80 columns #1019: FILE: kernel/bpf/states.c:903: +static bool func_states_equal(struct bpf_verifier_env *env, struct bpf_func_state *old, WARNING: line length of 95 exceeds 80 columns #1020: FILE: kernel/bpf/states.c:904: + struct bpf_func_state *cur, u32 insn_idx, enum exact_level exact) WARNING: line length of 91 exceeds 80 columns #1080: FILE: kernel/bpf/states.c:964: + if (!func_states_equal(env, old->frame[i], cur->frame[i], insn_idx, exact)) WARNING: line length of 89 exceeds 80 columns #1109: FILE: kernel/bpf/states.c:993: + verbose(env, "frame %d: propagating r%d", fr, i); WARNING: line length of 82 exceeds 80 columns #1126: FILE: kernel/bpf/states.c:1010: + verbose(env, "frame %d: propagating fp%d", WARNING: line length of 87 exceeds 80 columns #1129: FILE: kernel/bpf/states.c:1013: + verbose(env, ",fp%d", (-i - 1) * BPF_REG_SIZE); WARNING: line length of 81 exceeds 80 columns #1147: FILE: kernel/bpf/states.c:1031: +/* Propagate read and precision marks from visit->backedges[*].state->equal_state WARNING: line length of 92 exceeds 80 columns #1148: FILE: kernel/bpf/states.c:1032: + * to corresponding parent states of visit->backedges[*].state until fixed point is reached, WARNING: line length of 89 exceeds 80 columns #1153: FILE: kernel/bpf/states.c:1037: +static int propagate_backedges(struct bpf_verifier_env *env, struct bpf_scc_visit *visit) WARNING: line length of 84 exceeds 80 columns #1164: FILE: kernel/bpf/states.c:1048: + verbose(env, "%s: too many iterations\n", __func__); WARNING: line length of 94 exceeds 80 columns #1165: FILE: kernel/bpf/states.c:1049: + for (backedge = visit->backedges; backedge; backedge = backedge->next) WARNING: line length of 84 exceeds 80 columns #1166: FILE: kernel/bpf/states.c:1050: + bpf_mark_all_scalars_precise(env, &backedge->state); WARNING: line length of 88 exceeds 80 columns #1170: FILE: kernel/bpf/states.c:1054: + for (backedge = visit->backedges; backedge; backedge = backedge->next) { WARNING: line length of 86 exceeds 80 columns #1172: FILE: kernel/bpf/states.c:1056: + err = propagate_precision(env, st->equal_state, st, &changed); WARNING: line length of 101 exceeds 80 columns #1258: FILE: kernel/bpf/states.c:1142: +static bool iter_active_depths_differ(struct bpf_verifier_state *old, struct bpf_verifier_state *cur) WARNING: line length of 99 exceeds 80 columns #1282: FILE: kernel/bpf/states.c:1166: +static void mark_all_scalars_imprecise(struct bpf_verifier_env *env, struct bpf_verifier_state *st) WARNING: line length of 91 exceeds 80 columns #1316: FILE: kernel/bpf/states.c:1200: + force_new_state = env->test_state_freq || bpf_is_force_checkpoint(env, insn_idx) || WARNING: line length of 82 exceeds 80 columns #1324: FILE: kernel/bpf/states.c:1208: + * This heuristics helps decrease 'total_states' and 'peak_states' metric. WARNING: line length of 91 exceeds 80 columns #1347: FILE: kernel/bpf/states.c:1231: + struct bpf_func_state *frame = sl->state.frame[sl->state.curframe]; WARNING: line length of 99 exceeds 80 columns #1350: FILE: kernel/bpf/states.c:1234: + frame->async_entry_cnt != cur->frame[cur->curframe]->async_entry_cnt) { WARNING: line length of 87 exceeds 80 columns #1351: FILE: kernel/bpf/states.c:1235: + /* Different async_entry_cnt means that the verifier is WARNING: line length of 89 exceeds 80 columns #1353: FILE: kernel/bpf/states.c:1237: + * Seeing the same state is not an indication of infinite WARNING: line length of 89 exceeds 80 columns #1355: FILE: kernel/bpf/states.c:1239: + * But finding the same state doesn't mean that it's safe WARNING: line length of 91 exceeds 80 columns #1356: FILE: kernel/bpf/states.c:1240: + * to stop processing the current state. The previous state WARNING: line length of 89 exceeds 80 columns #1357: FILE: kernel/bpf/states.c:1241: + * hasn't yet reached bpf_exit, since state.branches > 0. WARNING: line length of 92 exceeds 80 columns #1358: FILE: kernel/bpf/states.c:1242: + * Checking in_async_callback_fn alone is not enough either. WARNING: line length of 89 exceeds 80 columns #1359: FILE: kernel/bpf/states.c:1243: + * Since the verifier still needs to catch infinite loops WARNING: line length of 86 exceeds 80 columns #1365: FILE: kernel/bpf/states.c:1249: + * states_maybe_looping() logic is too simplistic in detecting WARNING: line length of 85 exceeds 80 columns #1366: FILE: kernel/bpf/states.c:1250: + * states that *might* be equivalent, because it doesn't know WARNING: line length of 87 exceeds 80 columns #1368: FILE: kernel/bpf/states.c:1252: + * See process_iter_next_call() and iter_active_depths_differ() WARNING: line length of 84 exceeds 80 columns #1369: FILE: kernel/bpf/states.c:1253: + * for overview of the logic. When current and one of parent WARNING: line length of 89 exceeds 80 columns #1370: FILE: kernel/bpf/states.c:1254: + * states are detected as equivalent, it's a good thing: we prove WARNING: line length of 82 exceeds 80 columns #1371: FILE: kernel/bpf/states.c:1255: + * convergence and can stop simulating further iterations. WARNING: line length of 90 exceeds 80 columns #1372: FILE: kernel/bpf/states.c:1256: + * It's safe to assume that iterator loop will finish, taking into WARNING: line length of 93 exceeds 80 columns #1376: FILE: kernel/bpf/states.c:1260: + * Note, that states have to be compared exactly in this case because WARNING: line length of 91 exceeds 80 columns #1377: FILE: kernel/bpf/states.c:1261: + * read and precision marks might not be finalized inside the loop. WARNING: line length of 93 exceeds 80 columns #1394: FILE: kernel/bpf/states.c:1278: + * Here verifier would first visit path 1-3, create a checkpoint at 3 WARNING: line length of 88 exceeds 80 columns #1395: FILE: kernel/bpf/states.c:1279: + * with r7=-16, continue to 4-7,3. Existing checkpoint at 3 does WARNING: line length of 90 exceeds 80 columns #1396: FILE: kernel/bpf/states.c:1280: + * not have read or precision mark for r7 yet, thus inexact states WARNING: line length of 87 exceeds 80 columns #1401: FILE: kernel/bpf/states.c:1285: + if (states_equal(env, &sl->state, cur, RANGE_WITHIN)) { WARNING: line length of 84 exceeds 80 columns #1403: FILE: kernel/bpf/states.c:1287: + struct bpf_reg_state *iter_state, *iter_reg; WARNING: line length of 85 exceeds 80 columns #1408: FILE: kernel/bpf/states.c:1292: + * iter state pointer is always the first arg WARNING: line length of 88 exceeds 80 columns #1411: FILE: kernel/bpf/states.c:1295: + /* current state is valid due to states_equal(), WARNING: line length of 85 exceeds 80 columns #1412: FILE: kernel/bpf/states.c:1296: + * so we can assume valid iter and reg state, WARNING: line length of 83 exceeds 80 columns #1415: FILE: kernel/bpf/states.c:1299: + spi = bpf_get_spi(iter_reg->var_off.value); WARNING: line length of 102 exceeds 80 columns #1416: FILE: kernel/bpf/states.c:1300: + iter_state = &bpf_func(env, iter_reg)->stack[spi].spilled_ptr; WARNING: line length of 94 exceeds 80 columns #1417: FILE: kernel/bpf/states.c:1301: + if (iter_state->iter.state == BPF_ITER_STATE_ACTIVE) { WARNING: line length of 86 exceeds 80 columns #1425: FILE: kernel/bpf/states.c:1309: + if (sl->state.may_goto_depth != cur->may_goto_depth && WARNING: line length of 87 exceeds 80 columns #1426: FILE: kernel/bpf/states.c:1310: + states_equal(env, &sl->state, cur, RANGE_WITHIN)) { WARNING: line length of 87 exceeds 80 columns #1432: FILE: kernel/bpf/states.c:1316: + if (states_equal(env, &sl->state, cur, RANGE_WITHIN)) { WARNING: line length of 94 exceeds 80 columns #1438: FILE: kernel/bpf/states.c:1322: + /* attempt to detect infinite loop to avoid unnecessary doomed work */ WARNING: line length of 92 exceeds 80 columns #1443: FILE: kernel/bpf/states.c:1327: + sl->state.callback_unroll_depth == cur->callback_unroll_depth) { WARNING: line length of 94 exceeds 80 columns #1445: FILE: kernel/bpf/states.c:1329: + verbose(env, "infinite loop detected at insn %d\n", insn_idx); WARNING: line length of 84 exceeds 80 columns #1447: FILE: kernel/bpf/states.c:1331: + print_verifier_state(env, cur, cur->curframe, true); WARNING: line length of 91 exceeds 80 columns #1449: FILE: kernel/bpf/states.c:1333: + print_verifier_state(env, &sl->state, cur->curframe, true); WARNING: line length of 87 exceeds 80 columns #1452: FILE: kernel/bpf/states.c:1336: + /* if the verifier is processing a loop, avoid adding new state WARNING: line length of 83 exceeds 80 columns #1453: FILE: kernel/bpf/states.c:1337: + * too often, since different loop iterations have distinct WARNING: line length of 84 exceeds 80 columns #1461: FILE: kernel/bpf/states.c:1345: + * This threshold shouldn't be too high either, since states WARNING: line length of 85 exceeds 80 columns #1462: FILE: kernel/bpf/states.c:1346: + * at the end of the loop are likely to be useful in pruning. WARNING: line length of 82 exceeds 80 columns #1466: FILE: kernel/bpf/states.c:1350: + env->jmps_processed - env->prev_jmps_processed < 20 && WARNING: line length of 81 exceeds 80 columns #1467: FILE: kernel/bpf/states.c:1351: + env->insn_processed - env->prev_insn_processed < 100) WARNING: line length of 90 exceeds 80 columns #1473: FILE: kernel/bpf/states.c:1357: + if (states_equal(env, &sl->state, cur, loop ? RANGE_WITHIN : NOT_EXACT)) { WARNING: line length of 85 exceeds 80 columns #1478: FILE: kernel/bpf/states.c:1362: + * current state is equivalent to it (except precision marks) WARNING: line length of 86 exceeds 80 columns #1485: FILE: kernel/bpf/states.c:1369: + err = err ? : propagate_precision(env, &sl->state, cur, NULL); WARNING: line length of 92 exceeds 80 columns #1488: FILE: kernel/bpf/states.c:1372: + /* When processing iterator based loops above propagate_liveness and WARNING: line length of 96 exceeds 80 columns #1489: FILE: kernel/bpf/states.c:1373: + * propagate_precision calls are not sufficient to transfer all relevant WARNING: line length of 86 exceeds 80 columns #1490: FILE: kernel/bpf/states.c:1374: + * read and precision marks. E.g. consider the following case: WARNING: line length of 90 exceeds 80 columns #1492: FILE: kernel/bpf/states.c:1376: + * .-> A --. Assume the states are visited in the order A, B, C. WARNING: line length of 97 exceeds 80 columns #1493: FILE: kernel/bpf/states.c:1377: + * | | | Assume that state B reaches a state equivalent to state A. WARNING: line length of 94 exceeds 80 columns #1494: FILE: kernel/bpf/states.c:1378: + * | v v At this point, state C is not processed yet, so state A WARNING: line length of 91 exceeds 80 columns #1495: FILE: kernel/bpf/states.c:1379: + * '-- B C has not received any read or precision marks from C. WARNING: line length of 89 exceeds 80 columns #1496: FILE: kernel/bpf/states.c:1380: + * Thus, marks propagated from A to B are incomplete. WARNING: line length of 89 exceeds 80 columns #1498: FILE: kernel/bpf/states.c:1382: + * The verifier mitigates this by performing the following steps: WARNING: line length of 95 exceeds 80 columns #1500: FILE: kernel/bpf/states.c:1384: + * - Prior to the main verification pass, strongly connected components WARNING: line length of 87 exceeds 80 columns #1501: FILE: kernel/bpf/states.c:1385: + * (SCCs) are computed over the program's control flow graph, WARNING: line length of 90 exceeds 80 columns #1504: FILE: kernel/bpf/states.c:1388: + * - During the main verification pass, `maybe_enter_scc()` checks WARNING: line length of 93 exceeds 80 columns #1505: FILE: kernel/bpf/states.c:1389: + * whether the current verifier state is entering an SCC. If so, an WARNING: line length of 91 exceeds 80 columns #1506: FILE: kernel/bpf/states.c:1390: + * instance of a `bpf_scc_visit` object is created, and the state WARNING: line length of 92 exceeds 80 columns #1509: FILE: kernel/bpf/states.c:1393: + * - This instance is associated not with the SCC itself, but with a WARNING: line length of 97 exceeds 80 columns #1510: FILE: kernel/bpf/states.c:1394: + * `bpf_scc_callchain`: a tuple consisting of the call sites leading to WARNING: line length of 83 exceeds 80 columns #1511: FILE: kernel/bpf/states.c:1395: + * the SCC and the SCC id. See `compute_scc_callchain()`. WARNING: line length of 85 exceeds 80 columns #1513: FILE: kernel/bpf/states.c:1397: + * - When a verification path encounters a `states_equal(..., WARNING: line length of 95 exceeds 80 columns #1514: FILE: kernel/bpf/states.c:1398: + * RANGE_WITHIN)` condition, there exists a call chain describing the WARNING: line length of 95 exceeds 80 columns #1515: FILE: kernel/bpf/states.c:1399: + * current state and a corresponding `bpf_scc_visit` instance. A copy WARNING: line length of 94 exceeds 80 columns #1519: FILE: kernel/bpf/states.c:1403: + * - When a verification path terminates, `maybe_exit_scc()` is called WARNING: line length of 99 exceeds 80 columns #1520: FILE: kernel/bpf/states.c:1404: + * from `bpf_update_branch_counts()`. For states with `branches == 0`, it WARNING: line length of 95 exceeds 80 columns #1521: FILE: kernel/bpf/states.c:1405: + * checks whether the state is the entry state of any `bpf_scc_visit` WARNING: line length of 95 exceeds 80 columns #1522: FILE: kernel/bpf/states.c:1406: + * instance. If it is, this indicates that all paths originating from WARNING: line length of 95 exceeds 80 columns #1523: FILE: kernel/bpf/states.c:1407: + * this SCC visit have been explored. `propagate_backedges()` is then WARNING: line length of 90 exceeds 80 columns #1524: FILE: kernel/bpf/states.c:1408: + * called, which propagates read and precision marks through the WARNING: line length of 93 exceeds 80 columns #1526: FILE: kernel/bpf/states.c:1410: + * (In the earlier example, this would propagate marks from A to B, WARNING: line length of 84 exceeds 80 columns #1541: FILE: kernel/bpf/states.c:1425: + * Here, there are two distinct callchains leading to SCC#1: WARNING: line length of 93 exceeds 80 columns #1545: FILE: kernel/bpf/states.c:1429: + * Each callchain identifies a separate `bpf_scc_visit` instance that WARNING: line length of 94 exceeds 80 columns #1546: FILE: kernel/bpf/states.c:1430: + * accumulates backedge states. The `propagate_{liveness,precision}()` WARNING: line length of 92 exceeds 80 columns #1547: FILE: kernel/bpf/states.c:1431: + * functions traverse the parent state of each backedge state, which WARNING: line length of 94 exceeds 80 columns #1548: FILE: kernel/bpf/states.c:1432: + * means these parent states must remain valid (i.e., not freed) while WARNING: line length of 94 exceeds 80 columns #1551: FILE: kernel/bpf/states.c:1435: + * Associating `bpf_scc_visit` instances directly with SCCs instead of WARNING: line length of 92 exceeds 80 columns #1553: FILE: kernel/bpf/states.c:1437: + * - States explored during `C: foo()` would contribute backedges to WARNING: line length of 90 exceeds 80 columns #1554: FILE: kernel/bpf/states.c:1438: + * SCC#1, but SCC#1 would only be exited once the exploration of WARNING: line length of 96 exceeds 80 columns #1556: FILE: kernel/bpf/states.c:1440: + * - By that time, the states explored between `A: foo()` and `C: foo()` WARNING: line length of 93 exceeds 80 columns #1557: FILE: kernel/bpf/states.c:1441: + * (i.e., `B: ...`) may have already been freed, causing the parent WARNING: line length of 85 exceeds 80 columns #1567: FILE: kernel/bpf/states.c:1451: + err = bpf_copy_verifier_state(&backedge->state, cur); WARNING: line length of 89 exceeds 80 columns #1570: FILE: kernel/bpf/states.c:1454: + err = err ?: add_scc_backedge(env, &sl->state, backedge); WARNING: line length of 89 exceeds 80 columns #1572: FILE: kernel/bpf/states.c:1456: + bpf_free_verifier_state(&backedge->state, false); WARNING: line length of 86 exceeds 80 columns #1580: FILE: kernel/bpf/states.c:1464: + /* when new state is not going to be added do not increase miss count. WARNING: line length of 81 exceeds 80 columns #1583: FILE: kernel/bpf/states.c:1467: + * states from some iterations of the loop (some in the beginning WARNING: line length of 85 exceeds 80 columns #1590: FILE: kernel/bpf/states.c:1474: + * Higher numbers increase max_states_per_insn and verification time, WARNING: line length of 84 exceeds 80 columns #1593: FILE: kernel/bpf/states.c:1477: + * Use bigger 'n' for checkpoints because evicting checkpoint states WARNING: line length of 94 exceeds 80 columns #1596: FILE: kernel/bpf/states.c:1480: + n = bpf_is_force_checkpoint(env, insn_idx) && sl->state.branches > 0 ? 64 : 3; WARNING: line length of 81 exceeds 80 columns #1628: FILE: kernel/bpf/states.c:1512: + new_sl = kzalloc_obj(struct bpf_verifier_state_list, GFP_KERNEL_ACCOUNT); CHECK: Alignment should match open parenthesis #1937: FILE: kernel/bpf/verifier.c:1577: +void bpf_free_verifier_state(struct bpf_verifier_state *state, + bool free_self) CHECK: Alignment should match open parenthesis #1992: FILE: kernel/bpf/verifier.c:1602: +int bpf_copy_verifier_state(struct bpf_verifier_state *dst_state, + const struct bpf_verifier_state *src) WARNING: line length of 86 exceeds 80 columns #2377: FILE: kernel/bpf/verifier.c:3609: +int bpf_push_jmp_history(struct bpf_verifier_env *env, struct bpf_verifier_state *cur, CHECK: Alignment should match open parenthesis #2378: FILE: kernel/bpf/verifier.c:3610: +int bpf_push_jmp_history(struct bpf_verifier_env *env, struct bpf_verifier_state *cur, + int insn_flags, u64 linked_regs) WARNING: line length of 91 exceeds 80 columns #2441: FILE: kernel/bpf/verifier.c:4076: + bpf_bt_set_frame_reg(bt, bt->frame - 1, i); CHECK: Alignment should match open parenthesis #2452: FILE: kernel/bpf/verifier.c:4263: +void bpf_mark_all_scalars_precise(struct bpf_verifier_env *env, + struct bpf_verifier_state *st) CHECK: Alignment should match open parenthesis #2509: FILE: kernel/bpf/verifier.c:4397: +int bpf_mark_chain_precision(struct bpf_verifier_env *env, + struct bpf_verifier_state *starting_state, WARNING: line length of 82 exceeds 80 columns #2520: FILE: kernel/bpf/verifier.c:4482: + bpf_mark_all_scalars_precise(env, starting_state); WARNING: line length of 93 exceeds 80 columns #2681: FILE: kernel/bpf/verifier.c:5014: + * Otherwise bpf_is_spilled_reg() may == true && spilled_ptr.type == NOT_INIT WARNING: line length of 89 exceeds 80 columns #2939: FILE: kernel/bpf/verifier.c:10374: + if (bpf_register_is_null(reg) && type_may_be_null(arg->arg_type)) WARNING: line length of 90 exceeds 80 columns #3071: FILE: kernel/bpf/verifier.c:12376: + if (is_kfunc_arg_nullable(meta->btf, &args[argno]) && bpf_register_is_null(reg) && WARNING: line length of 81 exceeds 80 columns #3080: FILE: kernel/bpf/verifier.c:13117: + if ((bpf_register_is_null(reg) || type_may_be_null(reg->type)) && WARNING: line length of 109 exceeds 80 columns #3089: FILE: kernel/bpf/verifier.c:13437: + if (!bpf_register_is_null(buff_reg) || !is_kfunc_arg_nullable(meta->btf, buff_arg)) { WARNING: line length of 96 exceeds 80 columns #3143: FILE: kernel/bpf/verifier.c:17408: + err = bpf_push_jmp_history(env, this_branch, 0, linked_regs_pack(&linked_regs)); total: 0 errors, 198 warnings, 9 checks, 4383 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 7470d0ac9c21 ("bpf: Move state equivalence logic to states.c") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE FILE_PATH_CHANGES 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, 198 warnings, 9 checks, 4383 lines checked