[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <245d2776-ff4c-0c55-6eb9-cde7452efc78@gmail.com>
Date:   Thu, 17 May 2018 13:12:52 -0700
From:   John Fastabend <john.fastabend@...il.com>
To:     Martin KaFai Lau <kafai@...com>
Cc:     ast@...nel.org, daniel@...earbox.net, netdev@...r.kernel.org
Subject: Re: [bpf-next PATCH 2/2] bpf: add sk_msg prog sk access tests to
 test_verifier
On 05/17/2018 11:57 AM, Martin KaFai Lau wrote:
> On Thu, May 17, 2018 at 08:54:10AM -0700, John Fastabend wrote:
>> Add tests for BPF_PROG_TYPE_SK_MSG to test_verifier for read access
>> to new sk fields.
>>
>> Signed-off-by: John Fastabend <john.fastabend@...il.com>
>> ---
[...]
>> +	{
>> +		"invalid read past end of SK_MSG",
>> +		.insns = {
>> +			BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
>> +				    offsetof(struct sk_msg_md, local_port) + 4),
>> +			BPF_EXIT_INSN(),
>> +		},
>> +		.errstr = "",
> no errstr in this case?
> 
>> +		.result = REJECT,
>> +		.prog_type = BPF_PROG_TYPE_SK_MSG,
>> +	},
>> +	{
>> +		"invalid read offset in SK_MSG",
>> +		.insns = {
>> +			BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1,
>> +				    offsetof(struct sk_msg_md, family) + 1),
>> +			BPF_EXIT_INSN(),
>> +		},
>> +		.errstr = "",
> same here.
> 
>> +		.result = REJECT,
>> +		.prog_type = BPF_PROG_TYPE_SK_MSG,
>> +	},
>> +	{
>>  		"direct packet read for SK_MSG",
>>  		.insns = {
>>  			BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1,
>>
> Other than the above,
> 
For completeness I guess we should have the err string
included. I'll send a v2 and push ACKs forward.
> Acked-by: Martin KaFai Lau <kafai@...com>
> 
Powered by blists - more mailing lists
 
