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

Remove parameter 'segflg' from the function *exec_copyin_args #1590

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wy-chung
Copy link
Contributor

@wy-chung wy-chung commented Feb 5, 2025

In kernel "copyin" means copy data from user address space to kernel address space. But in the function *exec_copyin_args there is a parameter 'segflg' that is used to specify the address space of the parameter 'fname'. In the source code there are two places where 'segflg' are not UIO_USERSPACE. In both cases the 'fname' argument are NULL so the argument 'segflg' are not important there. So it is safe to remove the parameter 'segflg' from the function *exec_copyin_args.

Copy link
Member

@markjdb markjdb left a comment

Choose a reason for hiding this comment

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

This looks ok to me.

I don't think it makes sense to have the extra commit to wrap a long line - this can be done in the main commit since you are modifying that line already.

Copy link
Member

@bsdjhb bsdjhb left a comment

Choose a reason for hiding this comment

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

Hmmm, we do have a UIO_SYSSPACE fname when starting the init process (pid 1), but I think there we don't call exec_copyin_args() but construct the args directly. Hmm, seems even before that change (commit 3a325de) we were still getting the fname from userspace in that case.

I think this is fine.

@wy-chung
Copy link
Contributor Author

wy-chung commented Feb 8, 2025

This looks ok to me.

I don't think it makes sense to have the extra commit to wrap a long line - this can be done in the main commit since you are modifying that line already.

I send the pull request and then I receive a email from the github. It says that a line is too long so I send a second commit. I don't know how to change the oroginal pull request. This is the only way I know how to fix this error.

@markjdb
Copy link
Member

markjdb commented Feb 8, 2025

This looks ok to me.
I don't think it makes sense to have the extra commit to wrap a long line - this can be done in the main commit since you are modifying that line already.

I send the pull request and then I receive a email from the github. It says that a line is too long so I send a second commit. I don't know how to change the oroginal pull request. This is the only way I know how to fix this error.

To modify the most recent commit, you can stage changes as normal and run git commit --amend. More generally, you can use git rebase to "squash" commits together into one. Then, force-push your branch to update this pull request.

Using git rebase to do this requires some practice. I can squash the commits for this PR if you like, but for next time, it's worth learning how to amend and squash commits.

In kern "copyin" means copy data from user address space to kernel address space. But in the function *exec_copyin_args there is a parameter 'segflg' that is used to specify the address space of the parameter 'fname'. In the source code there are two places where 'segflg' are not UIO_USERSPACE. In both cases the 'fname' argument are NULL so the argument 'segflg' are not important there. So it is safe to remove the parameter 'segflg' from the function *exec_copyin_args.
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

Successfully merging this pull request may close these issues.

3 participants