Re: [Cocci] [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-29 Thread Joe Perches
On Mon, 2019-07-29 at 10:07 -0400, Julia Lawall wrote: > I see that stracpy is now in linux-next. Would it be reasonable to send > patches adding uses now? My preference would be to have: o A provably correct script If a small subset of possible conversions are skipped, that's fine. o As

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-29 Thread Julia Lawall
I see that stracpy is now in linux-next. Would it be reasonable to send patches adding uses now? Are there any rules for adding calls to stracpy_pad? julia

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-25 Thread Julia Lawall
> > > Perhaps this "x =" should also include += and + > > > and the various other operators that are possible > > > or does SmPL grammar already do that? This is now done. It seems to have had no impact. > Anywhere the return value of strlcpy is used, not just as > an assignment, is an instance

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-25 Thread Joe Perches
On Thu, 2019-07-25 at 08:58 -0500, Julia Lawall wrote: > On Thu, 25 Jul 2019, Joe Perches wrote: [] > > Just for completeness and correctness, as I at > > least don't find an existing use: > > > > Perhaps this "x =" should also include += and + > > and the various other operators that are

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-25 Thread Julia Lawall
On Thu, 25 Jul 2019, Joe Perches wrote: > On Wed, 2019-07-24 at 20:42 -0500, Julia Lawall wrote: > > New version. I check for non-use of the return value of strlcpy and > > address some issues that affected the matching of the case where the first > > argument involves a pointer dereference.

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-25 Thread Joe Perches
On Wed, 2019-07-24 at 20:42 -0500, Julia Lawall wrote: > New version. I check for non-use of the return value of strlcpy and > address some issues that affected the matching of the case where the first > argument involves a pointer dereference. Actually, an isomorphism now > takes care of that

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-24 Thread Julia Lawall
New version. I check for non-use of the return value of strlcpy and address some issues that affected the matching of the case where the first argument involves a pointer dereference. Actually, an isomorphism now takes care of that case, so it doesn't show up in the semantic patch explicitly any

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-24 Thread Julia Lawall
On Wed, 24 Jul 2019, Joe Perches wrote: > On Wed, 2019-07-24 at 10:28 +, David Laight wrote: > > From: Joe Perches > > > Sent: 24 July 2019 05:38 > > > On Tue, 2019-07-23 at 23:27 -0500, Julia Lawall wrote: > > > > On Tue, 23 Jul 2019, Joe Perches wrote: > > > > > On Tue, 2019-07-23 at

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-24 Thread Joe Perches
On Wed, 2019-07-24 at 10:28 +, David Laight wrote: > From: Joe Perches > > Sent: 24 July 2019 05:38 > > On Tue, 2019-07-23 at 23:27 -0500, Julia Lawall wrote: > > > On Tue, 23 Jul 2019, Joe Perches wrote: > > > > On Tue, 2019-07-23 at 22:54 -0500, Julia Lawall wrote: > > > > > A seantic patch

RE: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-24 Thread David Laight
From: Joe Perches > Sent: 24 July 2019 05:38 > On Tue, 2019-07-23 at 23:27 -0500, Julia Lawall wrote: > > > > On Tue, 23 Jul 2019, Joe Perches wrote: > > > > > On Tue, 2019-07-23 at 22:54 -0500, Julia Lawall wrote: > > > > A seantic patch and the resulting output for the case where the third > > >

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-23 Thread Joe Perches
On Tue, 2019-07-23 at 23:27 -0500, Julia Lawall wrote: > > On Tue, 23 Jul 2019, Joe Perches wrote: > > > On Tue, 2019-07-23 at 22:54 -0500, Julia Lawall wrote: > > > A seantic patch and the resulting output for the case where the third > > > arugument is a constant is attached. Likewise the

Re: [Cocci] [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-23 Thread Julia Lawall
On Tue, 23 Jul 2019, Joe Perches wrote: > On Tue, 2019-07-23 at 22:54 -0500, Julia Lawall wrote: > > A seantic patch and the resulting output for the case where the third > > arugument is a constant is attached. Likewise the resulting output on a > > recent linux-next. > > > > julia > > Nice.

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-23 Thread Joe Perches
On Tue, 2019-07-23 at 22:54 -0500, Julia Lawall wrote: > A seantic patch and the resulting output for the case where the third > arugument is a constant is attached. Likewise the resulting output on a > recent linux-next. > > julia Nice. Thanks Julia A couple issues: There is a problem with

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-23 Thread Julia Lawall
A seantic patch and the resulting output for the case where the third arugument is a constant is attached. Likewise the resulting output on a recent linux-next. julia// spatch.opt -j 44 ~/linux-next stracpy.cocci --all-includes --include-headers-for-types --very-quiet > stracpy.out @r@

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-23 Thread Joe Perches
On Tue, 2019-07-23 at 15:52 -0500, Julia Lawall wrote: > On Mon, 22 Jul 2019, Joe Perches wrote: > > I just sent a patch to add yet another string copy mechanism. > > > > This could help avoid misuses of strscpy and strlcpy like this > > patch set: > > > >

Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-23 Thread Julia Lawall
On Mon, 22 Jul 2019, Joe Perches wrote: > Hello Julia. > > I just sent a patch to add yet another string copy mechanism. > > This could help avoid misuses of strscpy and strlcpy like this > patch set: > > https://lore.kernel.org/lkml/cover.1562283944.git@perches.com/T/ > > A possible cocci

[Cocci] [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms]

2019-07-23 Thread Joe Perches
Hello Julia. I just sent a patch to add yet another string copy mechanism. This could help avoid misuses of strscpy and strlcpy like this patch set: https://lore.kernel.org/lkml/cover.1562283944.git@perches.com/T/ A possible cocci script to do conversions could be: $ cat str.cpy.cocci