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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7ySt0XGnbzTyY6T@grain>
Date:   Tue, 10 Jan 2023 01:18:31 +0300
From:   Cyrill Gorcunov <gorcunov@...il.com>
To:     Muhammad Usama Anjum <usama.anjum@...labora.com>
Cc:     Alexander Viro <viro@...iv.linux.org.uk>,
        Eric Biederman <ebiederm@...ssion.com>,
        Kees Cook <keescook@...omium.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Masami Hiramatsu <mhiramat@...nel.org>, kernel@...labora.com,
        peterx@...hat.com, david@...hat.com, linux-fsdevel@...r.kernel.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] mm: implement granular soft-dirty vma support

On Tue, Dec 20, 2022 at 09:26:05PM +0500, Muhammad Usama Anjum wrote:
...
>
> +static inline int nsdr_adjust_new_first(struct vm_area_struct *new, struct vm_area_struct *vma)
> +{
> +	struct non_sd_reg *r, *r_tmp, *reg;
> +	unsigned long mid = vma->vm_start;
> +
> +	list_for_each_entry_safe(r, r_tmp, &vma->non_sd_reg, nsdr_head) {
> +		if (r->start < mid && r->end > mid) {
> +			reg = kmalloc(sizeof(struct non_sd_reg), GFP_KERNEL);
> +			if (!reg)
> +				return -ENOMEM;
> +			reg->start = r->start;
> +			reg->end = mid;
> +			list_add_tail(&reg->nsdr_head, &new->non_sd_reg);
> +
> +			r->start = mid;
> +		} else if (r->end <= mid) {
> +			list_move_tail(&r->nsdr_head, &new->non_sd_reg);
> +		}
> +	}
> +	return 0;
> +}

Hi Muhhamad, really sorry for delay. Please enlighten me here if I get your
idea right -- every new VMA merge might create a new non_sd_seg entry, right?
And this operation will be applied again and again until vma get freed. IOW
we gonna have a chain of non_sd_reg which will be hanging around until VMA
get freed, right?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ