Re: [PATCH v2 16/18] spdm: Limit memory consumed by log of received signatures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 30 Jun 2024 21:51:00 +0200
Lukas Wunner <lukas@xxxxxxxxx> wrote:

> The SPDM library has just been amended to keep a log of received
> signatures and expose it in sysfs.
> 
> Limit the log's memory footprint subject to a sysctl parameter.  Purge
> old signatures when adding a new signature which causes the limit to be
> exceeded.  Likewise purge old signatures when the sysctl parameter is
> reduced.
> 
> The latter requires keeping a list of all struct spdm_state and
> protecting it with a mutex.  It will come in handy when further global
> sysctl parameters are added to the SPDM library.  Unfortunately an
> xarray is not a better option in this case as the xarray-integrated
> xa_lock() is a spinlock but purging signatures from sysfs may sleep
> (due to kernfs_rwsem).
> 
> This functionality is introduced in a separate commit on top of basic
> signature exposure to split the code into digestible, reviewable chunks.
> 
> Signed-off-by: Lukas Wunner <lukas@xxxxxxxxx>
Ah. This avoids potential problem in previous patch. Fair enough no need
to check the counter for overflow as long as it's not feasible to set that
sysctl high enough that we still get a collision.

LGTM 
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux