/linux/tools/testing/selftests/bpf/progs/ |
A D | sockopt_sk.c | 33 __u8 *optval = ctx->optval; in _getsockopt() local 85 if (optval + 1 > optval_end) in _getsockopt() 91 optval[0] = 0x55; in _getsockopt() 107 if (optval + 1 > optval_end) in _getsockopt() 121 optval[0] = storage->val; in _getsockopt() 131 __u8 *optval = ctx->optval; in _setsockopt() local 157 *(__u32 *)optval = 0x55AA; in _setsockopt() 169 memcpy(optval, "cubic", 5); in _setsockopt() 184 optval[0] = 0; in _setsockopt() 200 if (optval + 1 > optval_end) in _setsockopt() [all …]
|
A D | sockopt_multi.c | 12 __u8 *optval = ctx->optval; in _getsockopt_child() local 17 if (optval + 1 > optval_end) in _getsockopt_child() 20 if (optval[0] != 0x80) in _getsockopt_child() 25 optval[0] = 0x90; in _getsockopt_child() 35 __u8 *optval = ctx->optval; in _getsockopt_parent() local 40 if (optval + 1 > optval_end) in _getsockopt_parent() 43 if (optval[0] != 0x90) in _getsockopt_parent() 48 optval[0] = 0xA0; in _getsockopt_parent() 58 __u8 *optval = ctx->optval; in _setsockopt() local 63 if (optval + 1 > optval_end) in _setsockopt() [all …]
|
A D | sockopt_inherit.c | 55 __u8 *optval = ctx->optval; in _getsockopt() local 60 if (optval + 1 > optval_end) in _getsockopt() 69 optval[0] = storage->val; in _getsockopt() 80 __u8 *optval = ctx->optval; in _setsockopt() local 85 if (optval + 1 > optval_end) in _setsockopt() 92 storage->val = optval[0]; in _setsockopt()
|
A D | sockopt_qos_to_cc.c | 16 int *optval = ctx->optval; in sockopt_qos_to_cc() local 24 if (optval + 1 > optval_end) in sockopt_qos_to_cc() 33 if (*optval == 0x2d) { in sockopt_qos_to_cc()
|
/linux/net/mptcp/ |
A D | sockopt.c | 123 sockptr_t optval = KERNEL_SOCKPTR(&val); in mptcp_sol_socket_intval() local 128 optval, sizeof(val)); in mptcp_sol_socket_intval() 147 sockptr_t optval = KERNEL_SOCKPTR(&val); in mptcp_setsockopt_sol_socket_tstamp() local 153 optval, sizeof(val)); in mptcp_setsockopt_sol_socket_tstamp() 171 sockptr_t optval, in mptcp_setsockopt_sol_socket_int() argument 207 sockptr_t optval, in mptcp_setsockopt_sol_socket_timestamping() argument 340 optval, optlen); in mptcp_setsockopt_sol_socket() 725 if (copy_to_user(optval, &m_info, len)) in mptcp_getsockopt_info() 732 char __user *optval, in mptcp_put_subflow_data() argument 746 if (copy_to_user(optval, sfd, copylen)) in mptcp_put_subflow_data() [all …]
|
/linux/net/ipv6/ |
A D | ipv6_sockglue.c | 142 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument 165 sockptr_t optval, int optlen) in do_ipv6_mcast_group_source() argument 216 gsf = memdup_sockptr(optval, optlen); in ipv6_set_mcast_msfilter() 281 sockptr_t optval, int optlen) in ipv6_mcast_join_leave() argument 301 sockptr_t optval, int optlen) in compat_ipv6_mcast_join_leave() argument 337 if (sockptr_is_null(optval)) in ipv6_set_opt_hdr() 344 new = memdup_sockptr(optval, optlen); in ipv6_set_opt_hdr() 403 if (sockptr_is_null(optval)) in do_ipv6_setsockopt() 669 sockptr_is_null(optval)) in do_ipv6_setsockopt() 1052 if (copy_to_user(optval, hdr, len)) in ipv6_getsockopt_sticky() [all …]
|
/linux/include/net/ |
A D | bond_options.h | 119 static inline void __bond_opt_init(struct bond_opt_value *optval, in __bond_opt_init() argument 122 memset(optval, 0, sizeof(*optval)); in __bond_opt_init() 123 optval->value = ULLONG_MAX; in __bond_opt_init() 125 optval->string = string; in __bond_opt_init() 127 optval->value = value; in __bond_opt_init() 129 #define bond_opt_initval(optval, value) __bond_opt_init(optval, NULL, value) argument 130 #define bond_opt_initstr(optval, str) __bond_opt_init(optval, str, ULLONG_MAX) argument
|
/linux/net/ipv4/ |
A D | ip_sockglue.c | 698 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument 721 sockptr_t optval, int optlen) in do_mcast_group_source() argument 778 gsf = memdup_sockptr(optval, optlen); in ip_set_mcast_msfilter() 845 sockptr_t optval, int optlen) in ip_mcast_join_leave() argument 867 sockptr_t optval, int optlen) in compat_ip_mcast_join_leave() argument 1219 if (copy_from_sockptr(&mreq, optval, in do_ip_setsockopt() 1240 msf = memdup_sockptr(optval, optlen); in do_ip_setsockopt() 1664 if (copy_to_user(optval, &addr, len)) in do_ip_getsockopt() 1704 msg.msg_control_user = optval; in do_ip_getsockopt() 1747 if (copy_to_user(optval, &ucval, 1)) in do_ip_getsockopt() [all …]
|
/linux/net/rds/ |
A D | af_rds.c | 310 if (copy_from_sockptr(&sin, optval, in rds_cancel_sent_to() 318 if (copy_from_sockptr(&sin6, optval, in rds_cancel_sent_to() 433 sockptr_t optval, unsigned int optlen) in rds_setsockopt() argument 445 ret = rds_cancel_sent_to(rs, optval, optlen); in rds_setsockopt() 448 ret = rds_get_mr(rs, optval, optlen); in rds_setsockopt() 451 ret = rds_get_mr_for_dest(rs, optval, optlen); in rds_setsockopt() 454 ret = rds_free_mr(rs, optval, optlen); in rds_setsockopt() 460 ret = rds_cong_monitor(rs, optval, optlen); in rds_setsockopt() 464 ret = rds_set_transport(rs, optval, optlen); in rds_setsockopt() 484 char __user *optval, int __user *optlen) in rds_getsockopt() argument [all …]
|
/linux/net/sctp/ |
A D | socket.c | 2271 sp->autoclose = *optval; in sctp_setsockopt_autoclose() 5478 char __user *optval, in sctp_getsockopt_peer_addr_info() argument 6541 char __user *optval, in sctp_getsockopt_rtoinfo() argument 7312 char __user *optval, in sctp_getsockopt_pr_supported() argument 7351 char __user *optval, in sctp_getsockopt_default_prinfo() argument 7397 char __user *optval, in sctp_getsockopt_pr_assocstatus() argument 7812 char __user *optval, in sctp_getsockopt_auth_supported() argument 7851 char __user *optval, in sctp_getsockopt_ecn_supported() argument 7988 char __user *optval, in sctp_getsockopt_probe_interval() argument 8120 optval, optlen); in sctp_getsockopt() [all …]
|
/linux/net/ipv4/bpfilter/ |
A D | sockopt.c | 24 static int bpfilter_mbox_request(struct sock *sk, int optname, sockptr_t optval, in bpfilter_mbox_request() argument 48 err = bpfilter_ops.sockopt(sk, optname, optval, optlen, is_set); in bpfilter_mbox_request() 54 int bpfilter_ip_set_sockopt(struct sock *sk, int optname, sockptr_t optval, in bpfilter_ip_set_sockopt() argument 57 return bpfilter_mbox_request(sk, optname, optval, optlen, true); in bpfilter_ip_set_sockopt() 60 int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval, in bpfilter_ip_get_sockopt() argument 68 return bpfilter_mbox_request(sk, optname, USER_SOCKPTR(optval), len, in bpfilter_ip_get_sockopt()
|
/linux/net/tls/ |
A D | tls_main.c | 347 if (!optval || (len < sizeof(*crypto_info))) { in do_tls_getsockopt_conf() 396 if (copy_to_user(optval, in do_tls_getsockopt_conf() 420 if (copy_to_user(optval, in do_tls_getsockopt_conf() 463 if (copy_to_user(optval, chacha20_poly1305, in do_tls_getsockopt_conf() 517 char __user *optval, int __user *optlen) in do_tls_getsockopt() argument 524 rc = do_tls_getsockopt_conf(sk, optval, optlen, in do_tls_getsockopt() 535 char __user *optval, int __user *optlen) in tls_getsockopt() argument 541 optname, optval, optlen); in tls_getsockopt() 543 return do_tls_getsockopt(sk, optname, optval, optlen); in tls_getsockopt() 692 rc = do_tls_setsockopt_conf(sk, optval, optlen, in do_tls_setsockopt() [all …]
|
/linux/net/dccp/ |
A D | proto.c | 414 sockptr_t optval, unsigned int optlen) in dccp_setsockopt_service() argument 484 sockptr_t optval, unsigned int optlen) in dccp_setsockopt_ccid() argument 492 val = memdup_sockptr(optval, optlen); in dccp_setsockopt_ccid() 509 sockptr_t optval, unsigned int optlen) in do_dccp_setsockopt() argument 579 optname, optval, in dccp_setsockopt() 587 __be32 __user *optval, in dccp_getsockopt_service() argument 606 put_user(dp->dccps_service, optval) || in dccp_getsockopt_service() 634 (__be32 __user *)optval, optlen); in do_dccp_getsockopt() 667 len, (u32 __user *)optval, optlen); in do_dccp_getsockopt() 670 len, (u32 __user *)optval, optlen); in do_dccp_getsockopt() [all …]
|
A 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/include/linux/ |
A D | bpf-cgroup.h | 186 int *optname, char __user *optval, 189 int optname, char __user *optval, 194 int optname, void *optval, 400 #define BPF_CGROUP_RUN_PROG_SETSOCKOPT(sock, level, optname, optval, optlen, \ argument 406 optname, optval, \ 420 #define BPF_CGROUP_RUN_PROG_GETSOCKOPT(sock, level, optname, optval, optlen, \ argument 430 sock, level, optname, optval, optlen, \ 441 sock, level, optname, optval, optlen, retval); \ 521 #define BPF_CGROUP_RUN_PROG_GETSOCKOPT(sock, level, optname, optval, \ argument 523 #define BPF_CGROUP_RUN_PROG_GETSOCKOPT_KERN(sock, level, optname, optval, \ argument [all …]
|
A 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, 20 int (*sockopt)(struct sock *sk, int optname, sockptr_t optval,
|
/linux/drivers/net/bonding/ |
A 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() 141 optval = bond_opt_get_val(BOND_OPT_AD_SELECT, in bond_info_show_master() 144 optval->string); in bond_info_show_master()
|
/linux/Documentation/bpf/ |
A 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``.
|
/linux/drivers/net/ethernet/chelsio/inline_crypto/chtls/ |
A D | chtls_main.c | 467 static int do_chtls_getsockopt(struct sock *sk, char __user *optval, in do_chtls_getsockopt() argument 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() 530 optval, sizeof(*crypto_info), in do_chtls_setsockopt() 547 optval, sizeof(*crypto_info), in do_chtls_setsockopt() 570 sockptr_t optval, unsigned int optlen) in chtls_setsockopt() argument 576 optname, optval, optlen); in chtls_setsockopt() [all …]
|
/linux/net/dns_resolver/ |
A 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/tools/testing/selftests/bpf/prog_tests/ |
A D | sockopt.c | 106 offsetof(struct bpf_sockopt, optval)), 321 offsetof(struct bpf_sockopt, optval)), 348 offsetof(struct bpf_sockopt, optval)), 452 offsetof(struct bpf_sockopt, optval)), 656 offsetof(struct bpf_sockopt, optval)), 734 offsetof(struct bpf_sockopt, optval)), 761 offsetof(struct bpf_sockopt, optval)), 880 void *optval = NULL; in run_test() local 925 optval = malloc(test->get_optlen); in run_test() 931 optval, &optlen); in run_test() [all …]
|
/linux/net/bluetooth/ |
A D | l2cap_sock.c | 511 if (put_user(opt, (u32 __user *) optval)) in l2cap_sock_getsockopt_old() 544 char __user *optval, int __user *optlen) in l2cap_sock_getsockopt() argument 586 if (copy_to_user(optval, (char *) &sec, len)) in l2cap_sock_getsockopt() 598 (u32 __user *) optval)) in l2cap_sock_getsockopt() 605 (u32 __user *) optval)) in l2cap_sock_getsockopt() 663 if (put_user(phys, (u32 __user *) optval)) in l2cap_sock_getsockopt() 684 if (put_user(mode, (u8 __user *) optval)) in l2cap_sock_getsockopt() 747 if (copy_from_sockptr(&opts, optval, len)) { in l2cap_sock_setsockopt_old() 870 sockptr_t optval, unsigned int optlen) in l2cap_sock_setsockopt() argument 902 if (copy_from_sockptr(&sec, optval, len)) { in l2cap_sock_setsockopt() [all …]
|
/linux/kernel/bpf/ |
A D | cgroup.c | 1388 ctx->optval = buf->data; in sockopt_alloc_buf() 1394 if (!ctx->optval) in sockopt_alloc_buf() 1405 if (ctx->optval == buf->data) in sockopt_free_buf() 1407 kfree(ctx->optval); in sockopt_free_buf() 1413 return ctx->optval != buf->data; in sockopt_buf_allocated() 1448 if (copy_from_user(ctx.optval, optval, min(*optlen, max_optlen)) != 0) { in __cgroup_bpf_run_filter_setsockopt() 1498 *kernel_optval = ctx.optval; in __cgroup_bpf_run_filter_setsockopt() 1556 if (copy_from_user(ctx.optval, optval, in __cgroup_bpf_run_filter_getsockopt() 1587 if (copy_to_user(optval, ctx.optval, ctx.optlen) || in __cgroup_bpf_run_filter_getsockopt() 1612 .optval = optval, in __cgroup_bpf_run_filter_getsockopt_kern() [all …]
|
/linux/net/atm/ |
A 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/net/bluetooth/rfcomm/ |
A D | sock.c | 622 sockptr_t optval, unsigned int optlen) in rfcomm_sock_setsockopt_old() argument 634 if (copy_from_sockptr(&opt, optval, sizeof(u32))) { in rfcomm_sock_setsockopt_old() 664 sockptr_t optval, unsigned int optlen) in rfcomm_sock_setsockopt() argument 675 return rfcomm_sock_setsockopt_old(sock, optname, optval, optlen); in rfcomm_sock_setsockopt() 692 if (copy_from_sockptr(&sec, optval, len)) { in rfcomm_sock_setsockopt() 711 if (copy_from_sockptr(&opt, optval, sizeof(u32))) { in rfcomm_sock_setsockopt() 773 if (put_user(opt, (u32 __user *) optval)) in rfcomm_sock_getsockopt_old() 793 if (copy_to_user(optval, (char *) &cinfo, len)) in rfcomm_sock_getsockopt_old() 816 return rfcomm_sock_getsockopt_old(sock, optname, optval, optlen); in rfcomm_sock_getsockopt() 837 if (copy_to_user(optval, (char *) &sec, len)) in rfcomm_sock_getsockopt() [all …]
|