All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix signal handler
@ 2010-02-02 16:14 Markus Elfring
  2010-02-02 20:58 ` Jeff King
  0 siblings, 1 reply; 36+ messages in thread
From: Markus Elfring @ 2010-02-02 16:14 UTC (permalink / raw)
  To: git

Hello,

The function "early_output" that is set as a signal handler by the
function "setup_early_output" contains a simple looking instruction.
http://git.kernel.org/?p=git/git.git;a=blob;f=builtin-log.c;h=8d16832f7e9483f7903009459a72efc39e267c98;hb=HEAD#l173

A global variable gets a function pointer assigned.
http://git.kernel.org/?p=git/git.git;a=blob;f=revision.h;h=a14deefc252bd641fba5e16f7859b4a985a72578;hb=HEAD#l138

I find that this approach does not fit to standard rules because the
data type "sig_atomic_t" is the only type that can be safely used for
global write access in signal handlers.
https://www.securecoding.cert.org/confluence/display/seccode/SIG31-C.+Do+not+access+or+modify+shared+objects+in+signal+handlers

Would you like to change any details in the design of your software
because of this issue to avoid undefined behaviour?

Regards,
Markus

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

end of thread, other threads:[~2010-02-24 11:08 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-02 16:14 Fix signal handler Markus Elfring
2010-02-02 20:58 ` Jeff King
2010-02-02 21:44   ` Markus Elfring
2010-02-02 22:32     ` Jeff King
2010-02-03 10:20       ` Markus Elfring
2010-02-03 10:29         ` Jeff King
2010-02-03 11:55           ` Markus Elfring
2010-02-03 13:12             ` Thomas Rast
2010-02-03 15:46               ` Markus Elfring
2010-02-03 15:52                 ` Shawn O. Pearce
2010-02-03 15:53                 ` Andreas Ericsson
2010-02-03 16:24                   ` Markus Elfring
2010-02-04  7:23                     ` Andreas Ericsson
2010-02-03 15:17             ` Jeff King
2010-02-03 16:04               ` Markus Elfring
2010-02-03 16:26                 ` Bill Lear
2010-02-09 18:01   ` Markus Elfring
2010-02-09 23:49     ` Daniel Barkalow
2010-02-10 17:08     ` [PATCH] " Markus Elfring
2010-02-10 17:14       ` Shawn O. Pearce
2010-02-10 17:35         ` Jeff King
2010-02-10 17:33       ` Jeff King
2010-02-13 13:30         ` Markus Elfring
2010-02-14  6:47           ` Jeff King
2010-02-14 10:19             ` Junio C Hamano
2010-02-18 16:31               ` Markus Elfring
2010-02-18 20:06                 ` Junio C Hamano
2010-02-19 11:05                   ` Markus Elfring
2010-02-22 12:10                   ` [PATCH] Fix a " Markus Elfring
2010-02-22 18:31                     ` Junio C Hamano
2010-02-23  8:55                       ` Markus Elfring
2010-02-23  9:10                         ` Markus Elfring
2010-02-23 21:48                         ` Junio C Hamano
2010-02-24 10:38                           ` Markus Elfring
2010-02-24 10:51                             ` Andreas Ericsson
2010-02-24 11:08                           ` Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.