/Linux-v6.6/tools/testing/selftests/bpf/progs/ |
D | sockopt_sk.c | 33 __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 …]
|
D | sockopt_multi.c | 14 __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 …]
|
D | sockopt_inherit.c | 57 __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()
|
D | sockopt_qos_to_cc.c | 18 int *optval = ctx->optval; in sockopt_qos_to_cc() local 26 if (optval + 1 > optval_end) in sockopt_qos_to_cc() 35 if (*optval == 0x2d) { in sockopt_qos_to_cc()
|
/Linux-v6.6/net/mptcp/ |
D | sockopt.c | 58 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() 124 sockptr_t optval = KERNEL_SOCKPTR(&val); in mptcp_sol_socket_intval() local 129 optval, sizeof(val)); in mptcp_sol_socket_intval() 148 sockptr_t optval = KERNEL_SOCKPTR(&val); in mptcp_setsockopt_sol_socket_tstamp() local 154 optval, sizeof(val)); in mptcp_setsockopt_sol_socket_tstamp() 172 sockptr_t optval, in mptcp_setsockopt_sol_socket_int() argument 177 ret = mptcp_get_int_option(msk, optval, optlen, &val); in mptcp_setsockopt_sol_socket_int() 208 sockptr_t optval, in mptcp_setsockopt_sol_socket_timestamping() argument 217 if (copy_from_sockptr(×tamping, optval, in mptcp_setsockopt_sol_socket_timestamping() [all …]
|
/Linux-v6.6/include/net/ |
D | bond_options.h | 138 static inline void __bond_opt_init(struct bond_opt_value *optval, in __bond_opt_init() argument 142 memset(optval, 0, sizeof(*optval)); in __bond_opt_init() 143 optval->value = ULLONG_MAX; in __bond_opt_init() 145 optval->value = value; in __bond_opt_init() 147 optval->string = string; in __bond_opt_init() 150 memcpy(optval->extra, extra, extra_len); in __bond_opt_init() 152 #define bond_opt_initval(optval, value) __bond_opt_init(optval, NULL, value, NULL, 0) argument 153 #define bond_opt_initstr(optval, str) __bond_opt_init(optval, str, ULLONG_MAX, NULL, 0) argument 154 #define bond_opt_initextra(optval, extra, extra_len) \ argument 155 __bond_opt_init(optval, NULL, ULLONG_MAX, extra, extra_len) [all …]
|
/Linux-v6.6/net/ipv6/ |
D | ipv6_sockglue.c | 142 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument 149 if (copy_from_sockptr(&gr32, optval, sizeof(gr32))) in copy_group_source_from_sockptr() 157 if (copy_from_sockptr(greqs, optval, sizeof(*greqs))) in copy_group_source_from_sockptr() 165 sockptr_t optval, int optlen) in do_ipv6_mcast_group_source() argument 171 ret = copy_group_source_from_sockptr(&greqs, optval, optlen); in do_ipv6_mcast_group_source() 205 static int ipv6_set_mcast_msfilter(struct sock *sk, sockptr_t optval, in ipv6_set_mcast_msfilter() argument 216 gsf = memdup_sockptr(optval, optlen); in ipv6_set_mcast_msfilter() 236 static int compat_ipv6_set_mcast_msfilter(struct sock *sk, sockptr_t optval, in compat_ipv6_set_mcast_msfilter() argument 256 if (copy_from_sockptr(gf32, optval, optlen)) in compat_ipv6_set_mcast_msfilter() 281 sockptr_t optval, int optlen) in ipv6_mcast_join_leave() argument [all …]
|
D | raw.c | 939 sockptr_t optval, int optlen) in rawv6_seticmpfilter() argument 945 if (copy_from_sockptr(&raw6_sk(sk)->filter, optval, optlen)) in rawv6_seticmpfilter() 956 char __user *optval, int __user *optlen) in rawv6_geticmpfilter() argument 970 if (copy_to_user(optval, &raw6_sk(sk)->filter, len)) in rawv6_geticmpfilter() 982 sockptr_t optval, unsigned int optlen) in do_rawv6_setsockopt() argument 990 if (copy_from_sockptr(&val, optval, sizeof(val))) in do_rawv6_setsockopt() 1032 sockptr_t optval, unsigned int optlen) in rawv6_setsockopt() argument 1041 return rawv6_seticmpfilter(sk, level, optname, optval, optlen); in rawv6_setsockopt() 1048 return ipv6_setsockopt(sk, level, optname, optval, optlen); in rawv6_setsockopt() 1051 return do_rawv6_setsockopt(sk, level, optname, optval, optlen); in rawv6_setsockopt() [all …]
|
/Linux-v6.6/net/ipv4/ |
D | ip_sockglue.c | 701 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument 708 if (copy_from_sockptr(&gr32, optval, sizeof(gr32))) in copy_group_source_from_sockptr() 716 if (copy_from_sockptr(greqs, optval, sizeof(*greqs))) in copy_group_source_from_sockptr() 724 sockptr_t optval, int optlen) in do_mcast_group_source() argument 731 err = copy_group_source_from_sockptr(&greqs, optval, optlen); in do_mcast_group_source() 771 static int ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval, int optlen) in ip_set_mcast_msfilter() argument 781 gsf = memdup_sockptr(optval, optlen); in ip_set_mcast_msfilter() 803 static int compat_ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval, in compat_ip_set_mcast_msfilter() argument 823 if (copy_from_sockptr(gf32, optval, optlen)) in compat_ip_set_mcast_msfilter() 848 sockptr_t optval, int optlen) in ip_mcast_join_leave() argument [all …]
|
/Linux-v6.6/net/ipv4/bpfilter/ |
D | sockopt.c | 15 static int bpfilter_mbox_request(struct sock *sk, int optname, sockptr_t optval, in bpfilter_mbox_request() argument 39 err = bpfilter_ops.sockopt(sk, optname, optval, optlen, is_set); in bpfilter_mbox_request() 45 int bpfilter_ip_set_sockopt(struct sock *sk, int optname, sockptr_t optval, in bpfilter_ip_set_sockopt() argument 48 return bpfilter_mbox_request(sk, optname, optval, optlen, true); in bpfilter_ip_set_sockopt() 51 int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval, in bpfilter_ip_get_sockopt() argument 59 return bpfilter_mbox_request(sk, optname, USER_SOCKPTR(optval), len, in bpfilter_ip_get_sockopt()
|
/Linux-v6.6/net/rds/ |
D | af_rds.c | 293 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-v6.6/net/sctp/ |
D | socket.c | 1387 char __user *optval, in sctp_getsockopt_connectx3() argument 1401 if (copy_from_user(¶m32, optval, sizeof(param32))) in sctp_getsockopt_connectx3() 1412 if (copy_from_user(¶m, optval, sizeof(param))) in sctp_getsockopt_connectx3() 1423 if (copy_to_user(optval, &assoc_id, sizeof(assoc_id))) in sctp_getsockopt_connectx3() 2261 static int sctp_setsockopt_autoclose(struct sock *sk, u32 *optval, in sctp_setsockopt_autoclose() argument 2273 sp->autoclose = *optval; in sctp_setsockopt_autoclose() 4563 sockptr_t optval, unsigned int optlen) in sctp_setsockopt() argument 4579 return af->setsockopt(sk, level, optname, optval, optlen); in sctp_setsockopt() 4587 kopt = memdup_sockptr(optval, optlen); in sctp_setsockopt() 5401 char __user *optval, in sctp_getsockopt_sctp_status() argument [all …]
|
/Linux-v6.6/Documentation/bpf/ |
D | prog_cgroup_sockopt.rst | 16 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-v6.6/net/tls/ |
D | tls_main.c | 438 static int do_tls_getsockopt_conf(struct sock *sk, char __user *optval, in do_tls_getsockopt_conf() argument 451 if (!optval || (len < sizeof(*crypto_info))) { in do_tls_getsockopt_conf() 476 if (copy_to_user(optval, crypto_info, sizeof(*crypto_info))) in do_tls_getsockopt_conf() 492 if (copy_to_user(optval, crypto_info, cipher_desc->crypto_info)) in do_tls_getsockopt_conf() 499 static int do_tls_getsockopt_tx_zc(struct sock *sk, char __user *optval, in do_tls_getsockopt_tx_zc() argument 513 if (copy_to_user(optval, &value, sizeof(value))) in do_tls_getsockopt_tx_zc() 519 static int do_tls_getsockopt_no_pad(struct sock *sk, char __user *optval, in do_tls_getsockopt_no_pad() argument 541 if (copy_to_user(optval, &value, sizeof(value))) in do_tls_getsockopt_no_pad() 548 char __user *optval, int __user *optlen) in do_tls_getsockopt() argument 557 rc = do_tls_getsockopt_conf(sk, optval, optlen, in do_tls_getsockopt() [all …]
|
/Linux-v6.6/net/dccp/ |
D | proto.c | 415 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 …]
|
D | ccid.h | 80 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-v6.6/include/linux/ |
D | bpfilter.h | 10 int bpfilter_ip_set_sockopt(struct sock *sk, int optname, sockptr_t optval, 12 int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval, 19 int (*sockopt)(struct sock *sk, int optname, sockptr_t optval,
|
D | bpf-cgroup.h | 140 int *optname, char __user *optval, 143 int optname, char __user *optval, 148 int optname, void *optval, 363 #define BPF_CGROUP_RUN_PROG_SETSOCKOPT(sock, level, optname, optval, optlen, \ argument 370 optname, optval, \ 384 #define BPF_CGROUP_RUN_PROG_GETSOCKOPT(sock, level, optname, optval, optlen, \ argument 395 sock, level, optname, optval, optlen, \ 400 #define BPF_CGROUP_RUN_PROG_GETSOCKOPT_KERN(sock, level, optname, optval, \ argument 406 sock, level, optname, optval, optlen, retval); \ 502 #define BPF_CGROUP_RUN_PROG_GETSOCKOPT(sock, level, optname, optval, \ argument [all …]
|
/Linux-v6.6/net/dns_resolver/ |
D | dns_key.c | 151 char optval[128]; in dns_resolver_preparse() local 155 if (opt_len <= 0 || opt_len > sizeof(optval)) { in dns_resolver_preparse() 165 memcpy(optval, eq, next_opt - eq); in dns_resolver_preparse() 166 optval[next_opt - eq] = '\0'; in dns_resolver_preparse() 169 optval[0] = '\0'; in dns_resolver_preparse() 173 opt_nlen, opt_nlen, opt, optval); in dns_resolver_preparse() 181 ret = kstrtoul(optval, 10, &derrno); in dns_resolver_preparse()
|
/Linux-v6.6/drivers/net/bonding/ |
D | bond_procfs.c | 61 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-v6.6/drivers/net/ethernet/chelsio/inline_crypto/chtls/ |
D | chtls_main.c | 467 static int do_chtls_getsockopt(struct sock *sk, char __user *optval, in do_chtls_getsockopt() argument 473 if (copy_to_user(optval, &crypto_info, sizeof(struct tls_crypto_info))) in do_chtls_getsockopt() 479 char __user *optval, int __user *optlen) in chtls_getsockopt() argument 485 optname, optval, optlen); in chtls_getsockopt() 487 return do_chtls_getsockopt(sk, optval, optlen); in chtls_getsockopt() 491 sockptr_t optval, unsigned int optlen) in do_chtls_setsockopt() argument 501 if (sockptr_is_null(optval) || optlen < sizeof(*crypto_info)) { in do_chtls_setsockopt() 506 rc = copy_from_sockptr(&tmp_crypto_info, optval, sizeof(*crypto_info)); in do_chtls_setsockopt() 530 optval, sizeof(*crypto_info), in do_chtls_setsockopt() 547 optval, sizeof(*crypto_info), in do_chtls_setsockopt() [all …]
|
/Linux-v6.6/tools/testing/selftests/bpf/prog_tests/ |
D | sockopt.c | 111 offsetof(struct bpf_sockopt, optval)), 287 offsetof(struct bpf_sockopt, optval)), 349 offsetof(struct bpf_sockopt, optval)), 376 offsetof(struct bpf_sockopt, optval)), 480 offsetof(struct bpf_sockopt, optval)), 686 offsetof(struct bpf_sockopt, optval)), 723 offsetof(struct bpf_sockopt, optval)), 801 offsetof(struct bpf_sockopt, optval)), 828 offsetof(struct bpf_sockopt, optval)), 874 offsetof(struct bpf_sockopt, optval)), [all …]
|
/Linux-v6.6/net/bluetooth/ |
D | l2cap_sock.c | 435 char __user *optval, int __user *optlen) in l2cap_sock_getsockopt_old() argument 489 if (copy_to_user(optval, (char *) &opts, len)) in l2cap_sock_getsockopt_old() 521 if (put_user(opt, (u32 __user *) optval)) in l2cap_sock_getsockopt_old() 539 if (copy_to_user(optval, (char *) &cinfo, len)) in l2cap_sock_getsockopt_old() 554 char __user *optval, int __user *optlen) in l2cap_sock_getsockopt() argument 566 return l2cap_sock_getsockopt_old(sock, optname, optval, optlen); in l2cap_sock_getsockopt() 596 if (copy_to_user(optval, (char *) &sec, len)) in l2cap_sock_getsockopt() 608 (u32 __user *) optval)) in l2cap_sock_getsockopt() 615 (u32 __user *) optval)) in l2cap_sock_getsockopt() 630 if (copy_to_user(optval, (char *) &pwr, len)) in l2cap_sock_getsockopt() [all …]
|
/Linux-v6.6/net/atm/ |
D | pvc.c | 66 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-v6.6/net/core/ |
D | sock.c | 363 int sock_get_timeout(long timeo, void *optval, bool old_timeval) in sock_get_timeout() argument 377 *(struct old_timeval32 *)optval = tv32; in sock_get_timeout() 385 *(struct __kernel_old_timeval *)optval = old_tv; in sock_get_timeout() 389 *(struct __kernel_sock_timeval *)optval = tv; in sock_get_timeout() 395 sockptr_t optval, int optlen, bool old_timeval) in sock_copy_user_timeval() argument 403 if (copy_from_sockptr(&tv32, optval, sizeof(tv32))) in sock_copy_user_timeval() 412 if (copy_from_sockptr(&old_tv, optval, sizeof(old_tv))) in sock_copy_user_timeval() 419 if (copy_from_sockptr(tv, optval, sizeof(*tv))) in sock_copy_user_timeval() 427 static int sock_set_timeout(long *timeo_p, sockptr_t optval, int optlen, in sock_set_timeout() argument 431 int err = sock_copy_user_timeval(&tv, optval, optlen, old_timeval); in sock_set_timeout() [all …]
|