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]
Date:   Wed, 24 Feb 2021 09:44:14 -0500
From:   "J. Bruce Fields" <bfields@...ldses.org>
To:     Luo Longjun <luolongjun@...wei.com>
Cc:     viro@...iv.linux.org.uk, jlayton@...nel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        sangyan@...wei.com, luchunhua@...wei.com
Subject: Re: [PATCH v2 02/24] fs/locks: print full locks information

On Wed, Feb 24, 2021 at 03:35:44AM -0500, Luo Longjun wrote:
> @@ -2912,17 +2922,66 @@ static int locks_show(struct seq_file *f, void *v)
>  	struct file_lock *fl, *bfl;
>  	struct pid_namespace *proc_pidns = proc_pid_ns(file_inode(f->file)->i_sb);
>  
> +	struct list_head root;
> +	struct list_head *tail = &root;
> +	struct list_head *pos, *tmp;
> +	struct locks_traverse_list *node, *node_child;
> +
> +	int ret = 0;
> +
>  	fl = hlist_entry(v, struct file_lock, fl_link);
>  
>  	if (locks_translate_pid(fl, proc_pidns) == 0)
> -		return 0;
> +		return ret;
> +
> +	INIT_LIST_HEAD(&root);
>  
> -	lock_get_status(f, fl, iter->li_pos, "");
> +	node = kmalloc(sizeof(struct locks_traverse_list), GFP_KERNEL);

Is it safe to allocate here?  I thought this was under the
blocked_lock_lock spinlock.

And I still don't think you need a stack.  Have you tried the suggestion
in my previous mail?

--b.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ