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:   Thu,  3 Mar 2022 11:31:22 +0800
From:   Xiaomeng Tong <xiam0nd.tong@...il.com>
To:     james.bottomley@...senpartnership.com
Cc:     arnd@...db.de, gregkh@...uxfoundation.org, jakobkoschel@...il.com,
        jannh@...gle.com, keescook@...omium.org,
        linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, netdev@...r.kernel.org,
        torvalds@...ux-foundation.org, xiam0nd.tong@...il.com
Subject: Re: [PATCH 2/6] list: add new MACROs to make iterator invisiable outside the loop

On Wed, 02 Mar 2022 08:02:23 -0500, James Bottomley
<James.Bottomley@...senPartnership.com> wrote:
> pos shouldn't be an input to the macro since it's being declared inside
> it.  All that will do will set up confusion about the shadowing of pos.
> The macro should still work as
>
> #define list_for_each_entry_inside(type, head, member) \
>   ...
>
> For safety, you could
>
> #define POS __UNIQUE_ID(pos)
>
> and use POS as the loop variable .. you'll have to go through an
> intermediate macro to get it to be stable.  There are examples in
> linux/rcupdate.h

The outer "pos" variable is no longer needed and thus the declare
statement before the loop is removed, see the demostration in PATCH
3~6. Now, there is only one inner "pos" variable left. Thus, there
should be no such *shadow* problem.

Please remind me if i missed something, thanks.

--
Xiaomeng Tong

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ