On 12/01/2021 23:55, Ilya Maximets wrote:
> On 1/11/21 7:22 PM, Mark Gray wrote:
>> On 18/12/2020 13:34, Ilya Maximets wrote:
>>> OVS should not exit if it cannot format NSH actions for the user.
>>> It should just report the error like the other formatting functions do.
>>>
>>> Credit to OSS-Fuzz.
>>>
>>> Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21509
>>> Fixes: 1fc11c5948cf ("Generic encap and decap support for NSH")
>>> Signed-off-by: Ilya Maximets <[email protected]>
>>> ---
>>>  lib/odp-util.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/odp-util.c b/lib/odp-util.c
>>> index 879dea97e..bf19fa647 100644
>>> --- a/lib/odp-util.c
>>> +++ b/lib/odp-util.c
>>> @@ -391,7 +391,8 @@ format_odp_push_nsh_action(struct ds *ds,
>>>          break;
>>>      }
>>>      default:
>>> -        OVS_NOT_REACHED();
>>
>> As we are not abort()ing, I wonder should we additionally log that this
>> is unexpected. I am not sure that the problem would be would be entirely
>> obvious from an output like the following. Also, it should probably be
>> logged explicitly as an error.
> 
> These functions (format_odp_*_action) creates the string for some other
> parts of OVS.  Most likely this is already formatting for a log message
> and in most cases this is an error message due to some problems with
> this particular set of actions.  So, having one more extra log message
> doesn't make much sense.  Anyway, none of the other similar functions
> does that.

Ok, if you are happy it follows this same pattern, then leave as is.

Acked-by: Mark Gray <[email protected]>
> 
>>
>> ufid:479d4436-123f-4492-b822-1d84431d5595
>> recirc_id(0),dp_hash(0/0),skb_priority(0/0),in_port(5),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(0/0),eth(src=ea:04:01:22:b2:68/00:00:00:00:00:00,dst=01:02:03:04:05:06/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.1.1.1/0.0.0.0,dst=10.1.1.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0),
>> actions:push_nsh(flags=0,ttl=63,mdtype=0,np=3,spi=0x0,si=255,<error:
>> unknown mdtype>),push_eth(src=00:00:00:00:00:00,dst=00:00:00:00:00:00),6
>>
>>
>>> +        ds_put_cstr(ds, ",<error: unknown mdtype>");
>>> +        break;
>>>      }
>>>      ds_put_format(ds, ")");
>>>  }
>>>
>>
>> It's a little difficult to test but I hacked the code to test it.
> 

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to