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

Using SIOCGSTAMPNS corrupts the memory of innocent objects #2

Open
jduck opened this issue Sep 14, 2015 · 1 comment
Open

Using SIOCGSTAMPNS corrupts the memory of innocent objects #2

jduck opened this issue Sep 14, 2015 · 1 comment

Comments

@jduck
Copy link
Contributor

jduck commented Sep 14, 2015

The following shows the relevant code. When the SOCK_TIMESTAMP flag is not set in possibly already allocated and in-use objects, this function will set it thus corrupting the object. This leads to terrible instability :-/

int sock_get_timestampns(struct sock *sk, struct timespec __user *userstamp)
{
    struct timespec ts; 
    if (!sock_flag(sk, SOCK_TIMESTAMP))
        sock_enable_timestamp(sk, SOCK_TIMESTAMP);

I've tried to come up with an alternative solution but was not successful. Care should be taken to only execute this ioctl against sockets that have a high probability of being ones we control.

@jduck
Copy link
Contributor Author

jduck commented Sep 17, 2015

From Twitter:

KEEN TEAM ‏@k33nteam Sep 15
@jduck @fi01_IS01 and yes, the probe may cause some issue if other obj comes in, but anyway better chance than random pick :-P

https://twitter.com/K33nTeam/status/643774337212809216

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

No branches or pull requests

1 participant