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, 11 Nov 2009 02:48:49 +0900
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Bryan Donlan <bdonlan@...il.com>, Timo Sirainen <tss@....fi>,
	Ulrich Drepper <drepper@...hat.com>,
	WANG Cong <xiyou.wangcong@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: + prctl-add-pr_set_proctitle_area-option.patch added to -mm tree

2009/11/11 Oleg Nesterov <oleg@...hat.com>:
> @@ -1424,6 +1424,28 @@ static void k_getrusage(struct task_stru
>                        } while (t != p);
>                        break;
>
> +               case PR_SET_PROCTITLE_AREA: {
> +                       struct mm_struct *mm = current->mm;
> +                       unsigned long addr = arg2;
> +                       unsigned long len = arg3;
> +                       unsigned long end = arg2 + arg3;
> +
> +                       if (len > PAGE_SIZE)
> +                               return -EINVAL;
> +
> +                       if (addr >= end)
> +                               return -EINVAL;
> +
> +                       if (!access_ok(VERIFY_READ, addr, len))
> +                               return -EFAULT;
> +
> +                       mutex_lock(&mm->arg_lock);
> +                       mm->arg_start = addr;
> +                       mm->arg_end = end;
> +                       mutex_unlock(&mm->arg_lock);
>
> This looks like the merging error, I guess this code should go into
> sys_prct(), not k_getrusage().
>
>
> The patch adds mm_struct->arg_lock mutex. Can't we reuse mm->mmap_sem?
> A bit ugly to have mm->arg_lock just to synchronize sys_prctl() and
> proc_pid_cmdline(), imho.
>
> Yes, we can't do access_process_vm() under ->mmap_sem, but we can add
> the new helper, say, access_process_vm_locked(tsk, mm, ...) which does
> the actual work. Then proc_pid_cmdline() can take mmap_sem for reading,
> read arg_start/arg_end and call access_process_vm_locked().
>
> No?

There is unwritten reason. I hope to add /proc/[pid]/cmdline cache. It
help to avoid
ps getting stuck by mmap_sem.
But, I can accept your proposal on 2.6.32 timeframe. so, I'll make
this patch again.

Andrew, can you please drop this patch at once?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ