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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Feb 2023 19:28:09 +0300
From:   Fedor Pchelkin <pchelkin@...ras.ru>
To:     Simon Horman <simon.horman@...igine.com>
Cc:     Pravin B Shelar <pshelar@....org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Eelco Chaudron <echaudro@...hat.com>, netdev@...r.kernel.org,
        dev@...nvswitch.org, linux-kernel@...r.kernel.org,
        Alexey Khoroshilov <khoroshilov@...ras.ru>,
        lvc-project@...uxtesting.org
Subject: Re: [PATCH] net: openvswitch: fix flow memory leak in
 ovs_flow_cmd_new

On 2/1/23 6:45 PM, Simon Horman wrote:
> I see this would work by virtue of kfree(key) doing nothing
> of key is NULL, the error case in question. And that otherwise key is
> non-NULL if this path is hit.
> 
> However, the idiomatic approach to error handling is for the error path
> to unwind resource allocations in the reverse order that they were made.
> And for goto labels to control how far to unwind.
> 

You are right, thanks. Have to keep 'goto' structured, otherwise there
would be a 'goto' mess.

> So I think the following would be more in keeping with the intention of the
> code. Even if it is a somewhat more verbose change.
> 
> *compile tested only!*

I'll test this on error paths and resend the patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ