Lines Matching refs:max_optlen

1743 static int sockopt_alloc_buf(struct bpf_sockopt_kern *ctx, int max_optlen,  in sockopt_alloc_buf()  argument
1746 if (unlikely(max_optlen < 0)) in sockopt_alloc_buf()
1749 if (unlikely(max_optlen > PAGE_SIZE)) { in sockopt_alloc_buf()
1753 max_optlen = PAGE_SIZE; in sockopt_alloc_buf()
1756 if (max_optlen <= sizeof(buf->data)) { in sockopt_alloc_buf()
1761 ctx->optval_end = ctx->optval + max_optlen; in sockopt_alloc_buf()
1762 return max_optlen; in sockopt_alloc_buf()
1765 ctx->optval = kzalloc(max_optlen, GFP_USER); in sockopt_alloc_buf()
1769 ctx->optval_end = ctx->optval + max_optlen; in sockopt_alloc_buf()
1771 return max_optlen; in sockopt_alloc_buf()
1799 int ret, max_optlen; in __cgroup_bpf_run_filter_setsockopt() local
1805 max_optlen = max_t(int, 16, *optlen); in __cgroup_bpf_run_filter_setsockopt()
1806 max_optlen = sockopt_alloc_buf(&ctx, max_optlen, &buf); in __cgroup_bpf_run_filter_setsockopt()
1807 if (max_optlen < 0) in __cgroup_bpf_run_filter_setsockopt()
1808 return max_optlen; in __cgroup_bpf_run_filter_setsockopt()
1812 if (copy_from_user(ctx.optval, optval, min(*optlen, max_optlen)) != 0) { in __cgroup_bpf_run_filter_setsockopt()
1828 } else if (ctx.optlen > max_optlen || ctx.optlen < -1) { in __cgroup_bpf_run_filter_setsockopt()
1832 ctx.optlen, max_optlen); in __cgroup_bpf_run_filter_setsockopt()
1880 int __user *optlen, int max_optlen, in __cgroup_bpf_run_filter_getsockopt() argument
1894 orig_optlen = max_optlen; in __cgroup_bpf_run_filter_getsockopt()
1895 ctx.optlen = max_optlen; in __cgroup_bpf_run_filter_getsockopt()
1896 max_optlen = sockopt_alloc_buf(&ctx, max_optlen, &buf); in __cgroup_bpf_run_filter_getsockopt()
1897 if (max_optlen < 0) in __cgroup_bpf_run_filter_getsockopt()
1898 return max_optlen; in __cgroup_bpf_run_filter_getsockopt()
1920 min(ctx.optlen, max_optlen)) != 0) { in __cgroup_bpf_run_filter_getsockopt()
1934 if (optval && (ctx.optlen > max_optlen || ctx.optlen < 0)) { in __cgroup_bpf_run_filter_getsockopt()
1937 ctx.optlen, max_optlen); in __cgroup_bpf_run_filter_getsockopt()