Home
last modified time | relevance | path

Searched refs:optval (Results 1 – 25 of 124) sorted by relevance

12345

/linux/tools/testing/selftests/bpf/progs/
H A Dsockopt_sk.c33 __u8 *optval = ctx->optval; in _getsockopt() local
81 if (optval + sizeof(__u64) > optval_end) in _getsockopt()
84 if (((struct tcp_zerocopy_receive *)optval)->address != 0) in _getsockopt()
91 if (optval + 1 > optval_end) in _getsockopt()
97 optval[0] = 0x55; in _getsockopt()
104 if (optval_end - optval != page_size) in _getsockopt()
113 if (optval + 1 > optval_end) in _getsockopt()
127 optval[0] = storage->val; in _getsockopt()
143 __u8 *optval = ctx->optval; in _setsockopt() local
172 if (optval + sizeof(__u32) > optval_end) in _setsockopt()
[all …]
H A Dsockopt_multi.c14 __u8 *optval = ctx->optval; in _getsockopt_child() local
19 if (optval + 1 > optval_end) in _getsockopt_child()
22 if (optval[0] != 0x80) in _getsockopt_child()
27 optval[0] = 0x90; in _getsockopt_child()
43 __u8 *optval = ctx->optval; in _getsockopt_parent() local
48 if (optval + 1 > optval_end) in _getsockopt_parent()
51 if (optval[0] != 0x90) in _getsockopt_parent()
56 optval[0] = 0xA0; in _getsockopt_parent()
72 __u8 *optval = ctx->optval; in _setsockopt() local
77 if (optval + 1 > optval_end) in _setsockopt()
[all …]
H A Dsockopt_inherit.c57 __u8 *optval = ctx->optval; in _getsockopt() local
62 if (optval + 1 > optval_end) in _getsockopt()
71 optval[0] = storage->val; in _getsockopt()
88 __u8 *optval = ctx->optval; in _setsockopt() local
93 if (optval + 1 > optval_end) in _setsockopt()
100 storage->val = optval[0]; in _setsockopt()
H A Dsockopt_qos_to_cc.c16 int *optval = ctx->optval; in sockopt_qos_to_cc() local
22 if (optval + 1 > optval_end) in sockopt_qos_to_cc()
31 if (*optval == 0x2d) { in sockopt_qos_to_cc()
/linux/net/mptcp/
H A Dsockopt.c58 static int mptcp_get_int_option(struct mptcp_sock *msk, sockptr_t optval, in mptcp_get_int_option() argument
64 if (copy_from_sockptr(val, optval, sizeof(*val))) in mptcp_get_int_option()
125 sockptr_t optval = KERNEL_SOCKPTR(&val); in mptcp_sol_socket_intval() local
130 optval, sizeof(val)); in mptcp_sol_socket_intval()
149 sockptr_t optval = KERNEL_SOCKPTR(&val); in mptcp_setsockopt_sol_socket_tstamp() local
155 optval, sizeof(val)); in mptcp_setsockopt_sol_socket_tstamp()
173 sockptr_t optval, in mptcp_setsockopt_sol_socket_int() argument
178 ret = mptcp_get_int_option(msk, optval, optlen, &val); in mptcp_setsockopt_sol_socket_int()
207 sockptr_t optval, in mptcp_setsockopt_sol_socket_timestamping() argument
216 if (copy_from_sockptr(&timestamping, optval, in mptcp_setsockopt_sol_socket_timestamping()
[all …]
/linux/include/net/
H A Dbond_options.h139 static inline void __bond_opt_init(struct bond_opt_value *optval, in __bond_opt_init() argument
143 memset(optval, 0, sizeof(*optval)); in __bond_opt_init()
144 optval->value = ULLONG_MAX; in __bond_opt_init()
146 optval->value = value; in __bond_opt_init()
148 optval->string = string; in __bond_opt_init()
151 memcpy(optval->extra, extra, extra_len); in __bond_opt_init()
153 #define bond_opt_initval(optval, value) __bond_opt_init(optval, NULL, value, NULL, 0) argument
154 #define bond_opt_initstr(optval, str) __bond_opt_init(optval, str, ULLONG_MAX, NULL, 0) argument
155 #define bond_opt_initextra(optval, extra, extra_len) \ argument
156 __bond_opt_init(optval, NULL, ULLONG_MAX, extra, extra_len)
[all …]
/linux/net/ipv6/
H A Dipv6_sockglue.c141 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument
148 if (copy_from_sockptr(&gr32, optval, sizeof(gr32))) in copy_group_source_from_sockptr()
156 if (copy_from_sockptr(greqs, optval, sizeof(*greqs))) in copy_group_source_from_sockptr()
164 sockptr_t optval, int optlen) in do_ipv6_mcast_group_source() argument
170 ret = copy_group_source_from_sockptr(&greqs, optval, optlen); in do_ipv6_mcast_group_source()
204 static int ipv6_set_mcast_msfilter(struct sock *sk, sockptr_t optval, in ipv6_set_mcast_msfilter() argument
215 gsf = memdup_sockptr(optval, optlen); in ipv6_set_mcast_msfilter()
235 static int compat_ipv6_set_mcast_msfilter(struct sock *sk, sockptr_t optval, in compat_ipv6_set_mcast_msfilter() argument
255 if (copy_from_sockptr(gf32, optval, optlen)) in compat_ipv6_set_mcast_msfilter()
280 sockptr_t optval, int optlen) in ipv6_mcast_join_leave() argument
[all …]
/linux/net/ipv4/
H A Dip_sockglue.c699 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument
706 if (copy_from_sockptr(&gr32, optval, sizeof(gr32))) in copy_group_source_from_sockptr()
714 if (copy_from_sockptr(greqs, optval, sizeof(*greqs))) in copy_group_source_from_sockptr()
722 sockptr_t optval, int optlen) in do_mcast_group_source() argument
729 err = copy_group_source_from_sockptr(&greqs, optval, optlen); in do_mcast_group_source()
769 static int ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval, int optlen) in ip_set_mcast_msfilter() argument
779 gsf = memdup_sockptr(optval, optlen); in ip_set_mcast_msfilter()
801 static int compat_ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval, in compat_ip_set_mcast_msfilter() argument
821 if (copy_from_sockptr(gf32, optval, optlen)) in compat_ip_set_mcast_msfilter()
846 sockptr_t optval, int optlen) in ip_mcast_join_leave() argument
[all …]
H A Dudp_impl.h15 int udp_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval,
18 char __user *optval, int __user *optlen);
/linux/net/rds/
H A Daf_rds.c293 static int rds_cancel_sent_to(struct rds_sock *rs, sockptr_t optval, int len) in rds_cancel_sent_to() argument
310 if (copy_from_sockptr(&sin, optval, in rds_cancel_sent_to()
318 if (copy_from_sockptr(&sin6, optval, in rds_cancel_sent_to()
330 static int rds_set_bool_option(unsigned char *optvar, sockptr_t optval, in rds_set_bool_option() argument
337 if (copy_from_sockptr(&value, optval, sizeof(int))) in rds_set_bool_option()
343 static int rds_cong_monitor(struct rds_sock *rs, sockptr_t optval, int optlen) in rds_cong_monitor() argument
347 ret = rds_set_bool_option(&rs->rs_cong_monitor, optval, optlen); in rds_cong_monitor()
360 static int rds_set_transport(struct rds_sock *rs, sockptr_t optval, int optlen) in rds_set_transport() argument
370 if (copy_from_sockptr(&t_type, optval, sizeof(t_type))) in rds_set_transport()
381 static int rds_enable_recvtstamp(struct sock *sk, sockptr_t optval, in rds_enable_recvtstamp() argument
[all …]
/linux/tools/testing/selftests/bpf/prog_tests/
H A Dsockopt.c114 offsetof(struct bpf_sockopt, optval)),
293 offsetof(struct bpf_sockopt, optval)),
358 offsetof(struct bpf_sockopt, optval)),
385 offsetof(struct bpf_sockopt, optval)),
489 offsetof(struct bpf_sockopt, optval)),
701 offsetof(struct bpf_sockopt, optval)),
738 offsetof(struct bpf_sockopt, optval)),
816 offsetof(struct bpf_sockopt, optval)),
843 offsetof(struct bpf_sockopt, optval)),
889 offsetof(struct bpf_sockopt, optval)),
[all …]
/linux/net/sctp/
H A Dsocket.c1388 char __user *optval, in sctp_getsockopt_connectx3() argument
1402 if (copy_from_user(&param32, optval, sizeof(param32))) in sctp_getsockopt_connectx3()
1413 if (copy_from_user(&param, optval, sizeof(param))) in sctp_getsockopt_connectx3()
1424 if (copy_to_user(optval, &assoc_id, sizeof(assoc_id))) in sctp_getsockopt_connectx3()
2269 static int sctp_setsockopt_autoclose(struct sock *sk, u32 *optval, in sctp_setsockopt_autoclose() argument
2281 sp->autoclose = *optval; in sctp_setsockopt_autoclose()
4571 sockptr_t optval, unsigned int optlen) in sctp_setsockopt() argument
4587 return af->setsockopt(sk, level, optname, optval, optlen); in sctp_setsockopt()
4595 kopt = memdup_sockptr(optval, optlen); in sctp_setsockopt()
5414 char __user *optval, in sctp_getsockopt_sctp_status() argument
[all …]
/linux/Documentation/bpf/
H A Dprog_cgroup_sockopt.rst16 all input arguments: ``level``, ``optname``, ``optval`` and ``optlen``.
44 sockopt. The BPF hook can observe ``optval``, ``optlen`` and ``retval``
60 * ``1`` - success: copy ``optval`` and ``optlen`` to userspace, return
78 adjust ``optval``, ``optlen`` and reset ``retval`` to 0. After that
84 to the input arguments (``level``, ``optname``, ``optval``, ``optlen``),
89 Large optval
91 When the ``optval`` is greater than the ``PAGE_SIZE``, the BPF program
96 done by the BPF program to the ``optval`` are ignored.
98 indicates that the kernel should use BPF's trimmed ``optval``.
118 optval[0] = ...;
[all …]
/linux/net/tls/
H A Dtls_main.c437 static int do_tls_getsockopt_conf(struct sock *sk, char __user *optval, in do_tls_getsockopt_conf() argument
450 if (!optval || (len < sizeof(*crypto_info))) { in do_tls_getsockopt_conf()
475 if (copy_to_user(optval, crypto_info, sizeof(*crypto_info))) in do_tls_getsockopt_conf()
491 if (copy_to_user(optval, crypto_info, cipher_desc->crypto_info)) in do_tls_getsockopt_conf()
498 static int do_tls_getsockopt_tx_zc(struct sock *sk, char __user *optval, in do_tls_getsockopt_tx_zc() argument
512 if (copy_to_user(optval, &value, sizeof(value))) in do_tls_getsockopt_tx_zc()
518 static int do_tls_getsockopt_no_pad(struct sock *sk, char __user *optval, in do_tls_getsockopt_no_pad() argument
540 if (copy_to_user(optval, &value, sizeof(value))) in do_tls_getsockopt_no_pad()
547 char __user *optval, int __user *optlen) in do_tls_getsockopt() argument
556 rc = do_tls_getsockopt_conf(sk, optval, optlen, in do_tls_getsockopt()
[all …]
/linux/net/dccp/
H A Dproto.c415 sockptr_t optval, unsigned int optlen) in dccp_setsockopt_service() argument
430 if (copy_from_sockptr_offset(sl->dccpsl_list, optval, in dccp_setsockopt_service()
485 sockptr_t optval, unsigned int optlen) in dccp_setsockopt_ccid() argument
493 val = memdup_sockptr(optval, optlen); in dccp_setsockopt_ccid()
510 sockptr_t optval, unsigned int optlen) in do_dccp_setsockopt() argument
526 return dccp_setsockopt_ccid(sk, optname, optval, optlen); in do_dccp_setsockopt()
532 if (copy_from_sockptr(&val, optval, sizeof(int))) in do_dccp_setsockopt()
536 return dccp_setsockopt_service(sk, val, optval, optlen); in do_dccp_setsockopt()
575 int dccp_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval, in dccp_setsockopt() argument
580 optname, optval, in dccp_setsockopt()
[all …]
H A Dccid.h80 u32 __user *optval,
84 u32 __user *optval,
243 u32 __user *optval, int __user *optlen) in ccid_hc_rx_getsockopt() argument
248 optval, optlen); in ccid_hc_rx_getsockopt()
254 u32 __user *optval, int __user *optlen) in ccid_hc_tx_getsockopt() argument
259 optval, optlen); in ccid_hc_tx_getsockopt()
/linux/drivers/net/bonding/
H A Dbond_procfs.c61 const struct bond_opt_value *optval; in bond_info_show_master() local
72 optval = bond_opt_get_val(BOND_OPT_FAIL_OVER_MAC, in bond_info_show_master()
74 seq_printf(seq, " (fail_over_mac %s)", optval->string); in bond_info_show_master()
80 optval = bond_opt_get_val(BOND_OPT_XMIT_HASH, in bond_info_show_master()
83 optval->string, bond->params.xmit_policy); in bond_info_show_master()
91 optval = bond_opt_get_val(BOND_OPT_PRIMARY_RESELECT, in bond_info_show_master()
94 optval->string); in bond_info_show_master()
158 optval = bond_opt_get_val(BOND_OPT_AD_SELECT, in bond_info_show_master()
161 optval->string); in bond_info_show_master()
/linux/net/dns_resolver/
H A Ddns_key.c158 char optval[128]; in dns_resolver_preparse() local
162 if (opt_len <= 0 || opt_len > sizeof(optval)) { in dns_resolver_preparse()
172 memcpy(optval, eq, next_opt - eq); in dns_resolver_preparse()
173 optval[next_opt - eq] = '\0'; in dns_resolver_preparse()
176 optval[0] = '\0'; in dns_resolver_preparse()
180 opt_nlen, opt_nlen, opt, optval); in dns_resolver_preparse()
188 ret = kstrtoul(optval, 10, &derrno); in dns_resolver_preparse()
/linux/drivers/net/ethernet/chelsio/inline_crypto/chtls/
H A Dchtls_main.c468 static int do_chtls_getsockopt(struct sock *sk, char __user *optval, in do_chtls_getsockopt() argument
474 if (copy_to_user(optval, &crypto_info, sizeof(struct tls_crypto_info))) in do_chtls_getsockopt()
480 char __user *optval, int __user *optlen) in chtls_getsockopt() argument
486 optname, optval, optlen); in chtls_getsockopt()
488 return do_chtls_getsockopt(sk, optval, optlen); in chtls_getsockopt()
492 sockptr_t optval, unsigned int optlen) in do_chtls_setsockopt() argument
502 if (sockptr_is_null(optval) || optlen < sizeof(*crypto_info)) { in do_chtls_setsockopt()
507 rc = copy_from_sockptr(&tmp_crypto_info, optval, sizeof(*crypto_info)); in do_chtls_setsockopt()
531 optval, sizeof(*crypto_info), in do_chtls_setsockopt()
548 optval, sizeof(*crypto_info), in do_chtls_setsockopt()
[all …]
/linux/net/bluetooth/
H A Dl2cap_sock.c436 char __user *optval, int __user *optlen) in l2cap_sock_getsockopt_old() argument
491 if (copy_to_user(optval, (char *) &opts, len)) in l2cap_sock_getsockopt_old()
523 if (put_user(opt, (u32 __user *) optval)) in l2cap_sock_getsockopt_old()
541 if (copy_to_user(optval, (char *) &cinfo, len)) in l2cap_sock_getsockopt_old()
556 char __user *optval, int __user *optlen) in l2cap_sock_getsockopt() argument
568 return l2cap_sock_getsockopt_old(sock, optname, optval, optlen); in l2cap_sock_getsockopt()
598 if (copy_to_user(optval, (char *) &sec, len)) in l2cap_sock_getsockopt()
610 (u32 __user *) optval)) in l2cap_sock_getsockopt()
617 (u32 __user *) optval)) in l2cap_sock_getsockopt()
632 if (copy_to_user(optval, (char *) &pwr, len)) in l2cap_sock_getsockopt()
[all …]
/linux/io_uring/
H A During_cmd.c315 void __user *optval; in io_uring_cmd_getsockopt() local
321 optval = u64_to_user_ptr(READ_ONCE(cmd->sqe->optval)); in io_uring_cmd_getsockopt()
326 USER_SOCKPTR(optval), in io_uring_cmd_getsockopt()
341 void __user *optval; in io_uring_cmd_setsockopt() local
344 optval = u64_to_user_ptr(READ_ONCE(cmd->sqe->optval)); in io_uring_cmd_setsockopt()
348 optval_s = USER_SOCKPTR(optval); in io_uring_cmd_setsockopt()
/linux/net/atm/
H A Dpvc.c66 sockptr_t optval, unsigned int optlen) in pvc_setsockopt() argument
72 error = vcc_setsockopt(sock, level, optname, optval, optlen); in pvc_setsockopt()
78 char __user *optval, int __user *optlen) in pvc_getsockopt() argument
84 error = vcc_getsockopt(sock, level, optname, optval, optlen); in pvc_getsockopt()
/linux/net/core/
H A Dsock.c360 int sock_get_timeout(long timeo, void *optval, bool old_timeval) in sock_get_timeout() argument
374 *(struct old_timeval32 *)optval = tv32; in sock_get_timeout()
382 *(struct __kernel_old_timeval *)optval = old_tv; in sock_get_timeout()
386 *(struct __kernel_sock_timeval *)optval = tv; in sock_get_timeout()
392 sockptr_t optval, int optlen, bool old_timeval) in sock_copy_user_timeval() argument
400 if (copy_from_sockptr(&tv32, optval, sizeof(tv32))) in sock_copy_user_timeval()
409 if (copy_from_sockptr(&old_tv, optval, sizeof(old_tv))) in sock_copy_user_timeval()
416 if (copy_from_sockptr(tv, optval, sizeof(*tv))) in sock_copy_user_timeval()
424 static int sock_set_timeout(long *timeo_p, sockptr_t optval, int optlen, in sock_set_timeout() argument
428 int err = sock_copy_user_timeval(&tv, optval, optlen, old_timeval); in sock_set_timeout()
[all …]
/linux/net/bluetooth/rfcomm/
H A Dsock.c620 sockptr_t optval, unsigned int optlen) in rfcomm_sock_setsockopt_old() argument
632 err = copy_safe_from_sockptr(&opt, sizeof(opt), optval, optlen); in rfcomm_sock_setsockopt_old()
661 sockptr_t optval, unsigned int optlen) in rfcomm_sock_setsockopt() argument
671 return rfcomm_sock_setsockopt_old(sock, optname, optval, optlen); in rfcomm_sock_setsockopt()
687 err = copy_safe_from_sockptr(&sec, sizeof(sec), optval, optlen); in rfcomm_sock_setsockopt()
705 err = copy_safe_from_sockptr(&opt, sizeof(opt), optval, optlen); in rfcomm_sock_setsockopt()
725 static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __… in rfcomm_sock_getsockopt_old() argument
767 if (put_user(opt, (u32 __user *) optval)) in rfcomm_sock_getsockopt_old()
787 if (copy_to_user(optval, (char *) &cinfo, len)) in rfcomm_sock_getsockopt_old()
801 static int rfcomm_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval,… in rfcomm_sock_getsockopt() argument
[all …]
/linux/kernel/bpf/
H A Dcgroup.c1785 /* When the optval fits into BPF_SOCKOPT_KERN_BUF_SIZE in sockopt_alloc_buf()
1788 ctx->optval = buf->data; in sockopt_alloc_buf()
1789 ctx->optval_end = ctx->optval + max_optlen; in sockopt_alloc_buf()
1793 ctx->optval = kzalloc(max_optlen, GFP_USER); in sockopt_alloc_buf()
1794 if (!ctx->optval) in sockopt_alloc_buf()
1797 ctx->optval_end = ctx->optval + max_optlen; in sockopt_alloc_buf()
1805 if (ctx->optval == buf->data) in sockopt_free_buf()
1807 kfree(ctx->optval); in sockopt_free_buf()
1813 return ctx->optval != buf->data; in sockopt_buf_allocated()
1817 int *optname, sockptr_t optval, in __cgroup_bpf_run_filter_setsockopt() argument
1908 __cgroup_bpf_run_filter_getsockopt(struct sock * sk,int level,int optname,sockptr_t optval,sockptr_t optlen,int max_optlen,int retval) __cgroup_bpf_run_filter_getsockopt() argument
1993 __cgroup_bpf_run_filter_getsockopt_kern(struct sock * sk,int level,int optname,void * optval,int * optlen,int retval) __cgroup_bpf_run_filter_getsockopt_kern() argument
[all...]

12345