Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 310139 Details for
Bug 448603
holding files under /proc/net open no longer adds to module refcount
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to make proc file creation / module ownership atomic for any module that wants it
open_refcnt.patch (text/plain), 2.24 KB, created by
Neil Horman
on 2008-06-24 13:22:58 UTC
(
hide
)
Description:
patch to make proc file creation / module ownership atomic for any module that wants it
Filename:
MIME Type:
Creator:
Neil Horman
Created:
2008-06-24 13:22:58 UTC
Size:
2.24 KB
patch
obsolete
>--- linux-2.6.9/kernel/module.c.orig 2008-06-24 06:36:43.000000000 -0400 >+++ linux-2.6.9/kernel/module.c 2008-06-24 06:56:51.000000000 -0400 >@@ -1918,6 +1918,9 @@ > free_module(mod); > up(&module_mutex); > } >+ down(&noitify_mutex); >+ notifier_call_chain(&module_notify_list, MODULE_STATE_FAILED, mod); >+ up(¬ifier_mutex); > return ret; > } > >@@ -1932,6 +1935,10 @@ > mod->init_text_size = 0; > up(&module_mutex); > >+ down(&noitify_mutex); >+ notifier_call_chain(&module_notify_list, MODULE_STATE_LIVE, mod); >+ up(¬ify_mutex); >+ > return 0; > } > >--- linux-2.6.9/fs/proc/inode.c.orig 2008-06-24 06:38:30.000000000 -0400 >+++ linux-2.6.9/fs/proc/inode.c 2008-06-24 07:01:15.000000000 -0400 >@@ -69,6 +69,8 @@ > /* Let go of any associated proc directory entry */ > de = PROC_I(inode)->pde; > if (de) { >+ if (de->owner) >+ module_put(de->owner); > de_put(de); > } > clear_inode(inode); >@@ -186,6 +188,36 @@ > return 1; > } > >+static struct notifier_block module_load_nb = { >+ .notifier_call = module_load_notify, >+}; >+ >+static spinlock_t module_get_lock = SPIN_LOCK_UNLOCKED; >+ >+static int module_load_notify(struct notifier_block * self, unsigned long val, void * data) >+{ >+#ifdef CONFIG_MODULES >+ switch (val) { >+ case MODULE_STATE_COMING: >+ spin_lock(&module_get_lock); >+ break; >+ case MODULE_STATE_LIVE: >+ case MODULE_STATE_FAILED: >+ spin_unlock(&module_get_lock); >+ break; >+ default: >+ return 0; >+ } >+#endif >+ return 0; >+} >+ >+ >+int __init proc_init_notifiers(void) >+{ >+ return register_module_notifier(&module_load_nb); >+} >+ > struct inode *proc_get_inode(struct super_block *sb, unsigned int ino, > struct proc_dir_entry *de) > { >@@ -213,6 +245,12 @@ > inode->i_size = de->size; > if (de->nlink) > inode->i_nlink = de->nlink; >+ spin_lock(&module_get_lock); >+ if (!try_module_get(de->owner)) { >+ spin_unlock(&module_get_lock); >+ goto out_fail; >+ } >+ spin_unlock(&module_get_lock); > if (de->proc_iops) > inode->i_op = de->proc_iops; > if (de->proc_fops) >--- linux-2.6.9/include/linux/module.h.orig 2008-06-24 06:36:08.000000000 -0400 >+++ linux-2.6.9/include/linux/module.h 2008-06-24 06:56:00.000000000 -0400 >@@ -206,6 +206,7 @@ > MODULE_STATE_LIVE, > MODULE_STATE_COMING, > MODULE_STATE_GOING, >+ MODULE_STATE_FAILED, > }; > > /* sysfs stuff */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 448603
:
309114
|
309292
|
309776
|
310139
|
310142
|
316894
|
316952
|
317720