diff mbox series

[v2] security/dirtyc0w: Get and set umask in setup

Message ID 1585536316-23604-1-git-send-email-zou_wei@huawei.com
State Superseded
Headers show
Series [v2] security/dirtyc0w: Get and set umask in setup | expand

Commit Message

Samuel Zou March 30, 2020, 2:45 a.m. UTC
v2:
Clear current umask by umask(0) in setup()

Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 testcases/kernel/security/dirtyc0w/dirtyc0w.c | 2 ++
 1 file changed, 2 insertions(+)

--
2.6.2

Comments

Xiao Yang March 30, 2020, 3:02 a.m. UTC | #1
On 2020/3/30 10:45, Zou Wei wrote:
> v2:
> Clear current umask by umask(0) in setup()
Hi Zou,

1) needs to update the subject as well.
2) add some commit message to describe the issue.

Thanks,
Xiao Yang
>
> Signed-off-by: Zou Wei<zou_wei@huawei.com>
> ---
>   testcases/kernel/security/dirtyc0w/dirtyc0w.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/testcases/kernel/security/dirtyc0w/dirtyc0w.c b/testcases/kernel/security/dirtyc0w/dirtyc0w.c
> index a0a81b6..6455f9c 100644
> --- a/testcases/kernel/security/dirtyc0w/dirtyc0w.c
> +++ b/testcases/kernel/security/dirtyc0w/dirtyc0w.c
> @@ -45,6 +45,8 @@ static void setup(void)
>   {
>   	struct passwd *pw;
>
> +	umask(0);
> +
>   	pw = SAFE_GETPWNAM("nobody");
>
>   	nobody_uid = pw->pw_uid;
> --
> 2.6.2
>
>
diff mbox series

Patch

diff --git a/testcases/kernel/security/dirtyc0w/dirtyc0w.c b/testcases/kernel/security/dirtyc0w/dirtyc0w.c
index a0a81b6..6455f9c 100644
--- a/testcases/kernel/security/dirtyc0w/dirtyc0w.c
+++ b/testcases/kernel/security/dirtyc0w/dirtyc0w.c
@@ -45,6 +45,8 @@  static void setup(void)
 {
 	struct passwd *pw;

+	umask(0);
+
 	pw = SAFE_GETPWNAM("nobody");

 	nobody_uid = pw->pw_uid;