cred: add missing return error code when set_cred_ucounts() failed
PATCH 1/1 cred: add missing return error code when set_cred_ucounts() failed
If set_cred_ucounts() failed, we need return the error code.
--- kernel/cred.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/cred.c +2 -1
@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags) ret =create_user_ns (new);if (ret <0 ) goto error_put; -if (set_cred_ucounts (new) <0 ) + ret =set_cred_ucounts (new); +if (ret <0 ) goto error_put; }
Signature · 1 line
2.25.1
Quoted 1 line · Yang Yingliang
If
set_cred_ucounts()failed, we need return the error code.
Alex how does this look to you?
This is showing up now as I have finally dropped the code in linux-next and other people are looking at it.
At a quick fix looks correct to me.
Quoted 20 lines
Fixes 905ae01c4ae2 ("Add a reference to ucounts for each cred")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- kernel/cred.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)kernel/cred.c +2
-1@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags) ret =create_user_ns (new);if (ret <0 ) goto error_put; -if (set_cred_ucounts (new) <0 ) + ret =set_cred_ucounts (new); +if (ret <0 ) goto error_put; }
Quoted 10 lines · Eric W. Biederman
Quoted 1 line · Yang Yingliang
If
set_cred_ucounts()failed, we need return the error code.Alex how does this look to you?
This is showing up now as I have finally dropped the code in linux-next and other people are looking at it.
At a quick fix looks correct to me.
Yes, this is the right fix. I miss it.
Quoted 21 lines
Quoted 20 lines
Fixes 905ae01c4ae2 ("Add a reference to ucounts for each cred")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- kernel/cred.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)kernel/cred.c +2
-1@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags) ret =create_user_ns (new);if (ret <0 ) goto error_put; -if (set_cred_ucounts (new) <0 ) + ret =set_cred_ucounts (new); +if (ret <0 ) goto error_put; }
Signature · 1 line
Rgrds, legion
Quoted 5 lines · Alexey Gladkov
Quoted 4 lines · Eric W. Biederman
Quoted 1 line · Yang Yingliang
If
set_cred_ucounts()failed, we need return the error code.
Quoted 8 lines
Quoted 6 lines
Alex how does this look to you?
This is showing up now as I have finally dropped the code in linux-next and other people are looking at it.
At a quick fix looks correct to me.
Yes, this is the right fix. I miss it.
Can I have your Acked-by or Reviewed-by.
Thank you.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Fixes 905ae01c4ae2 ("Add a reference to ucounts for each cred")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- kernel/cred.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
kernel/cred.c +0
-0@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)Quoted 9 lines
kernel/cred.c int copy_creds(struct task_struct *p, unsigned long clone_flags) · line 378
Quoted 8 lines
kernel/cred.c +2
-1ret =create_user_ns (new);if (ret <0 ) goto error_put; -if (set_cred_ucounts (new) <0 ) + ret =set_cred_ucounts (new); +if (ret <0 ) goto error_put; }
Eric
Quoted 12 lines · Eric W. Biederman
Quoted 10 lines · Alexey Gladkov
Quoted 9 lines · Eric W. Biederman
Quoted 1 line · Yang Yingliang
If
set_cred_ucounts()failed, we need return the error code.Alex how does this look to you?
This is showing up now as I have finally dropped the code in linux-next and other people are looking at it.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
At a quick fix looks correct to me.
Yes, this is the right fix. I miss it.
Can I have your Acked-by or Reviewed-by.
Thank you.
Yes.
Quoted 24 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Fixes 905ae01c4ae2 ("Add a reference to ucounts for each cred")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- kernel/cred.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
kernel/cred.c +0
-0@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)Quoted 9 lines
kernel/cred.c int copy_creds(struct task_struct *p, unsigned long clone_flags) · line 378
Quoted 8 lines
kernel/cred.c +2
-1ret =create_user_ns (new);if (ret <0 ) goto error_put; -if (set_cred_ucounts (new) <0 ) + ret =set_cred_ucounts (new); +if (ret <0 ) goto error_put; }Eric
Signature · 1 line
Rgrds, legion
Quoted 5 lines · Yang Yingliang
If
set_cred_ucounts()failed, we need return the error code.Fixes 905ae01c4ae2 ("Add a reference to ucounts for each cred")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>
Applied thanks.
Quoted 17 lines
--- kernel/cred.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)kernel/cred.c +2
-1@@ -372,7 +372,8 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags) ret =create_user_ns (new);if (ret <0 ) goto error_put; -if (set_cred_ucounts (new) <0 ) + ret =set_cred_ucounts (new); +if (ret <0 ) goto error_put; }