Coccinelle archive on lore.kernel.org
 help / color / Atom feed
* Re: [Cocci] string.h: Mark 34 functions with __must_check
       [not found]           ` <CAKwvOd=Jo5UkQN9A9rTJf0WtsxXNjaJ=jxf2gwHFdW8om-fbTQ@mail.gmail.com>
@ 2019-10-09 18:06             ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2019-10-09 18:06 UTC (permalink / raw)
  To: Nick Desaulniers, Joe Perches, kernel-janitors
  Cc: Kees Cook, Alexander Shishkin, LKML, Steven Rostedt,
	Miguel Ojeda, Andrew Morton, Andy Shevchenko, Coccinelle

> I reviewed the functions here and believe the ones you added checks
> for all look good.

Thanks for your positive feedback.


> Though Joe's comment on the relative order of where the
> annotation appears in the function declarations should be addressed in
> a V2 IMO.

Would you be looking for a subsequent change also by the means of
the semantic patch language with which the (function) attributes
can be adjusted to the ordering that you would prefer finally?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Cocci] Searching for missing variable checks
       [not found] ` <954c5d70-742f-7b0e-57ad-ea967e93be89@rasmusvillemoes.dk>
@ 2019-10-11  5:15   ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2019-10-11  5:15 UTC (permalink / raw)
  To: Rasmus Villemoes, kernel-janitors, Alexander Shishkin,
	Andrew Morton, Andy Shevchenko, Joe Perches, Kees Cook,
	Nick Desaulniers, Steven Rostedt, Aditya Pakki, Kangjie Lu,
	Navid Emamdoost, Stephen McCamant, Coccinelle
  Cc: LKML

> The problem is the __must_check does not mean that the
> return value must be followed by a comparison to NULL and bailing out
> (that can't really be checked), it simply ensures the return value is
> assigned somewhere or used in an if(). So foo->bar = kstrdup() not
> followed by a check of foo->bar won't warn.

Higher level source code analysis tools like the semantic patch language
(Coccinelle software) can help to find such missing checks.
Would you like to point any additional development tools out
for this purpose?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <75f70e5e-9ece-d6d1-a2c5-2f3ad79b9ccb@web.de>
     [not found] ` <20191009110943.7ff3a08a@gandalf.local.home>
     [not found]   ` <CAKwvOdk3OTaAVmbV9Cu+Dzg8zuojjU6ENZfu4cUPaKS2a58d3w@mail.gmail.com>
     [not found]     ` <20191009122735.17415f9c@gandalf.local.home>
     [not found]       ` <CAKwvOdkvgeHnQ_SyR7QUqpsmtMPRe1SCJ_XJLQYv-gvLB6rbLg@mail.gmail.com>
     [not found]         ` <b8bdfb25-deb8-9da0-3572-408b19bb0507@web.de>
     [not found]           ` <CAKwvOd=Jo5UkQN9A9rTJf0WtsxXNjaJ=jxf2gwHFdW8om-fbTQ@mail.gmail.com>
2019-10-09 18:06             ` [Cocci] string.h: Mark 34 functions with __must_check Markus Elfring
     [not found] ` <954c5d70-742f-7b0e-57ad-ea967e93be89@rasmusvillemoes.dk>
2019-10-11  5:15   ` [Cocci] Searching for missing variable checks Markus Elfring

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr
	public-inbox-index cocci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git