]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
netfilter: nf_tables: fail batch if fatal signal is pending
authorFlorian Westphal <fw@strlen.de>
Sun, 27 May 2018 09:24:34 +0000 (11:24 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 29 May 2018 12:50:28 +0000 (14:50 +0200)
abort batch processing and return so task can exit faster.
Otherwise even SIGKILL has no immediate effect.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink.c

index 88c9e222b67094fb641318e2bfa99a459fb2cf63..5a1bd23af1a379fe3525b518b8ffc31035247982 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/uaccess.h>
 #include <net/sock.h>
 #include <linux/init.h>
+#include <linux/sched/signal.h>
 
 #include <net/netlink.h>
 #include <linux/netfilter/nfnetlink.h>
@@ -330,6 +331,13 @@ replay:
        while (skb->len >= nlmsg_total_size(0)) {
                int msglen, type;
 
+               if (fatal_signal_pending(current)) {
+                       nfnl_err_reset(&err_list);
+                       err = -EINTR;
+                       status = NFNL_BATCH_FAILURE;
+                       goto done;
+               }
+
                memset(&extack, 0, sizeof(extack));
                nlh = nlmsg_hdr(skb);
                err = 0;