Re: [Cluster-devel] [PATCH] dlm: Replace all non-returning strlcpy with strscpy

2023-05-11 Thread Kees Cook
On Wed, May 10, 2023 at 10:12:37PM +, Azeem Shaikh wrote: > strlcpy() reads the entire source buffer first. > This read may exceed the destination size limit. > This is both inefficient and can lead to linear read > overflows if a source string is not NUL-terminated [1]. > In an effort to

Re: [Cluster-devel] [PATCH] gfs2: Don't free rgrp clone bitmaps until go_inval

2023-05-11 Thread Bob Peterson
Hi, On 5/11/23 4:47 AM, Steven Whitehouse wrote: Hi, This repeated kmalloc -> kfree -> kmalloc -> kfree is a waste of time: It is a waste of time. However, if the clones are kept around for lots of rgrps, then that is a waste of space. The question is really what the correct balance is.

Re: [Cluster-devel] [PATCH] gfs2: Don't free rgrp clone bitmaps until go_inval

2023-05-11 Thread Steven Whitehouse
Hi, On Wed, 2023-05-10 at 15:08 -0400, Bob Peterson wrote: > Before this patch, every time an rgrp was synced (go_sync) the > clone bitmaps were freed. We do not need to free the bitmaps in many > common cases. For example when demoting the glock from EXCLUSIVE to > SHARED. This is especially

[Cluster-devel] [PATCH] dlm: Replace all non-returning strlcpy with strscpy

2023-05-11 Thread Azeem Shaikh
strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). No