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:   Sat, 12 Dec 2020 23:06:41 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Tobias Waldekranz <tobias@...dekranz.com>
Subject: Re: [PATCH v3 net-next] net: dsa: reference count the host mdb
 addresses

> +	/* Complication created by the fact that addition has two phases, but
> +	 * deletion only has one phase, and we need reference counting.
> +	 * The strategy is to do the memory allocation in the prepare phase,
> +	 * but initialize the refcount in the commit phase.
> +	 *
> +	 * Have mdb	| mdb has refcount > 0	| Commit phase	| Resolution
> +	 * -------------+-----------------------+---------------+---------------
> +	 * no		| -			| no		| Alloc & proceed

This does not look right.

The point of the prepare phase is to allow all the different layers
involved to allocate whatever they need and to validate they can do
the requested action. Any layer can say, No, stop, i cannot do
this. The commit phase will then not happen. But that also means the
prepare phase should not do any state changes. So you should not be
proceeding here, just allocating.

And you need some way to cleanup the allocated memory when the commit
never happens because some other layer has said No!

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ