fail_function: remove a redundant mutex unlock
PATCH 1/1 fail_function: remove a redundant mutex unlock
Fix a mutex_unlock() issue where before copy_from_user() is not called mutex_locked.
--- kernel/fail_function.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/fail_function.c +3 -2
@@ -253,7 +253,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,if (copy_from_user (buf, buffer, count)) { ret = -EFAULT ; - goto out; + goto out_free; } buf[count] ='\0' ; sym =strstrip (buf);
@@ -307,8 +307,9 @@ static ssize_t fei_write(struct file *file, const char __user *buffer, ret = count; } out: -kfree (buf);mutex_unlock (&fei_lock); +out_free: +kfree (buf);return ret; }
Signature · 1 line
2.25.4
Hi Luo,
Quoted 2 lines · On Tue, 10 Nov 2020 16:42:45 +0800 Luo Meng <[email protected]> wrote:
Fix a
mutex_unlock()issue where beforecopy_from_user()is not calledmutex_locked.
Oops, thank you for the fix.
Quoted 35 lines
Fixes 4b1a29a7f542 ("error-injection: Support fault injection framework")Reported-by Hulk Robot <[email protected]>Signed-off-by Luo Meng <[email protected]>--- kernel/fail_function.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/fail_function.c +3
-2@@ -253,7 +253,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,if (copy_from_user (buf, buffer, count)) { ret = -EFAULT ; - goto out; + goto out_free; } buf[count] ='\0' ; sym =strstrip (buf);@@ -307,8 +307,9 @@ static ssize_t fei_write(struct file *file, const char __user *buffer, ret = count; } out: -kfree (buf);mutex_unlock (&fei_lock); +out_free: +kfree (buf);return ret; }Signature · 1 line
2.25.4
Signature · 1 line
Masami Hiramatsu <[email protected]>
Quoted 6 lines · Masami Hiramatsu
Hi Luo,
On Tue, 10 Nov 2020 16:42:45 +0800
Luo Meng <[email protected]> wrote:
Quoted 6 lines
Quoted 2 lines
Fix a
mutex_unlock()issue where beforecopy_from_user()is not calledmutex_locked.Oops, thank you for the fix.
Acked-by Masami Hiramatsu <[email protected]>
Did anyone pick this up?
If not, please resend cc-ing bpf@vger so it can get into patchwork and be processed by bpf maintainers.
Thanks!
Quoted 39 lines
Quoted 33 lines
Fixes 4b1a29a7f542 ("error-injection: Support fault injection framework")Reported-by Hulk Robot <[email protected]>Signed-off-by Luo Meng <[email protected]>--- kernel/fail_function.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/fail_function.c +3
-3@@ -253,7 +253,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,if (copy_from_user (buf, buffer, count)) { ret = -EFAULT ; - goto out; + goto out_free; } buf[count] ='\0' ; sym =strstrip (buf);@@ -307,8 +307,9 @@ static ssize_t fei_write(struct file *file, const char __user *buffer, ret = count; } out: -kfree (buf);mutex_unlock (&fei_lock); +out_free: +kfree (buf);return ret; } --Quoted 2 lines
2.25.4
--
Masami Hiramatsu <[email protected]>
Hi,
Quoted 10 lines · On Tue, 17 Nov 2020 20:08:08 -0800 Alexei Starovoitov…
Quoted 9 lines · Masami Hiramatsu
Hi Luo,
Quoted 2 lines · On Tue, 10 Nov 2020 16:42:45 +0800 Luo Meng <[email protected]> wrote:
Fix a
mutex_unlock()issue where beforecopy_from_user()is not calledmutex_locked.
Quoted 7 lines
Quoted 3 lines
Oops, thank you for the fix.
Acked-by Masami Hiramatsu <[email protected]>Did anyone pick this up?
If not, please resend cc-ing bpf@vger so it can get into patchwork and be processed by bpf maintainers.
OK, I'll resend this to the bpf@vger.
Thank you,
Quoted 42 lines
Thanks!
Quoted 39 lines
Quoted 33 lines
Fixes 4b1a29a7f542 ("error-injection: Support fault injection framework")Reported-by Hulk Robot <[email protected]>Signed-off-by Luo Meng <[email protected]>--- kernel/fail_function.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/fail_function.c +3
-3@@ -253,7 +253,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,if (copy_from_user (buf, buffer, count)) { ret = -EFAULT ; - goto out; + goto out_free; } buf[count] ='\0' ; sym =strstrip (buf);@@ -307,8 +307,9 @@ static ssize_t fei_write(struct file *file, const char __user *buffer, ret = count; } out: -kfree (buf);mutex_unlock (&fei_lock); +out_free: +kfree (buf);return ret; } --Quoted 2 lines
2.25.4
--
Masami Hiramatsu <[email protected]>
Signature · 1 line
Masami Hiramatsu <[email protected]>
PATCH 1/1 fail_function: remove a redundant mutex unlock
In reply to Luo MengFrom: Luo Meng <[email protected]>
Fix a mutex_unlock() issue where before copy_from_user() is not called mutex_locked.
---
0 files changed
kernel/fail_function.c +3 -2
@@ -253,7 +253,7 @@ static ssize_t fei_write(struct file *file, const char __user *buffer,if (copy_from_user (buf, buffer, count)) { ret = -EFAULT ; - goto out; + goto out_free; } buf[count] ='\0' ; sym =strstrip (buf);
@@ -307,8 +307,9 @@ static ssize_t fei_write(struct file *file, const char __user *buffer, ret = count; } out: -kfree (buf);mutex_unlock (&fei_lock); +out_free: +kfree (buf);return ret; }
This patch was applied to bpf/bpf.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
Quoted 5 lines · On Wed, 18 Nov 2020 22:49:31 +0900 you wrote:
From: Luo Meng <[email protected]>
Fix a
mutex_unlock()issue where beforecopy_from_user()is not calledmutex_locked.
Quoted 7 lines
Fixes 4b1a29a7f542 ("error-injection: Support fault injection framework")Reported-by Hulk Robot <[email protected]>Acked-by Masami Hiramatsu <[email protected]>Signed-off-by Luo Meng <[email protected]>Signed-off-by Masami Hiramatsu <[email protected]>[...]
Here is the summary with links:
- fail_function: remove a redundant mutex unlock
https://git.kernel.org/bpf/bpf/c/891515d945a3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html