Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9931067imu; Sun, 30 Dec 2018 08:32:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/XKtKAz0Uq7ki7dhLZHcDeiVh3XsLOsCO0KtNbdkOAavhidjKKTKCNT3v1vlx8c7g/Qvw1I X-Received: by 2002:a62:8c11:: with SMTP id m17mr35202508pfd.224.1546187568386; Sun, 30 Dec 2018 08:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546187568; cv=none; d=google.com; s=arc-20160816; b=TuBuGpC2Ng5ssjJjY4OfZ7qZ5LCnWHIPK/3lp/NuXO6RXAkg7D57itFXdwBBgcsEDd 5WK8ryRT2nqGA8/PBkiJHzoc/z976dFovpmm16XnREdIsDHPFrgkkeT1qeMv0nI8SVv2 dWJos/sYhwtU03dCzr1hS7Bc5jJdL/KhKi0WIFVd9/JRRmodBVip9ehznaLbz8iBirqx R6KG6zGo/lsb691J80hwUoRNDI2Hs7HqrdnPhpXTLAglJGRYy34YDQjW8Z9Dsk9YcLbn CD4M00IWvZ3d2iqs0QKaXkqsOlVYFHP4/N8MIMNKTvmGRjW2I5/j9kIJp/eX7LAPw2NV B6tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=MbShhGC3U45A+UQ3w2sDqhHcEIuZ88bsR7FXlV3nM/w=; b=d86c/Ua6pLdg6l0IzNLk1iwl67pnriaxzTYvBfESgAoBN2majsramH5VJVAJYaNZTr LScN4DMhw+76qKaIrIUjbNjshHkWcMikOqlsrwA+FjgypsHljW6xC8kG+yu9vJlxhBa9 D4I0vIUzjGtSayDXlZ3RuznNrlIGhotAt+ZwxhWsQ9iT/KohQ8YqLqW0N2TZz6W7qQ9W RqFEYChnI/NEoJ8vI02ThCp5i0aQ1wTLNvvLRBFv0s3CknDg5CIw1byJ1a40/bMjRP9/ cF9Q1edpwgqAhk1XBb0R9OXIjxziuIESlJCCkRBhy9+fYD/2OvW8kGdXCDNgYMaE2/u5 +8oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z2cqFKMC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si44070950pfe.203.2018.12.30.08.32.33; Sun, 30 Dec 2018 08:32:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z2cqFKMC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726793AbeL3QbT (ORCPT + 99 others); Sun, 30 Dec 2018 11:31:19 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40495 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726216AbeL3QbT (ORCPT ); Sun, 30 Dec 2018 11:31:19 -0500 Received: by mail-pl1-f195.google.com with SMTP id u18so11885200plq.7; Sun, 30 Dec 2018 08:31:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=MbShhGC3U45A+UQ3w2sDqhHcEIuZ88bsR7FXlV3nM/w=; b=Z2cqFKMCi8q+fiioO4g1uIgPUZx6PyORezXi2oIbQlnahdJOqq5hBh3jGkdbF9gp0x agG2S+5nZTNvzD8KFmJSFaTktnyE6DEPBZ0RxJDer6Ly+Zj9DHGz1wMMQy7dJELECAoI clxTlhUF2Ce5RKK6fhG5VKT4E6YvfMoliqtzovBEHBd1YNYggkzK2I/s+2H4e9g0GgPM zL1yMNFEjkqbAYcmgTUCJ9N71vKqRIrXnAUEEvAyA48PBl4BhqUMlwf74DjYfHtXNfkf kKGZO3GCXMc61Cm6pQteGkLyPfyE3iLHGt9cYk9BAIqI3povHp27jyCXBual3XbahEzi pYiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MbShhGC3U45A+UQ3w2sDqhHcEIuZ88bsR7FXlV3nM/w=; b=Djlj2RXr29fBPnpDA/ppczFT4WMoEWcyYl14/Rb+xfeMSgAqG1qQKjA0gEREK5drpr OGuqSNpJESAP3HUhgsFpCzBaxzK8elKn0bPa0biNTeN3862sGTHPoeCWpAA/iPKsQ4TN iGRTwbyeGWQdtU6EnGBtxPt5phK6e8zuDx3cjyHflBF5TXA6cIIkoIwKVi3hwA3IR4nj xHZhVFlASnqg2xgVV9QK0B6xdejxGf7V3iak70aiWVHfScKgmZhNcgkH7bx5dUgxVg/5 5MkWZztri6KEWBD+tn4ix+qoydz3KFhk4Y+QhnoRLcDTdouxZq5UL5oc2QbCqOu9ndEB 2/mQ== X-Gm-Message-State: AJcUukdczdX21tsr0LiAXFTm66zB8rffd+jjjixPm0XKUWXR+bEPFBEP 6gL0hwu6DdTpidm7abRIK7M= X-Received: by 2002:a17:902:6b0c:: with SMTP id o12mr35109000plk.291.1546187478220; Sun, 30 Dec 2018 08:31:18 -0800 (PST) Received: from ap-To-be-filled-by-O-E-M.8.8.8.8 ([14.33.120.60]) by smtp.gmail.com with ESMTPSA id h64sm70034279pfc.142.2018.12.30.08.31.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Dec 2018 08:31:17 -0800 (PST) From: Taehee Yoo To: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, daniel@iogearbox.net, ast@kernel.org, mcgrof@kernel.org Cc: ap420073@gmail.com Subject: [PATCH net 0/4] net: bpfilter: fix two bugs in bpfilter Date: Mon, 31 Dec 2018 01:30:45 +0900 Message-Id: <20181230163045.20813-1-ap420073@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patches fix two bugs in the bpfilter_umh which are related in iptables command. The first patch adds an exit code for UMH process. This provides an opportunity to cleanup members of the umh_info to modules which use the UMH. The second patch makes the bpfilter_umh use UMH cleanup callback. The third patch adds re-start routine for the bpfilter_umh. The bpfilter_umh does not re-start after error occurred. because there is no re-start routine in the module. The fourth patch ensures that the bpfilter.ko module will not removed while it's being used. The bpfilter.ko is not protected by locks or module reference counter. Therefore that can be removed while module is being used. In order to protect that, mutex is used. The first and second patch are preparation patches for the third and fourth patch. TEST #1 while : do modprobe bpfilter kill -9 iptables -vnL done TEST #2 while : do iptables -I FORWARD -m string --string ap --algo kmp & iptables -F & modprobe -rv bpfilter & done The TEST1 makes a failure of iptables command. This is fixed by the third patch. The TEST2 makes a panic because of a race condition in the bpfilter_umh module. This is fixed by the fourth patch. Taehee Yoo (4): umh: add exit routine for UMH process net: bpfilter: use cleanup callback to release umh_info net: bpfilter: restart bpfilter_umh when error occurred net: bpfilter: disallow to remove bpfilter module while being used include/linux/bpfilter.h | 15 +++++-- include/linux/umh.h | 4 ++ kernel/exit.c | 1 + kernel/umh.c | 27 ++++++++++++ net/bpfilter/bpfilter_kern.c | 72 +++++++++++++++++--------------- net/bpfilter/bpfilter_umh_blob.S | 2 +- net/ipv4/bpfilter/sockopt.c | 59 +++++++++++++++++++++----- 7 files changed, 132 insertions(+), 48 deletions(-) -- 2.17.1