[PATCH net-next] TLS: Fix length check in do_tls_getsockopt_tx()

2017-07-05 Thread Matthias Rosenfelder
copy_to_user() copies the struct the pointer is pointing to, but the length check compares against sizeof(pointer) and not sizeof(struct). On 32-bit the size is probably the same, so it might have worked accidentally. Signed-off-by: Matthias Rosenfelder --- net/tls/tls_main.c | 2 +- 1 file

[RFC] tls: length check correct in do_tls_getsockopt_tx()?

2017-07-05 Thread Matthias Rosenfelder
Hi, In do_tls_getsockopt_tx(): if (len == sizeof(crypto_info)) { should be if (len == sizeof(*crypto_info)) { as crypto_info is of pointer type. Or am I missing something? btw: I am not very familiar with sockets. So I am wondering what is the use of this functionality? Why copy only the hea