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]
Date:   Fri, 26 Jan 2018 08:21:55 -0800
From:   John Fastabend <john.fastabend@...il.com>
To:     Dave Watson <davejwatson@...com>
Cc:     ast@...nel.org, daniel@...earbox.net, netdev@...r.kernel.org,
        bhole_prashant_q7@....ntt.co.jp
Subject: Re: [bpf PATCH 1/3] net: add a UID to use for ULP socket assignment

On 01/26/2018 07:52 AM, Dave Watson wrote:
> On 01/25/18 04:27 PM, John Fastabend wrote:
>> I did not however retest TLS with the small change to ULP layer.
>> Mostly because I don't have a TLS setup. I plan/hope to get around
>> to writing either a sample or preferably a selftest for this case
>> as well (assuming I didn't miss one).
> 
>> @Dave Watson can you take a quick look to verify the changes are
>> good on TLS ULP side.
> 
> Looks reasonable, and passes my test suite.  One comment below
> 
> Tested-by: Dave Watson <davejwatson@...com>
> 
>> Signed-off-by: John Fastabend <john.fastabend@...il.com>
>> ---
>>  include/net/tcp.h  |    6 ++++++
>>  net/ipv4/tcp_ulp.c |   53 +++++++++++++++++++++++++++++++++++++++++++++++-----
>>  net/tls/tls_main.c |    2 ++
>>  3 files changed, 56 insertions(+), 5 deletions(-)
>>
>> diff --git a/net/ipv4/tcp_ulp.c b/net/ipv4/tcp_ulp.c
>> index 6bb9e14..8ef437d 100644
>> --- a/net/ipv4/tcp_ulp.c
>> +++ b/net/ipv4/tcp_ulp.c
>> @@ -133,3 +157,22 @@ int tcp_set_ulp(struct sock *sk, const char *name)
>>  	icsk->icsk_ulp_ops = ulp_ops;
>>  	return 0;
>>  }
>> +
>> +int tcp_set_ulp_id(struct sock *sk, int ulp)
>> +{
>> +	struct inet_connection_sock *icsk = inet_csk(sk);
>> +	const struct tcp_ulp_ops *ulp_ops;
>> +	int err;
>> +
>> +	if (icsk->icsk_ulp_ops)
>> +		return -EEXIST;
>> +
>> +	ulp_ops = __tcp_ulp_lookup(ulp);
>> +	if (!ulp_ops)
>> +		return -ENOENT;
>> +
>> +	err = ulp_ops->init(sk);
>> +	if (!err)
>> +		icsk->icsk_ulp_ops = ulp_ops;
> 
> Does this need module_put on error, similar to tcp_set_ulp?

Not needed in current use because its only being used with an in-kernel
ULP. However, best to fix it so that we don't have a (hard to detect)
bug first time someone uses this with a module ULP.

Thanks I'll spin a v2 this morning.

> 
>> +	return err;
>> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ