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: <m2y0w0l8sc.fsf@gmail.com>
Date: Wed, 16 Apr 2025 11:06:59 +0100
From: Donald Hunter <donald.hunter@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net,  netdev@...r.kernel.org,  edumazet@...gle.com,
  pabeni@...hat.com,  andrew+netdev@...n.ch,  horms@...nel.org,
  daniel@...earbox.net,  sdf@...ichev.me,  jacob.e.keller@...el.com
Subject: Re: [PATCH net 3/8] tools: ynl-gen: individually free previous
 values on double set

Jakub Kicinski <kuba@...nel.org> writes:

> When user calls request_attrA_set() multiple times (for the same
> attribute), and attrA is of type which allocates memory -
> we try to free the previously associated values. For array
> types (including multi-attr) we have only freed the array,
> but the array may have contained pointers.
>
> Refactor the code generation for free attr and reuse the generated
> lines in setters to flush out the previous state. Since setters
> are static inlines in the header we need to add forward declarations
> for the free helpers of pure nested structs. Track which types get
> used by arrays and include the right forwad declarations.
>
> At least ethtool string set and bit set would not be freed without
> this. Tho, admittedly, overriding already set attribute twice is likely
> a very very rare thing to do.
>
> Fixes: be5bea1cc0bf ("net: add basic C code generators for Netlink")
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>

Reviewed-by: Donald Hunter <donald.hunter@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ