Skip to content

Add recv hook and improve test#2

Merged
tammela merged 2 commits into
masterfrom
fea_recv
Jul 23, 2020
Merged

Add recv hook and improve test#2
tammela merged 2 commits into
masterfrom
fea_recv

Conversation

@MXWXZ
Copy link
Copy Markdown
Member

@MXWXZ MXWXZ commented Jul 4, 2020

1

@MXWXZ MXWXZ force-pushed the fea_recv branch 2 times, most recently from 071bc5e to 0d736e2 Compare July 6, 2020 11:32
@MXWXZ MXWXZ requested review from VictorNogueiraRio and tammela and removed request for tammela July 8, 2020 19:48
Comment thread test.c Outdated
Comment thread tls_main.c Outdated
Comment thread tls_sw.c Outdated
Comment thread tls_sw.c Outdated
Comment thread tls_main.c Outdated
Comment thread tls_main.c Outdated
Comment thread uapi/tls.h Outdated
Comment thread tls.h Outdated
@MXWXZ MXWXZ force-pushed the fea_recv branch 2 times, most recently from 42f366d to bd036f9 Compare July 20, 2020 11:14
@MXWXZ MXWXZ requested a review from tammela July 21, 2020 04:17
Comment thread tls_main.c Outdated
Comment thread tls_sw.c
Comment thread tls_main.c
Comment thread test/test_server.c Outdated
Comment thread tls.h Outdated
Comment thread tls_sw.c
copied += decrypted;

plaintext = kmalloc(copied, GFP_KERNEL);
err = copy_from_user(plaintext, msg->msg_iter.iov->iov_base, copied);
Copy link
Copy Markdown
Member

@tammela tammela Jul 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you need to copy from user here? Check the whole trace from the recvmsg syscall and see if there are no "promotions" to kernel space already.

Another thing, this is a scatter/gather array which means the buffer might not be non-linear, your code is too optimistic about it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the function will decrypt the data into user space msg directly and the previous code will gather the splitted received data and decrypt into msg(I didn't find the next pointer like skb structure.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magically I could read the address without copy in Ubuntu but failed in Arch

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we can use process_rx_list to make zero copy, see slack.

Comment thread tls_sw.c
Copy link
Copy Markdown
Member

@tammela tammela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 more to go and we can merge. Good job.

Comment thread tls_sw.c Outdated
Comment thread tls_main.c Outdated
Comment thread test/hook.lua Outdated
Comment thread test/test_client.c Outdated
@MXWXZ MXWXZ requested a review from tammela July 23, 2020 11:05
@tammela tammela merged commit e8be582 into master Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants