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: <20231127120314.GA19669@redhat.com>
Date:   Mon, 27 Nov 2023 13:03:14 +0100
From:   Oleg Nesterov <oleg@...hat.com>
To:     Kuan-Ying Lee <Kuan-Ying.Lee@...iatek.com>
Cc:     Jan Kiszka <jan.kiszka@...mens.com>,
        Kieran Bingham <kbingham@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        casper.li@...iatek.com, chinwen.chang@...iatek.com,
        qun-wei.lin@...iatek.com, linux-mm@...ck.org,
        stable@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH 1/3] scripts/gdb/tasks: Fix lx-ps command error

On 11/27, Kuan-Ying Lee wrote:
>
> @@ -25,13 +25,9 @@ def task_lists():
>      t = g = init_task
>  
>      while True:
> -        while True:
> -            yield t
> -
> -            t = utils.container_of(t['thread_group']['next'],
> -                                   task_ptr_type, "thread_group")
> -            if t == g:
> -                break
> +        thread_head = t['signal']['thread_head']
> +        for thread in lists.list_for_each_entry(thread_head, task_ptr_type, 'thread_node'):
> +            yield thread
>  
>          t = g = utils.container_of(g['tasks']['next'],
>                                     task_ptr_type, "tasks")

Thanks!

I do not know python, but it seems that with this patch we can kill g or t?
Can't

	def task_lists():
	    task_ptr_type = task_type.get_type().pointer()
	    init_task = gdb.parse_and_eval("init_task").address
	    t = init_task

	    while True:
		thread_head = t['signal']['thread_head']
		for thread in lists.list_for_each_entry(thread_head, task_ptr_type, 'thread_node'):
		    yield thread

		t = utils.container_of(t['tasks']['next'],
				       task_ptr_type, "tasks")
		if t == init_task:
		    return

work?

Oleg.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ