From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
John Fastabend <john.fastabend@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] samples/sockmap: Make signal handling safer
Date: Thu, 9 Nov 2017 15:15:09 +0100 [thread overview]
Message-ID: <8e064bc1-c762-1ca6-4a67-9d50793753f6@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 9 Nov 2017 15:06:16 +0100
Use the data type "sig_atomic_t" for the variable "running"
so that it can be safely modified by a signal handler.
Fixes: 69e8cc134bcbf0ccfcf852c400b8e6788d1d0038 ("bpf: sockmap sample program")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
samples/sockmap/sockmap_user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap/sockmap_user.c
index 7cc9d228216f..6e3ebbb1f8f4 100644
--- a/samples/sockmap/sockmap_user.c
+++ b/samples/sockmap/sockmap_user.c
@@ -39,7 +39,7 @@
#include "../bpf/bpf_util.h"
#include "../bpf/libbpf.h"
-int running;
+static sig_atomic_t running;
void running_handler(int a);
/* randomly selected ports for testing on lo */
--
2.15.0
reply other threads:[~2017-11-09 14:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8e064bc1-c762-1ca6-4a67-9d50793753f6@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=ast@kernel.org \
--cc=davem@davemloft.net \
--cc=john.fastabend@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).