linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taehee Yoo <ap420073@gmail.com>
To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org
Cc: ap420073@gmail.com, David.Laight@aculab.com,
	johannes@sipsolutions.net, nstange@suse.de, derosier@gmail.com,
	kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
	wil6210@qti.qualcomm.com, b43-dev@lists.infradead.org,
	linux-bluetooth@vger.kernel.org, michael.hennerich@analog.com,
	linux-wpan@vger.kernel.org, stefan@datenfreihafen.org,
	inaky.perez-gonzalez@intel.com, linux-wimax@intel.com,
	emmanuel.grumbach@intel.com, luciano.coelho@intel.com,
	stf_xl@wp.pl, pkshih@realtek.com, ath11k@lists.infradead.org,
	ath10k@lists.infradead.org, wcn36xx@lists.infradead.org,
	merez@codeaurora.org, pizza@shaftnet.org,
	Larry.Finger@lwfinger.net, amitkarwar@gmail.com,
	ganapathi.bhat@nxp.com, huxinming820@gmail.com,
	marcel@holtmann.org, johan.hedberg@gmail.com,
	alex.aring@gmail.com, jukka.rissanen@linux.intel.com,
	arend.vanspriel@broadcom.com, franky.lin@broadcom.com,
	hante.meuleman@broadcom.com, chung-hsien.hsu@infineon.com,
	wright.feng@infineon.com, chi-hsien.lin@infineon.com
Subject: [PATCH net v2 21/21] Bluetooth: set .owner to THIS_MODULE
Date: Sat,  7 Nov 2020 17:21:52 +0000	[thread overview]
Message-ID: <20201107172152.828-22-ap420073@gmail.com> (raw)
In-Reply-To: <20201107172152.828-1-ap420073@gmail.com>

If THIS_MODULE is not set, the module would be removed while debugfs is
being used.
It eventually makes kernel panic.

Fixes: 4b4148e9acc1 ("Bluetooth: Add support for setting DUT mode")
Fixes: 4b4113d6dbdb ("Bluetooth: Add debugfs entry for setting vendor diagnostic mode")
Fixes: 300acfdec916 ("Bluetooth: Introduce force_bredr_smp debugfs option for testing")
Fixes: 64dd374eac15 ("Bluetooth: Export SMP selftest result in debugfs")
Fixes: 0886aea6acd2 ("Bluetooth: Expose debug keys usage setting via debugfs")
Fixes: 134c2a89af22 ("Bluetooth: Add debugfs entry to show Secure Connections Only mode")
Fixes: b55d1abf568c ("Bluetooth: Expose quirks through debugfs")
Fixes: 6e07231a80de ("Bluetooth: Expose Secure Simple Pairing debug mode setting in debugfs")
Fixes: ac345813c4ac ("Bluetooth: Expose current identity information in debugfs")
Fixes: c2aa30db744d ("Bluetooth: debugfs option to unset MITM flag")
Fixes: 6b8d4a6a0314 ("Bluetooth: 6LoWPAN: Use connected oriented channel instead of fixed one")
Fixes: 6de50f9fdb60 ("Bluetooth: Export ECDH selftest result in debugfs")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---

v1 -> v2:
 - Change headline
 - Squash patches into per-driver/subsystem

 net/bluetooth/6lowpan.c     | 1 +
 net/bluetooth/hci_core.c    | 2 ++
 net/bluetooth/hci_debugfs.c | 6 ++++++
 net/bluetooth/selftest.c    | 1 +
 net/bluetooth/smp.c         | 2 ++
 5 files changed, 12 insertions(+)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index cff4944d5b66..0936184f0813 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -1214,6 +1214,7 @@ static const struct file_operations lowpan_control_fops = {
 	.write		= lowpan_control_write,
 	.llseek		= seq_lseek,
 	.release	= single_release,
+	.owner		= THIS_MODULE,
 };
 
 static void disconnect_devices(void)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 502552d6e9af..dba8506202ff 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -116,6 +116,7 @@ static const struct file_operations dut_mode_fops = {
 	.read		= dut_mode_read,
 	.write		= dut_mode_write,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static ssize_t vendor_diag_read(struct file *file, char __user *user_buf,
@@ -172,6 +173,7 @@ static const struct file_operations vendor_diag_fops = {
 	.read		= vendor_diag_read,
 	.write		= vendor_diag_write,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static void hci_debugfs_create_basic(struct hci_dev *hdev)
diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c
index 5e8af2658e44..c9a074da16dd 100644
--- a/net/bluetooth/hci_debugfs.c
+++ b/net/bluetooth/hci_debugfs.c
@@ -71,6 +71,7 @@ static const struct file_operations __name ## _fops = {			      \
 	.read		= __name ## _read,				      \
 	.write		= __name ## _write,				      \
 	.llseek		= default_llseek,				      \
+	.owner		= THIS_MODULE,					      \
 }									      \
 
 #define DEFINE_INFO_ATTRIBUTE(__name, __field)				      \
@@ -284,6 +285,7 @@ static const struct file_operations use_debug_keys_fops = {
 	.open		= simple_open,
 	.read		= use_debug_keys_read,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static ssize_t sc_only_mode_read(struct file *file, char __user *user_buf,
@@ -302,6 +304,7 @@ static const struct file_operations sc_only_mode_fops = {
 	.open		= simple_open,
 	.read		= sc_only_mode_read,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 DEFINE_INFO_ATTRIBUTE(hardware_info, hw_info);
@@ -438,6 +441,7 @@ static const struct file_operations ssp_debug_mode_fops = {
 	.open		= simple_open,
 	.read		= ssp_debug_mode_read,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static int auto_accept_delay_set(void *data, u64 val)
@@ -726,6 +730,7 @@ static const struct file_operations force_static_address_fops = {
 	.read		= force_static_address_read,
 	.write		= force_static_address_write,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static int white_list_show(struct seq_file *f, void *ptr)
@@ -1117,6 +1122,7 @@ static const struct file_operations force_no_mitm_fops = {
 	.read		= force_no_mitm_read,
 	.write		= force_no_mitm_write,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 DEFINE_QUIRK_ATTRIBUTE(quirk_strict_duplicate_filter,
diff --git a/net/bluetooth/selftest.c b/net/bluetooth/selftest.c
index f71c6fa65fb3..445ea247061b 100644
--- a/net/bluetooth/selftest.c
+++ b/net/bluetooth/selftest.c
@@ -194,6 +194,7 @@ static const struct file_operations test_ecdh_fops = {
 	.open		= simple_open,
 	.read		= test_ecdh_read,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static int __init test_ecdh(void)
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index bf4bef13d935..3b91f927aab5 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -3407,6 +3407,7 @@ static const struct file_operations force_bredr_smp_fops = {
 	.read		= force_bredr_smp_read,
 	.write		= force_bredr_smp_write,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 int smp_register(struct hci_dev *hdev)
@@ -3751,6 +3752,7 @@ static const struct file_operations test_smp_fops = {
 	.open		= simple_open,
 	.read		= test_smp_read,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static int __init run_selftests(struct crypto_shash *tfm_cmac,
-- 
2.17.1


  parent reply	other threads:[~2020-11-07 17:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07 17:21 [PATCH net v2 00/21] net: avoid to remove module when its debugfs is being used Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 01/21] net: set .owner to THIS_MODULE Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 02/21] mac80211: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 03/21] cfg80211: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 04/21] netdevsim: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 05/21] ieee802154: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 06/21] i2400m: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 07/21] wlcore: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 08/21] wl1251: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 09/21] iwlwifi: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 10/21] iwlegacy: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 11/21] rtlwifi: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 12/21] ath11k: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 13/21] ath10k: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 14/21] wcn36xx: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 15/21] wil6210: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 16/21] cw1200: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 17/21] brcmfmac: " Taehee Yoo
2020-11-07 17:41   ` Arend Van Spriel
2020-11-07 18:16     ` Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 18/21] b43legacy: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 19/21] b43: " Taehee Yoo
2020-11-07 17:21 ` [PATCH net v2 20/21] mwifiex: mwifiex: " Taehee Yoo
2020-11-07 17:21 ` Taehee Yoo [this message]
2020-11-07 19:05 ` [PATCH net v2 00/21] net: avoid to remove module when its debugfs is being used Jakub Kicinski
2020-11-07 19:52   ` Taehee Yoo
2020-11-10  8:32   ` Johannes Berg

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=20201107172152.828-22-ap420073@gmail.com \
    --to=ap420073@gmail.com \
    --cc=David.Laight@aculab.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=alex.aring@gmail.com \
    --cc=amitkarwar@gmail.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=ath10k@lists.infradead.org \
    --cc=ath11k@lists.infradead.org \
    --cc=b43-dev@lists.infradead.org \
    --cc=chi-hsien.lin@infineon.com \
    --cc=chung-hsien.hsu@infineon.com \
    --cc=davem@davemloft.net \
    --cc=derosier@gmail.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=franky.lin@broadcom.com \
    --cc=ganapathi.bhat@nxp.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=huxinming820@gmail.com \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=johan.hedberg@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=jukka.rissanen@linux.intel.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-wimax@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=marcel@holtmann.org \
    --cc=merez@codeaurora.org \
    --cc=michael.hennerich@analog.com \
    --cc=netdev@vger.kernel.org \
    --cc=nstange@suse.de \
    --cc=pizza@shaftnet.org \
    --cc=pkshih@realtek.com \
    --cc=stefan@datenfreihafen.org \
    --cc=stf_xl@wp.pl \
    --cc=wcn36xx@lists.infradead.org \
    --cc=wil6210@qti.qualcomm.com \
    --cc=wright.feng@infineon.com \
    /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).