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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 7 Apr 2015 14:57:19 -0700
From:	Cong Wang <xiyou.wangcong@...il.com>
To:	Tom Herbert <tom@...bertland.com>
Cc:	Linux Kernel Network Developers <netdev@...r.kernel.org>,
	Tom Herbert <therbert@...gle.com>
Subject: Re: [Patch net-next 3/5] fou: fix byte order of udp_config.local_udp_port

On Tue, Apr 7, 2015 at 2:47 PM, Tom Herbert <tom@...bertland.com> wrote:
> On Tue, Apr 7, 2015 at 2:11 PM, Cong Wang <xiyou.wangcong@...il.com> wrote:
>> On Mon, Apr 6, 2015 at 11:09 PM, Tom Herbert <tom@...bertland.com> wrote:
>>> On Mon, Apr 6, 2015 at 4:41 PM, Cong Wang <xiyou.wangcong@...il.com> wrote:
>>>> diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
>>>> index ad0ee82..cf606fc 100644
>>>> --- a/net/ipv4/fou.c
>>>> +++ b/net/ipv4/fou.c
>>>> @@ -468,7 +468,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg,
>>>>         sk = sock->sk;
>>>>
>>>>         fou->flags = cfg->flags;
>>>> -       fou->port = cfg->udp_config.local_udp_port;
>>>> +       fou->port = ntohs(cfg->udp_config.local_udp_port);
>>>>
>>> Cong, I don't think this is right. Port should always be nbo, probably
>>> should be using __b16 instead of u16 for defines. Did you test these
>>> changes?
>>>
>>
>> Yeah, fou->port is u16 which should be host order, however
>> we only save and compare it with be16, so the original code
>> is not mis-behaving (otherwise should go to -net), just reads odd.
>>
>> I tested it together with the whole patchset. And I agree we can
>> change fou->port to be16 too.
>
> Hmm,I don't understand how this could have worked with the ntohs() added.
>

I must miss something here.

Why converting be16 to u16 with ntohs() doesn't work? After this
patch, all u16 ports have host order, all be16 ports have network order
and we don't mix them.

fou->port is used as a key to lookup all fou's in fou_list and fou_list
is not exposed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ