Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel fault when decrypting to user buffer #56

Closed
lancerchao opened this issue Jun 22, 2016 · 7 comments
Closed

kernel fault when decrypting to user buffer #56

lancerchao opened this issue Jun 22, 2016 · 7 comments
Labels

Comments

@lancerchao
Copy link
Contributor

lancerchao commented Jun 22, 2016

If a client makes a syscall like this:

char recv_mem[1000];
recv(fd, recv_mem, TLS_MAX_PAYLOAD_LENGTH, 0);

And the decryption is done straight to user memory (the else{} in tls_recvmsg) a kernel fault is triggered
http://pastebin.com/XjGu0dHx

@lancerchao lancerchao changed the title page fault when decrypting to user buffer kernel fault when decrypting to user buffer Jun 22, 2016
@fridex fridex added the bug label Jun 23, 2016
@fridex
Copy link
Member

fridex commented Jun 23, 2016

I suppose that it occurs with TLS.

@lancerchao
Copy link
Contributor Author

The kernel has to validate user buffers before accessing them. copy_page_to_iter does this for you, but the decryption api does not.

@lancerchao
Copy link
Contributor Author

@fridex
Copy link
Member

fridex commented Jul 2, 2016

why was this issue closed?

@lancerchao
Copy link
Contributor Author

Patch is available here.
[https://github.com/lancerchao/af_ktls/commit/fe9c547c39a46587324aabcee2894571b3897849]

Btw, it is not necessary in ktls with revamped buffer management since those keep decrypted data in skbuffs and never decrypts straight to user memory.

@fridex
Copy link
Member

fridex commented Jul 8, 2016

I will take a look at your implementation ASAP.

Not to forget about this, reopening since fix is not available in ktls/af_ktls master.

@fridex fridex reopened this Jul 8, 2016
@djwatson
Copy link
Member

Fixed, no longer needed now that using skbs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants