@ -3258,7 +3258,7 @@ bpf_base_func_proto(enum bpf_func_id func_id)
}
}
static const struct bpf_func_proto *
static const struct bpf_func_proto *
sock_filter_func_proto ( enum bpf_func_id func_id )
sock_filter_func_proto ( enum bpf_func_id func_id , const struct bpf_prog * prog )
{
{
switch ( func_id ) {
switch ( func_id ) {
/* inet and inet6 sockets are created in a process
/* inet and inet6 sockets are created in a process
@ -3272,7 +3272,7 @@ sock_filter_func_proto(enum bpf_func_id func_id)
}
}
static const struct bpf_func_proto *
static const struct bpf_func_proto *
sk_filter_func_proto ( enum bpf_func_id func_id )
sk_filter_func_proto ( enum bpf_func_id func_id , const struct bpf_prog * prog )
{
{
switch ( func_id ) {
switch ( func_id ) {
case BPF_FUNC_skb_load_bytes :
case BPF_FUNC_skb_load_bytes :
@ -3289,7 +3289,7 @@ sk_filter_func_proto(enum bpf_func_id func_id)
}
}
static const struct bpf_func_proto *
static const struct bpf_func_proto *
tc_cls_act_func_proto ( enum bpf_func_id func_id )
tc_cls_act_func_proto ( enum bpf_func_id func_id , const struct bpf_prog * prog )
{
{
switch ( func_id ) {
switch ( func_id ) {
case BPF_FUNC_skb_store_bytes :
case BPF_FUNC_skb_store_bytes :
@ -3360,7 +3360,7 @@ tc_cls_act_func_proto(enum bpf_func_id func_id)
}
}
static const struct bpf_func_proto *
static const struct bpf_func_proto *
xdp_func_proto ( enum bpf_func_id func_id )
xdp_func_proto ( enum bpf_func_id func_id , const struct bpf_prog * prog )
{
{
switch ( func_id ) {
switch ( func_id ) {
case BPF_FUNC_perf_event_output :
case BPF_FUNC_perf_event_output :
@ -3379,7 +3379,7 @@ xdp_func_proto(enum bpf_func_id func_id)
}
}
static const struct bpf_func_proto *
static const struct bpf_func_proto *
lwt_inout_func_proto ( enum bpf_func_id func_id )
lwt_inout_func_proto ( enum bpf_func_id func_id , const struct bpf_prog * prog )
{
{
switch ( func_id ) {
switch ( func_id ) {
case BPF_FUNC_skb_load_bytes :
case BPF_FUNC_skb_load_bytes :
@ -3406,7 +3406,7 @@ lwt_inout_func_proto(enum bpf_func_id func_id)
}
}
static const struct bpf_func_proto *
static const struct bpf_func_proto *
sock_ops_func_proto ( enum bpf_func_id func_id )
sock_ops_func_proto ( enum bpf_func_id func_id , const struct bpf_prog * prog )
{
{
switch ( func_id ) {
switch ( func_id ) {
case BPF_FUNC_setsockopt :
case BPF_FUNC_setsockopt :
@ -3418,7 +3418,8 @@ static const struct bpf_func_proto *
}
}
}
}
static const struct bpf_func_proto * sk_skb_func_proto ( enum bpf_func_id func_id )
static const struct bpf_func_proto *
sk_skb_func_proto ( enum bpf_func_id func_id , const struct bpf_prog * prog )
{
{
switch ( func_id ) {
switch ( func_id ) {
case BPF_FUNC_skb_store_bytes :
case BPF_FUNC_skb_store_bytes :
@ -3443,7 +3444,7 @@ static const struct bpf_func_proto *sk_skb_func_proto(enum bpf_func_id func_id)
}
}
static const struct bpf_func_proto *
static const struct bpf_func_proto *
lwt_xmit_func_proto ( enum bpf_func_id func_id )
lwt_xmit_func_proto ( enum bpf_func_id func_id , const struct bpf_prog * prog )
{
{
switch ( func_id ) {
switch ( func_id ) {
case BPF_FUNC_skb_get_tunnel_key :
case BPF_FUNC_skb_get_tunnel_key :
@ -3473,11 +3474,12 @@ lwt_xmit_func_proto(enum bpf_func_id func_id)
case BPF_FUNC_set_hash_invalid :
case BPF_FUNC_set_hash_invalid :
return & bpf_set_hash_invalid_proto ;
return & bpf_set_hash_invalid_proto ;
default :
default :
return lwt_inout_func_proto ( func_id ) ;
return lwt_inout_func_proto ( func_id , prog ) ;
}
}
}
}
static bool bpf_skb_is_valid_access ( int off , int size , enum bpf_access_type type ,
static bool bpf_skb_is_valid_access ( int off , int size , enum bpf_access_type type ,
const struct bpf_prog * prog ,
struct bpf_insn_access_aux * info )
struct bpf_insn_access_aux * info )
{
{
const int size_default = sizeof ( __u32 ) ;
const int size_default = sizeof ( __u32 ) ;
@ -3520,6 +3522,7 @@ static bool bpf_skb_is_valid_access(int off, int size, enum bpf_access_type type
static bool sk_filter_is_valid_access ( int off , int size ,
static bool sk_filter_is_valid_access ( int off , int size ,
enum bpf_access_type type ,
enum bpf_access_type type ,
const struct bpf_prog * prog ,
struct bpf_insn_access_aux * info )
struct bpf_insn_access_aux * info )
{
{
switch ( off ) {
switch ( off ) {
@ -3539,11 +3542,12 @@ static bool sk_filter_is_valid_access(int off, int size,
}
}
}
}
return bpf_skb_is_valid_access ( off , size , type , info ) ;
return bpf_skb_is_valid_access ( off , size , type , prog , info ) ;
}
}
static bool lwt_is_valid_access ( int off , int size ,
static bool lwt_is_valid_access ( int off , int size ,
enum bpf_access_type type ,
enum bpf_access_type type ,
const struct bpf_prog * prog ,
struct bpf_insn_access_aux * info )
struct bpf_insn_access_aux * info )
{
{
switch ( off ) {
switch ( off ) {
@ -3572,11 +3576,12 @@ static bool lwt_is_valid_access(int off, int size,
break ;
break ;
}
}
return bpf_skb_is_valid_access ( off , size , type , info ) ;
return bpf_skb_is_valid_access ( off , size , type , prog , info ) ;
}
}
static bool sock_filter_is_valid_access ( int off , int size ,
static bool sock_filter_is_valid_access ( int off , int size ,
enum bpf_access_type type ,
enum bpf_access_type type ,
const struct bpf_prog * prog ,
struct bpf_insn_access_aux * info )
struct bpf_insn_access_aux * info )
{
{
if ( type = = BPF_WRITE ) {
if ( type = = BPF_WRITE ) {
@ -3648,6 +3653,7 @@ static int tc_cls_act_prologue(struct bpf_insn *insn_buf, bool direct_write,
static bool tc_cls_act_is_valid_access ( int off , int size ,
static bool tc_cls_act_is_valid_access ( int off , int size ,
enum bpf_access_type type ,
enum bpf_access_type type ,
const struct bpf_prog * prog ,
struct bpf_insn_access_aux * info )
struct bpf_insn_access_aux * info )
{
{
if ( type = = BPF_WRITE ) {
if ( type = = BPF_WRITE ) {
@ -3674,7 +3680,7 @@ static bool tc_cls_act_is_valid_access(int off, int size,
return false ;
return false ;
}
}
return bpf_skb_is_valid_access ( off , size , type , info ) ;
return bpf_skb_is_valid_access ( off , size , type , prog , info ) ;
}
}
static bool __is_valid_xdp_access ( int off , int size )
static bool __is_valid_xdp_access ( int off , int size )
@ -3691,6 +3697,7 @@ static bool __is_valid_xdp_access(int off, int size)
static bool xdp_is_valid_access ( int off , int size ,
static bool xdp_is_valid_access ( int off , int size ,
enum bpf_access_type type ,
enum bpf_access_type type ,
const struct bpf_prog * prog ,
struct bpf_insn_access_aux * info )
struct bpf_insn_access_aux * info )
{
{
if ( type = = BPF_WRITE )
if ( type = = BPF_WRITE )
@ -3733,6 +3740,7 @@ static bool __is_valid_sock_ops_access(int off, int size)
static bool sock_ops_is_valid_access ( int off , int size ,
static bool sock_ops_is_valid_access ( int off , int size ,
enum bpf_access_type type ,
enum bpf_access_type type ,
const struct bpf_prog * prog ,
struct bpf_insn_access_aux * info )
struct bpf_insn_access_aux * info )
{
{
if ( type = = BPF_WRITE ) {
if ( type = = BPF_WRITE ) {
@ -3756,6 +3764,7 @@ static int sk_skb_prologue(struct bpf_insn *insn_buf, bool direct_write,
static bool sk_skb_is_valid_access ( int off , int size ,
static bool sk_skb_is_valid_access ( int off , int size ,
enum bpf_access_type type ,
enum bpf_access_type type ,
const struct bpf_prog * prog ,
struct bpf_insn_access_aux * info )
struct bpf_insn_access_aux * info )
{
{
if ( type = = BPF_WRITE ) {
if ( type = = BPF_WRITE ) {
@ -3780,7 +3789,7 @@ static bool sk_skb_is_valid_access(int off, int size,
break ;
break ;
}
}
return bpf_skb_is_valid_access ( off , size , type , info ) ;
return bpf_skb_is_valid_access ( off , size , type , prog , info ) ;
}
}
static u32 bpf_convert_ctx_access ( enum bpf_access_type type ,
static u32 bpf_convert_ctx_access ( enum bpf_access_type type ,