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

touch command throws EFAULT #64

Closed
Narasimha1997 opened this issue Nov 5, 2020 · 1 comment · Fixed by #65
Closed

touch command throws EFAULT #64

Narasimha1997 opened this issue Nov 5, 2020 · 1 comment · Fixed by #65
Labels

Comments

@Narasimha1997
Copy link
Contributor

Narasimha1997 commented Nov 5, 2020

So, I was just trying out the kernel with busy box by following the guidelines provided in README file.
When I execute the command touch hello.txt from any directory I get the following error :

touch : hello.txt : Bad Address

In other words, it throws EFAULT error.
Maybe there is a bug in one of the system calls invoked by touch command.

Update:
After analyzing the source code, I could see that there is an issue with the parameters passed to sys_utimes system-call.
The second parameter u_times array which is of type timeval is NULL because of which copy_from_user is returning -1, so EFAULT is thrown.

@vvaltchev vvaltchev added the bug label Nov 5, 2020
@vvaltchev vvaltchev linked a pull request Nov 5, 2020 that will close this issue
@vvaltchev
Copy link
Owner

Hi Narasimha,
thanks for reporting this issue.

I didn't notice in the documentation that utimes() must support a NULL times param.
The amount of corner cases like that is huge.

Anyway, I just merged a patch fixing it and now touch works as expected.

Vlad

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

Successfully merging a pull request may close this issue.

2 participants