Re: [PATCH] net/tls: move version check after second userspace fetch

2017-09-26 Thread David Miller
From: Meng Xu Date: Sun, 24 Sep 2017 11:14:55 -0400 > @@ -382,6 +376,12 @@ static int do_tls_setsockopt_tx(struct sock *sk, char > __user *optval, > rc = -EFAULT; > goto err_crypto_info; > } > + > + /* check version */ > +

[PATCH] net/tls: move version check after second userspace fetch

2017-09-24 Thread Meng Xu
Even the userspace buffer optval passed the version check (i.e., tmp_crypto_info.version == TLS_1_2_VERSION) after the first fetch, it can still be changed before the second copy_from_user() and hence, a version different than TLS_1_2_VERSION may be copied into crypto_info. This patch moves the ver