Re: [Cocci] [PATCH 2/2] Coccinelle: extend memdup_user rule with vmemdup_user()

2020-06-06 Thread Julia Lawall
On Sat, 30 May 2020, Denis Efremov wrote: > Add vmemdup_user() transformations to the memdup_user.cocci rule. > Commit 50fd2f298bef ("new primitive: vmemdup_user()") introduced > vmemdup_user(). The function uses kvmalloc with GPF_USER flag. > > Signed-off-by: Denis Efremov > --- > scripts/co

Re: [PATCH 2/2] Coccinelle: extend memdup_user rule with vmemdup_user()

2020-05-31 Thread Markus Elfring
> +@rv depends on !patch@ > +expression from,to,size; > +position p; > +statement S1,S2; > +@@ > + > +* to = \(kvmalloc@p\|kvzalloc@p\)(size,\(GFP_KERNEL\|GFP_USER\)); > + if (to==NULL || ...) S1 > + if (copy_from_user(to, from, size) != 0) > + S2 How does the SmPL asterisk functionality fi

Re: [PATCH 2/2] Coccinelle: extend memdup_user rule with vmemdup_user()

2020-05-31 Thread Markus Elfring
> Add vmemdup_user() transformations to the memdup_user.cocci rule. > Commit 50fd2f298bef ("new primitive: vmemdup_user()") introduced > vmemdup_user(). The function uses kvmalloc with GPF_USER flag. Such a software evolution is also interesting. > +@depends on patch@ > +- to = \(kvmalloc\|kv

[PATCH 2/2] Coccinelle: extend memdup_user rule with vmemdup_user()

2020-05-30 Thread Denis Efremov
Add vmemdup_user() transformations to the memdup_user.cocci rule. Commit 50fd2f298bef ("new primitive: vmemdup_user()") introduced vmemdup_user(). The function uses kvmalloc with GPF_USER flag. Signed-off-by: Denis Efremov --- scripts/coccinelle/api/memdup_user.cocci | 49 +++