lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 9 Nov 2017 15:15:09 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     kernel-janitors@...r.kernel.org,
        Alexei Starovoitov <ast@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        John Fastabend <john.fastabend@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] samples/sockmap: Make signal handling safer

From: Markus Elfring <elfring@...rs.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@...rs.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

Powered by blists - more mailing lists