Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1374269 > unrolled thread

[QUEUED v20160408 17/18] intel_th: msu: Set fops::owner to prevent module from unloading

Started byAlexander Shishkin <alexander.shishkin@linux.intel.com>
First post2016-04-08 17:00 +0200
Last post2016-04-08 17:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [QUEUED v20160408 17/18] intel_th: msu: Set fops::owner to prevent module from unloading Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-04-08 17:00 +0200

#1374269 — [QUEUED v20160408 17/18] intel_th: msu: Set fops::owner to prevent module from unloading

FromAlexander Shishkin <alexander.shishkin@linux.intel.com>
Date2016-04-08 17:00 +0200
Subject[QUEUED v20160408 17/18] intel_th: msu: Set fops::owner to prevent module from unloading
Message-ID<rlG38-5o2-37@gated-at.bofh.it>
Right now it's possible to unload the msu driver while its character
device is open. Prevent it by setting fops::owner, which will result
in the module reference being held while the device node is open.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/msu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index ee153067e1..bcc3b47133 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -1253,6 +1253,7 @@ static const struct file_operations intel_th_msc_fops = {
 	.read		= intel_th_msc_read,
 	.mmap		= intel_th_msc_mmap,
 	.llseek		= no_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static int intel_th_msc_init(struct msc *msc)
-- 
2.8.0.rc3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web