lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r1r5wsy8.fsf@x220.int.ebiederm.org>
Date:   Sun, 13 Sep 2020 11:18:55 -0500
From:   ebiederm@...ssion.com (Eric W. Biederman)
To:     Miaohe Lin <linmiaohe@...wei.com>
Cc:     <christian.brauner@...ntu.com>, <akpm@...ux-foundation.org>,
        <peterz@...radead.org>, <mingo@...nel.org>, <christian@...lner.me>,
        <surenb@...gle.com>, <areber@...hat.com>, <shakeelb@...gle.com>,
        <cyphar@...har.com>, <tglx@...utronix.de>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fork: Use helper function mapping_allow_writable() in dup_mmap()

Miaohe Lin <linmiaohe@...wei.com> writes:

> Use helper function mapping_allow_writable() to atomic_inc
> i_mmap_writable.

Why?


> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
>  kernel/fork.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index 4b328aecabb2..a0586716e327 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -558,7 +558,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
>  				atomic_dec(&inode->i_writecount);
>  			i_mmap_lock_write(mapping);
>  			if (tmp->vm_flags & VM_SHARED)
> -				atomic_inc(&mapping->i_mmap_writable);
> +				mapping_allow_writable(mapping);
>  			flush_dcache_mmap_lock(mapping);
>  			/* insert tmp into the share list, just after mpnt */
>  			vma_interval_tree_insert_after(tmp, mpnt,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ