From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751459AbcFWQzs (ORCPT ); Thu, 23 Jun 2016 12:55:48 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:61250 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750950AbcFWQzr (ORCPT ); Thu, 23 Jun 2016 12:55:47 -0400 Date: Thu, 23 Jun 2016 09:54:49 -0700 From: Martin KaFai Lau To: Daniel Borkmann CC: , , , Alexei Starovoitov , Tejun Heo , Subject: Re: [PATCH net-next v2 3/4] cgroup: bpf: Add bpf_skb_in_cgroup_proto Message-ID: <20160623165449.GC82305@kafai-mba.local> References: <1466630252-3822277-1-git-send-email-kafai@fb.com> <1466630252-3822277-4-git-send-email-kafai@fb.com> <576BB1AE.5080605@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <576BB1AE.5080605@iogearbox.net> User-Agent: Mutt/1.5.23.1 (2014-03-12) X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-23_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2016 at 11:53:50AM +0200, Daniel Borkmann wrote: > >diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > >index 668e079..68753e0 100644 > >--- a/kernel/bpf/verifier.c > >+++ b/kernel/bpf/verifier.c > >@@ -1062,6 +1062,10 @@ static int check_map_func_compatibility(struct bpf_map *map, int func_id) > > if (func_id != BPF_FUNC_get_stackid) > > goto error; > > break; > >+ case BPF_MAP_TYPE_CGROUP_ARRAY: > >+ if (func_id != BPF_FUNC_skb_in_cgroup) > >+ goto error; > >+ break; > > I think the BPF_MAP_TYPE_CGROUP_ARRAY case should have been fist here in > patch 2/4, but with unconditional goto error. And this one only adds the > 'func_id != BPF_FUNC_skb_in_cgroup' test. I am not sure I understand. Can you elaborate? I am probably missing something here. > > > default: > > break; > > } > >@@ -1081,6 +1085,10 @@ static int check_map_func_compatibility(struct bpf_map *map, int func_id) > > if (map->map_type != BPF_MAP_TYPE_STACK_TRACE) > > goto error; > > break; > >+ case BPF_FUNC_skb_in_cgroup: > >+ if (map->map_type != BPF_MAP_TYPE_CGROUP_ARRAY) > >+ goto error; > >+ break; > > default: > > break; > > }