lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7010fba902ac4720bedb641516880c65@baidu.com>
Date:   Thu, 9 Jan 2020 10:24:15 +0000
From:   "Li,Rongqing" <lirongqing@...du.com>
To:     Daniel Borkmann <daniel@...earbox.net>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        "brouer@...hat.com" <brouer@...hat.com>
Subject: 答复: [PATCH][bpf-next] bpf: return EOPNOTSUPP when invalid map type in __bpf_tx_xdp_map



> -----邮件原件-----
> 发件人: Daniel Borkmann [mailto:daniel@...earbox.net]
> 发送时间: 2020年1月9日 1:18
> 收件人: Li,Rongqing <lirongqing@...du.com>
> 抄送: netdev@...r.kernel.org; bpf@...r.kernel.org; brouer@...hat.com
> 主题: Re: [PATCH][bpf-next] bpf: return EOPNOTSUPP when invalid map type in
> __bpf_tx_xdp_map
> 
> On 1/3/20 7:25 AM, Li RongQing wrote:
> > a negative value -EOPNOTSUPP should be returned if map->map_type is
> > invalid although that seems unlikely now, then the caller will
> > continue to handle buffer, or else the buffer will be leaked
> >
> > Signed-off-by: Li RongQing <lirongqing@...du.com>
> > ---
> >   net/core/filter.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/core/filter.c b/net/core/filter.c index
> > 1cbac34a4e11..40fa5905321c 100644
> > --- a/net/core/filter.c
> > +++ b/net/core/filter.c
> > @@ -3512,7 +3512,7 @@ static int __bpf_tx_xdp_map(struct net_device
> *dev_rx, void *fwd,
> >   	case BPF_MAP_TYPE_XSKMAP:
> >   		return __xsk_map_redirect(fwd, xdp);
> >   	default:
> > -		break;
> > +		return -EOPNOTSUPP;
> 
> So in case of generic XDP we return with -EBADRQC in
> xdp_do_generic_redirect_map().
> I would suggest we adapt the same error code here as well, so it's consistent
> for the tracepoint output and not to be confused with -EOPNOTSUPP from other
> locations like dev_map_enqueue() when ndo_xdp_xmit is missing or such.

Ok, I will send v2

Thanks

-Li


> 
> >   	}
> >   	return 0;
> >   }
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ