Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread kernel test robot
: 33cc938e65a98f1d29d0a18403dbbee050dcad9a patch link: https://lore.kernel.org/r/20231205-libstringheader-v1-1-7f9c573053a7%40gmail.com patch subject: [PATCH] lib/string: shrink lib/string.i via IWYU config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20231206/202312061429.bj7grhnt-...@intel.com/config) compiler

Re: [PATCH v2 13/18] sysctl: move sysctl type to ctl_table_header

2023-12-05 Thread Thomas Weißschuh
On 2023-12-05 14:50:01-0800, Luis Chamberlain wrote: > On Tue, Dec 5, 2023 at 2:41 PM Thomas Weißschuh wrote: > > > > On 2023-12-05 14:33:38-0800, Luis Chamberlain wrote: > > > On Mon, Dec 04, 2023 at 08:52:26AM +0100, Thomas Weißschuh wrote: > > > > @@ -231,7 +231,8 @@ static int insert_header(st

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Greg KH
On Wed, Dec 06, 2023 at 03:00:47AM +, Al Viro wrote: > On Wed, Dec 06, 2023 at 12:55:42AM +, Al Viro wrote: > > On Wed, Dec 06, 2023 at 08:46:50AM +0900, Greg KH wrote: > > > > > > > > > > But of course, it doesn't always hold true, there are a few minor > > > > > exceptions, but they are r

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Al Viro
On Wed, Dec 06, 2023 at 12:55:42AM +, Al Viro wrote: > On Wed, Dec 06, 2023 at 08:46:50AM +0900, Greg KH wrote: > > > > > > > > But of course, it doesn't always hold true, there are a few minor > > > > exceptions, but they are rare. > > > > > > $ grep -r \\#include lib | grep asm > > > > > >

Re: [PATCH] scsi: ibmvscsi: replace deprecated strncpy with strscpy

2023-12-05 Thread Martin K. Petersen
Michael, >> strncpy() is deprecated for use on NUL-terminated destination strings >> [1] and as such we should prefer more robust and less ambiguous string >> interfaces. > I gave it a quick boot, no issues. > > Tested-by: Michael Ellerman (powerpc) Applied to 6.8/scsi-staging, thanks! -- M

Re: [PATCH] scsi: ibmvfc: replace deprecated strncpy with strscpy

2023-12-05 Thread Martin K. Petersen
Kees, > On Mon, Oct 30, 2023 at 07:04:33PM +, Justin Stitt wrote: >> strncpy() is deprecated for use on NUL-terminated destination strings >> [1] and as such we should prefer more robust and less ambiguous string >> interfaces. > Yeah, this conversion looks correct to me too. > > Reviewed-b

Re: [PATCH v2] scsi: zfcp: Replace strlcpy() with strscpy()

2023-12-05 Thread Martin K. Petersen
Kees, > 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]. > Additionally, it returns the size of the source string, not the > resulting s

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Al Viro
On Wed, Dec 06, 2023 at 08:46:50AM +0900, Greg KH wrote: > > > > > > But of course, it doesn't always hold true, there are a few minor > > > exceptions, but they are rare. > > > > $ grep -r \\#include lib | grep asm > > > > shows quite a few exceptions, and just in lib/. > > > > For example, lib

Re: [PATCH v2 02/21] mm/slab: remove CONFIG_SLAB from all Kconfig and Makefile

2023-12-05 Thread Hyeonggon Yoo
On Tue, Dec 5, 2023 at 7:14 PM Vlastimil Babka wrote: > > On 12/5/23 05:15, Hyeonggon Yoo wrote: > > On Mon, Nov 20, 2023 at 07:34:13PM +0100, Vlastimil Babka wrote: > > > > Looks good to me, > > Reviewed-by: Hyeonggon Yoo <42.hye...@gmail.com> > > Thanks. > > > Nit: > > > > - Some arch configs en

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Greg KH
On Tue, Dec 05, 2023 at 02:14:55PM -0800, Nick Desaulniers wrote: > On Tue, Dec 5, 2023 at 1:59 PM Greg KH wrote: > > > > On Tue, Dec 05, 2023 at 01:51:10PM -0800, Nick Desaulniers wrote: > > > On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: > > > > > > > > It also breeds includes of asm/*.h, by th

Re: [PATCH v2 13/18] sysctl: move sysctl type to ctl_table_header

2023-12-05 Thread Luis Chamberlain
On Tue, Dec 5, 2023 at 2:41 PM Thomas Weißschuh wrote: > > On 2023-12-05 14:33:38-0800, Luis Chamberlain wrote: > > On Mon, Dec 04, 2023 at 08:52:26AM +0100, Thomas Weißschuh wrote: > > > @@ -231,7 +231,8 @@ static int insert_header(struct ctl_dir *dir, struct > > > ctl_table_header *header) > >

Re: [PATCH v2 13/18] sysctl: move sysctl type to ctl_table_header

2023-12-05 Thread Thomas Weißschuh
On 2023-12-05 14:33:38-0800, Luis Chamberlain wrote: > On Mon, Dec 04, 2023 at 08:52:26AM +0100, Thomas Weißschuh wrote: > > @@ -231,7 +231,8 @@ static int insert_header(struct ctl_dir *dir, struct > > ctl_table_header *header) > > return -EROFS; > > > > /* Am I creating a perman

Re: [PATCH v2 13/18] sysctl: move sysctl type to ctl_table_header

2023-12-05 Thread Luis Chamberlain
On Mon, Dec 04, 2023 at 08:52:26AM +0100, Thomas Weißschuh wrote: > @@ -231,7 +231,8 @@ static int insert_header(struct ctl_dir *dir, struct > ctl_table_header *header) > return -EROFS; > > /* Am I creating a permanently empty directory? */ > - if (sysctl_is_perm_empty_ct

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Al Viro
On Tue, Dec 05, 2023 at 10:15:21PM +, Al Viro wrote: > It would certainly be nice to have such information in the tree; > "where should I pick $SYMBOL from?" is something one needs to > find out often enough. To a large extent it's covered by "where > in include/*.h do we have it defined?", b

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-05 Thread Luis Chamberlain
On Tue, Dec 05, 2023 at 06:16:53PM +0100, Thomas Weißschuh wrote: > Hi Luis, Joel, > > On 2023-12-05 09:04:08+0100, Thomas Weißschuh wrote: > > On 2023-12-04 21:50:14-0800, Luis Chamberlain wrote: > > > On Mon, Dec 04, 2023 at 08:52:13AM +0100, Thomas Weißschuh wrote: > > > > Tested by booting and

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Nick Desaulniers
On Tue, Dec 5, 2023 at 2:10 PM Randy Dunlap wrote: > > I have an unpublished Linux Best Known Practices txt file with > this "rule" and some other info that I have collected over a few > years. I wouldn't say that it's up to date. Anyway, it's copied below > FWIW. > Generic drivers should not (do

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Nick Desaulniers
On Tue, Dec 5, 2023 at 2:15 PM Al Viro wrote: > > On Wed, Dec 06, 2023 at 12:01:56AM +0200, Andy Shevchenko wrote: > > On Tue, Dec 05, 2023 at 01:51:10PM -0800, Nick Desaulniers wrote: > > > On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: > > > > On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@go

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Al Viro
On Wed, Dec 06, 2023 at 12:01:56AM +0200, Andy Shevchenko wrote: > On Tue, Dec 05, 2023 at 01:51:10PM -0800, Nick Desaulniers wrote: > > On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: > > > On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@google.com wrote: > > ... > > > > > IWYU is implemented u

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Nick Desaulniers
On Tue, Dec 5, 2023 at 1:59 PM Greg KH wrote: > > On Tue, Dec 05, 2023 at 01:51:10PM -0800, Nick Desaulniers wrote: > > On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: > > > > > > It also breeds includes of asm/*.h, by the look of the output, which is > > > not a good thing in general ;-/ E.g. #in

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Randy Dunlap
On 12/5/23 14:01, Andy Shevchenko wrote: > On Tue, Dec 05, 2023 at 01:51:10PM -0800, Nick Desaulniers wrote: >> On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: >>> On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@google.com wrote: > > ... > IWYU is implemented using the IWYUScripts github

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Nick Desaulniers
On Tue, Dec 5, 2023 at 1:53 PM Andy Shevchenko wrote: > > Have you checked Ingo Molnar's gigantic series (2k+ patches) for the header > hell clean up? Perhaps we need to apply that first. > We missed you at plumbers. Tanzir gave a talk on this, with the raison d'etre of this work was to see if w

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Andy Shevchenko
+Cc: Jonathan, who tried IWYU with kernel a year or so ago. On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@google.com wrote: > This diff uses an open source tool include-what-you-use (IWYU) to modify > the include list changing indirect includes to direct includes. > IWYU is implemented using t

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Andy Shevchenko
On Tue, Dec 05, 2023 at 01:51:10PM -0800, Nick Desaulniers wrote: > On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: > > On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@google.com wrote: ... > > > IWYU is implemented using the IWYUScripts github repository which is a > > > tool that is > > > cur

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Greg KH
On Tue, Dec 05, 2023 at 01:51:10PM -0800, Nick Desaulniers wrote: > On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: > > > > On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@google.com wrote: > > > This diff uses an open source tool include-what-you-use (IWYU) to modify > > > the include list changi

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Nick Desaulniers
On Tue, Dec 5, 2023 at 1:44 PM Al Viro wrote: > > On Tue, Dec 05, 2023 at 01:39:47PM -0800, Nick Desaulniers wrote: > > > The tooling Tanzir is working on does wrap IWYU, and does support such > > mapping (of 'low level' to 'high level' headers; more so, if it > > recommends X you can override to

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Al Viro
On Tue, Dec 05, 2023 at 09:38:07PM +, Al Viro wrote: > It also breeds includes of asm/*.h, by the look of the output, which is > not a good thing in general ;-/ E.g. #include *anywhere* > outside of linux/uaccess.h is a bad idea. Let me elaborate a bit: Consider e.g. a situation when we ha

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Andy Shevchenko
On Tue, Dec 05, 2023 at 01:39:47PM -0800, Nick Desaulniers wrote: > On Tue, Dec 5, 2023 at 1:24 PM Andrew Morton > wrote: > > On Tue, 5 Dec 2023 13:14:16 -0800 Nick Desaulniers > > wrote: > > > > The preferred way to import bit-fiddling stuff is to include > > > > . Under the hood this may inc

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Nick Desaulniers
On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: > > On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@google.com wrote: > > This diff uses an open source tool include-what-you-use (IWYU) to modify > > the include list changing indirect includes to direct includes. > > How does it account for arch- a

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Andy Shevchenko
On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@google.com wrote: > This diff uses an open source tool include-what-you-use (IWYU) to modify > the include list changing indirect includes to direct includes. > IWYU is implemented using the IWYUScripts github repository which is a tool > that is >

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Al Viro
On Tue, Dec 05, 2023 at 01:39:47PM -0800, Nick Desaulniers wrote: > The tooling Tanzir is working on does wrap IWYU, and does support such > mapping (of 'low level' to 'high level' headers; more so, if it > recommends X you can override to suggest Y instead). > > arch/nios/ also doesn't provide a

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Nick Desaulniers
On Tue, Dec 5, 2023 at 1:24 PM Andrew Morton wrote: > > On Tue, 5 Dec 2023 13:14:16 -0800 Nick Desaulniers > wrote: > > > > > > > The preferred way to import bit-fiddling stuff is to include > > > . Under the hood this may include asm/bitsperlong.h. Or > > > it may not, depending on Kconfig se

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Al Viro
On Tue, Dec 05, 2023 at 08:58:53PM +, tanz...@google.com wrote: > This diff uses an open source tool include-what-you-use (IWYU) to modify > the include list changing indirect includes to direct includes. How does it account for arch- and config-dependent indirect includes? In particular, on

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Andrew Morton
On Tue, 5 Dec 2023 13:14:16 -0800 Nick Desaulniers wrote: > > > > The preferred way to import bit-fiddling stuff is to include > > . Under the hood this may include asm/bitsperlong.h. Or > > it may not, depending on Kconfig settings (particularly architecture). > > > > Just triple checking my

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Nick Desaulniers
On Tue, Dec 5, 2023 at 1:04 PM Andrew Morton wrote: > > On Tue, 05 Dec 2023 20:58:53 + tanz...@google.com wrote: > > > This diff uses an open source tool include-what-you-use (IWYU) to modify > > the include list changing indirect includes to direct includes. > > IWYU is implemented using the

Re: [PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread Andrew Morton
On Tue, 05 Dec 2023 20:58:53 + tanz...@google.com wrote: > This diff uses an open source tool include-what-you-use (IWYU) to modify > the include list changing indirect includes to direct includes. > IWYU is implemented using the IWYUScripts github repository which is a tool > that is > curre

[PATCH] lib/string: shrink lib/string.i via IWYU

2023-12-05 Thread tanzirh
This diff uses an open source tool include-what-you-use (IWYU) to modify the include list changing indirect includes to direct includes. IWYU is implemented using the IWYUScripts github repository which is a tool that is currently undergoing development. These changes seek to improve build times.

[PATCH v2 1/4] pstore: inode: Convert kfree() usage to __free(kfree)

2023-12-05 Thread Kees Cook
Mostly as an example to myself, replace a simple allocation pattern with the automatic kfree cleanup features now exposed by cleanup.h. Cc: "Guilherme G. Piccoli" Cc: Tony Luck Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook --- fs/pstore/inode.c | 10 -- 1 file changed, 4

[PATCH v2 3/4] pstore: inode: Use __free(pstore_iput) for inode allocations

2023-12-05 Thread Kees Cook
Simplify error path for failures where "inode" needs to be freed. Cc: "Guilherme G. Piccoli" Cc: Tony Luck Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook --- fs/pstore/inode.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/pstore/inode.c b/fs/ps

[PATCH v2 2/4] pstore: inode: Convert mutex usage to guard(mutex)

2023-12-05 Thread Kees Cook
Replace open-coded mutex handling with cleanup.h guard(mutex) and scoped_guard(mutex, ...). Cc: "Guilherme G. Piccoli" Cc: Tony Luck Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook --- fs/pstore/inode.c | 76 +++ 1 file changed, 31 inser

[PATCH v2 4/4] pstore: inode: Use cleanup.h for struct pstore_private

2023-12-05 Thread Kees Cook
Simplify error path when "private" needs to be freed. Cc: "Guilherme G. Piccoli" Cc: Tony Luck Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook --- fs/pstore/inode.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inod

[PATCH v2 0/4] pstore: Initial use of cleanup.h

2023-12-05 Thread Kees Cook
Hi, Mostly as practice for myself, I rewrote a bunch of the error handling paths in pstore to use the new cleanup.h routines. I'm enjoying this part: "44 insertions(+), 65 deletions(-)" It also passes basic testing. :) -Kees v2: do not add a global iput macro v1: https://lore.kernel.org/lkml/

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-05 Thread Thomas Weißschuh
Hi Luis, Joel, On 2023-12-05 09:04:08+0100, Thomas Weißschuh wrote: > On 2023-12-04 21:50:14-0800, Luis Chamberlain wrote: > > On Mon, Dec 04, 2023 at 08:52:13AM +0100, Thomas Weißschuh wrote: > > > Tested by booting and with the sysctl selftests on x86. > > > > Can I trouble you to rebase on sys

Re: [PATCH v2 12/18] sysctl: treewide: constify the ctl_table argument of handlers

2023-12-05 Thread kernel test robot
Hi Thomas, kernel test robot noticed the following build errors: [auto build test ERROR on netfilter-nf/main] [also build test ERROR on akpm-mm/mm-everything linus/master v6.7-rc4] [cannot apply to nf-next/master next-20231205] [If your patch is applied to the wrong git tree, kindly drop us a

Re: [PATCH 3/5] fs: Add DEFINE_FREE for struct inode

2023-12-05 Thread Christian Brauner
On Sat, Dec 02, 2023 at 01:34:32PM -0800, Kees Cook wrote: > On Sat, Dec 02, 2023 at 09:28:46PM +, Al Viro wrote: > > On Sat, Dec 02, 2023 at 01:22:13PM -0800, Kees Cook wrote: > > > Allow __free(iput) markings for easier cleanup on inode allocations. > > > > NAK. That's a bloody awful idea f

Re: [PATCH v2 03/21] KASAN: remove code paths guarded by CONFIG_SLAB

2023-12-05 Thread Vlastimil Babka
On 12/5/23 05:48, Hyeonggon Yoo wrote: > On Tue, Dec 5, 2023 at 1:27 PM Hyeonggon Yoo <42.hye...@gmail.com> wrote: >> >> On Mon, Nov 20, 2023 at 07:34:14PM +0100, Vlastimil Babka wrote: >> > With SLAB removed and SLUB the only remaining allocator, we can clean up >> > some code that was depending o

Re: [PATCH v2 02/21] mm/slab: remove CONFIG_SLAB from all Kconfig and Makefile

2023-12-05 Thread Vlastimil Babka
On 12/5/23 05:15, Hyeonggon Yoo wrote: > On Mon, Nov 20, 2023 at 07:34:13PM +0100, Vlastimil Babka wrote: > > Looks good to me, > Reviewed-by: Hyeonggon Yoo <42.hye...@gmail.com> Thanks. > Nit: > > - Some arch configs enables DEBUG_SLAB > - Some documentations refers to {DEBUG_,}SLAB config (i.

Re: [PATCH v2 12/18] sysctl: treewide: constify the ctl_table argument of handlers

2023-12-05 Thread kernel test robot
Hi Thomas, kernel test robot noticed the following build errors: [auto build test ERROR on netfilter-nf/main] [also build test ERROR on akpm-mm/mm-everything linus/master v6.7-rc4] [cannot apply to nf-next/master next-20231205] [If your patch is applied to the wrong git tree, kindly drop us a

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-05 Thread Thomas Weißschuh
On 2023-12-04 21:50:14-0800, Luis Chamberlain wrote: > On Mon, Dec 04, 2023 at 08:52:13AM +0100, Thomas Weißschuh wrote: > > Tested by booting and with the sysctl selftests on x86. > > Can I trouble you to rebase on sysctl-next? > > https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git