WARNING: line length of 84 exceeds 80 columns #102: FILE: include/linux/bpf.h:1670: + u16 stack_arg_depth; /* both incoming and max outgoing of stack arguments */ WARNING: line length of 84 exceeds 80 columns #115: FILE: include/linux/bpf_verifier.h:323: + struct bpf_reg_state spilled_ptr; /* for spilled scalar/pointer semantics */ WARNING: line length of 87 exceeds 80 columns #127: FILE: include/linux/bpf_verifier.h:379: + u16 stack_arg_depth; /* Size of incoming + max outgoing stack args in bytes. */ WARNING: line length of 81 exceeds 80 columns #128: FILE: include/linux/bpf_verifier.h:380: + u16 incoming_stack_arg_depth; /* Size of incoming stack args in bytes. */ CHECK: Macro argument 'slot' may be better as '(slot)' to avoid precedence issues #137: FILE: include/linux/bpf_verifier.h:518: +#define bpf_get_spilled_stack_arg(slot, frame, mask) \ + (((slot < frame->stack_arg_depth / BPF_REG_SIZE) && \ + ((1 << frame->stack_arg_slots[slot].slot_type[BPF_REG_SIZE - 1]) & (mask))) \ + ? &frame->stack_arg_slots[slot].spilled_ptr : NULL) CHECK: Macro argument 'frame' may be better as '(frame)' to avoid precedence issues #137: FILE: include/linux/bpf_verifier.h:518: +#define bpf_get_spilled_stack_arg(slot, frame, mask) \ + (((slot < frame->stack_arg_depth / BPF_REG_SIZE) && \ + ((1 << frame->stack_arg_slots[slot].slot_type[BPF_REG_SIZE - 1]) & (mask))) \ + ? &frame->stack_arg_slots[slot].spilled_ptr : NULL) WARNING: line length of 87 exceeds 80 columns #139: FILE: include/linux/bpf_verifier.h:520: + ((1 << frame->stack_arg_slots[slot].slot_type[BPF_REG_SIZE - 1]) & (mask))) \ WARNING: line length of 88 exceeds 80 columns #155: FILE: include/linux/bpf_verifier.h:546: + bpf_for_each_spilled_stack_arg(___j, __state, __reg, __mask) { \ WARNING: line length of 87 exceeds 80 columns #196: FILE: kernel/bpf/btf.c:7896: + bpf_log(log, "Global function %s() with %d > %d args not supported.\n", WARNING: line length of 95 exceeds 80 columns #201: FILE: kernel/bpf/btf.c:7901: + sub->incoming_stack_arg_depth = (nargs - MAX_BPF_FUNC_REG_ARGS) * BPF_REG_SIZE; WARNING: line length of 96 exceeds 80 columns #218: FILE: kernel/bpf/verifier.c:1489: + dst->stack_arg_slots = copy_array(dst->stack_arg_slots, src->stack_arg_slots, n, WARNING: line length of 85 exceeds 80 columns #219: FILE: kernel/bpf/verifier.c:1490: + sizeof(struct bpf_stack_arg_state), WARNING: line length of 83 exceeds 80 columns #245: FILE: kernel/bpf/verifier.c:1550: + sizeof(struct bpf_stack_arg_state)); WARNING: line length of 83 exceeds 80 columns #284: FILE: kernel/bpf/verifier.c:5992: + /* Reads use positive offsets (incoming), writes use negative (outgoing) */ WARNING: line length of 81 exceeds 80 columns #286: FILE: kernel/bpf/verifier.c:5994: + verbose(env, "stack arg read must use positive offset, got %d\n", WARNING: line length of 82 exceeds 80 columns #291: FILE: kernel/bpf/verifier.c:5999: + verbose(env, "stack arg write must use negative offset, got %d\n", WARNING: line length of 92 exceeds 80 columns #314: FILE: kernel/bpf/verifier.c:6022: +static int check_stack_arg_write(struct bpf_verifier_env *env, struct bpf_func_state *state, WARNING: line length of 89 exceeds 80 columns #325: FILE: kernel/bpf/verifier.c:6033: + err = grow_stack_arg_slots(env, state, state->incoming_stack_arg_depth + (-off)); WARNING: line length of 82 exceeds 80 columns #338: FILE: kernel/bpf/verifier.c:6046: + type = is_spillable_regtype(reg->type) ? STACK_SPILL : STACK_MISC; WARNING: line length of 91 exceeds 80 columns #357: FILE: kernel/bpf/verifier.c:6065: +static int check_stack_arg_read(struct bpf_verifier_env *env, struct bpf_func_state *state, WARNING: line length of 82 exceeds 80 columns #402: FILE: kernel/bpf/verifier.c:8299: + return check_stack_arg_read(env, state, insn->off, insn->dst_reg); WARNING: line length of 83 exceeds 80 columns #426: FILE: kernel/bpf/verifier.c:8344: + return check_stack_arg_write(env, state, insn->off, insn->src_reg); WARNING: line length of 85 exceeds 80 columns #483: FILE: kernel/bpf/verifier.c:11369: + * Transfer stack args from caller's outgoing area to callee's incoming area. WARNING: line length of 92 exceeds 80 columns #497: FILE: kernel/bpf/verifier.c:11383: + int caller_incoming_slots = caller->incoming_stack_arg_depth / BPF_REG_SIZE; WARNING: line length of 97 exceeds 80 columns #498: FILE: kernel/bpf/verifier.c:11384: + int callee_incoming_slots = callee_info->incoming_stack_arg_depth / BPF_REG_SIZE; WARNING: line length of 89 exceeds 80 columns #500: FILE: kernel/bpf/verifier.c:11386: + callee->incoming_stack_arg_depth = callee_info->incoming_stack_arg_depth; WARNING: line length of 95 exceeds 80 columns #501: FILE: kernel/bpf/verifier.c:11387: + err = grow_stack_arg_slots(env, callee, callee_info->incoming_stack_arg_depth); WARNING: line length of 81 exceeds 80 columns #509: FILE: kernel/bpf/verifier.c:11395: + if (!is_stack_arg_slot_initialized(caller, caller_spi)) { WARNING: line length of 87 exceeds 80 columns #510: FILE: kernel/bpf/verifier.c:11396: + verbose(env, "stack arg#%d not properly initialized\n", WARNING: line length of 89 exceeds 80 columns #514: FILE: kernel/bpf/verifier.c:11400: + callee->stack_arg_slots[i] = caller->stack_arg_slots[caller_spi]; WARNING: line length of 84 exceeds 80 columns #541: FILE: kernel/bpf/verifier.c:20805: +static bool stack_arg_safe(struct bpf_verifier_env *env, struct bpf_func_state *old, WARNING: line length of 91 exceeds 80 columns #562: FILE: kernel/bpf/verifier.c:20826: + if (old->stack_arg_slots[spi].slot_type[i % BPF_REG_SIZE] == STACK_INVALID) WARNING: line length of 81 exceeds 80 columns #574: FILE: kernel/bpf/verifier.c:20838: + if (!regsafe(env, &old->stack_arg_slots[spi].spilled_ptr, WARNING: line length of 91 exceeds 80 columns #575: FILE: kernel/bpf/verifier.c:20839: + &cur->stack_arg_slots[spi].spilled_ptr, idmap, exact)) WARNING: line length of 87 exceeds 80 columns #609: FILE: kernel/bpf/verifier.c:21839: + struct bpf_func_state *state = vstate->frame[vstate->curframe]; WARNING: line length of 94 exceeds 80 columns #625: FILE: kernel/bpf/verifier.c:22685: + if (insn->dst_reg >= MAX_BPF_REG && insn->dst_reg != BPF_REG_STACK_ARG_BASE) { WARNING: line length of 94 exceeds 80 columns #630: FILE: kernel/bpf/verifier.c:22689: + if (insn->src_reg >= MAX_BPF_REG && insn->src_reg != BPF_REG_STACK_ARG_BASE) { WARNING: line length of 87 exceeds 80 columns #641: FILE: kernel/bpf/verifier.c:23718: + * Even without subprogs, kfunc calls with >5 args need stack arg space WARNING: line length of 91 exceeds 80 columns #644: FILE: kernel/bpf/verifier.c:23721: + prog->aux->stack_arg_depth = env->subprog_info[0].outgoing_stack_arg_depth; WARNING: line length of 103 exceeds 80 columns #654: FILE: kernel/bpf/verifier.c:23813: + func[i]->aux->incoming_stack_arg_depth = env->subprog_info[i].incoming_stack_arg_depth; WARNING: line length of 95 exceeds 80 columns #655: FILE: kernel/bpf/verifier.c:23814: + func[i]->aux->stack_arg_depth = env->subprog_info[i].incoming_stack_arg_depth + WARNING: line length of 94 exceeds 80 columns #656: FILE: kernel/bpf/verifier.c:23815: + env->subprog_info[i].outgoing_stack_arg_depth; WARNING: line length of 96 exceeds 80 columns #665: FILE: kernel/bpf/verifier.c:25508: + for (i = BPF_REG_1; i <= min_t(u32, sub->arg_cnt, MAX_BPF_FUNC_REG_ARGS); i++) { total: 0 errors, 41 warnings, 2 checks, 536 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 aa4a276b6c06 ("bpf: Support stack arguments for bpf functions") 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, 41 warnings, 2 checks, 536 lines checked