lkml.org 
[lkml]   [2010]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch 15/21] Collect ELF Core notes data
On 12/14, Suzuki K. Poulose wrote:
>
> @@ -164,10 +197,28 @@ static int open_gencore(struct inode *in
> list_add(&cp->list, &core_list);
> mutex_unlock(&core_mutex);
>
> + max_regset = get_max_regsets(task);
> +
> + for (i = 0; i < get_nr_threads(task); i++) {
> + tinfo = kzalloc(offsetof(struct elf_thread_core_info,
> + notes[max_regset]), GFP_KERNEL);
> + if (unlikely(!tinfo)) {
> + cleanup_cp(cp);
> + ret = -ENOMEM;
> + goto out;
> + }
> + tinfo->next = cp->tinfo;
> + cp->tinfo = tinfo;
> + }

This looks strange... Obviously we can't trust get_nr_threads()
before this process is stopped/frozen.

Just noticed... release_gencore() does thaw_process() for each
thread. But, again, if it was stopped we can race with SIGCONT
and exit. IOW, -EIO is possible. Who will thaw other threads?
Also, we can probably race with exec, but I am not sure.

Oleg.



\
 
 \ /
  Last update: 2010-12-14 17:47    [W:0.125 / U:0.152 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site