Skip to content

Commit 4c87158

Browse files
Alexey Dobriyanummakynes
authored andcommitted
netfilter: delete /proc THIS_MODULE references
/proc has been ignoring struct file_operations::owner field for 10 years. Specifically, it started with commit 786d7e1 ("Fix rmmod/read/write races in /proc entries"). Notice the chunk where inode->i_fop is initialized with proxy struct file_operations for regular files: - if (de->proc_fops) - inode->i_fop = de->proc_fops; + if (de->proc_fops) { + if (S_ISREG(inode->i_mode)) + inode->i_fop = &proc_reg_file_ops; + else + inode->i_fop = de->proc_fops; + } VFS stopped pinning module at this point. # ipvs Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent b0c3dc6 commit 4c87158

11 files changed

Lines changed: 0 additions & 19 deletions

‎net/netfilter/ipvs/ip_vs_app.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ static int ip_vs_app_open(struct inode *inode, struct file *file)
595595
}
596596

597597
static const struct file_operations ip_vs_app_fops = {
598-
.owner = THIS_MODULE,
599598
.open = ip_vs_app_open,
600599
.read = seq_read,
601600
.llseek = seq_lseek,

‎net/netfilter/ipvs/ip_vs_conn.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,6 @@ static int ip_vs_conn_open(struct inode *inode, struct file *file)
11431143
}
11441144

11451145
static const struct file_operations ip_vs_conn_fops = {
1146-
.owner = THIS_MODULE,
11471146
.open = ip_vs_conn_open,
11481147
.read = seq_read,
11491148
.llseek = seq_lseek,
@@ -1221,7 +1220,6 @@ static int ip_vs_conn_sync_open(struct inode *inode, struct file *file)
12211220
}
12221221

12231222
static const struct file_operations ip_vs_conn_sync_fops = {
1224-
.owner = THIS_MODULE,
12251223
.open = ip_vs_conn_sync_open,
12261224
.read = seq_read,
12271225
.llseek = seq_lseek,

‎net/netfilter/ipvs/ip_vs_ctl.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,6 @@ static int ip_vs_info_open(struct inode *inode, struct file *file)
21162116
}
21172117

21182118
static const struct file_operations ip_vs_info_fops = {
2119-
.owner = THIS_MODULE,
21202119
.open = ip_vs_info_open,
21212120
.read = seq_read,
21222121
.llseek = seq_lseek,
@@ -2161,7 +2160,6 @@ static int ip_vs_stats_seq_open(struct inode *inode, struct file *file)
21612160
}
21622161

21632162
static const struct file_operations ip_vs_stats_fops = {
2164-
.owner = THIS_MODULE,
21652163
.open = ip_vs_stats_seq_open,
21662164
.read = seq_read,
21672165
.llseek = seq_lseek,
@@ -2230,7 +2228,6 @@ static int ip_vs_stats_percpu_seq_open(struct inode *inode, struct file *file)
22302228
}
22312229

22322230
static const struct file_operations ip_vs_stats_percpu_fops = {
2233-
.owner = THIS_MODULE,
22342231
.open = ip_vs_stats_percpu_seq_open,
22352232
.read = seq_read,
22362233
.llseek = seq_lseek,

‎net/netfilter/nf_conntrack_expect.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ static int exp_open(struct inode *inode, struct file *file)
649649
}
650650

651651
static const struct file_operations exp_file_ops = {
652-
.owner = THIS_MODULE,
653652
.open = exp_open,
654653
.read = seq_read,
655654
.llseek = seq_lseek,

‎net/netfilter/nf_conntrack_standalone.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ static int ct_open(struct inode *inode, struct file *file)
382382
}
383383

384384
static const struct file_operations ct_file_ops = {
385-
.owner = THIS_MODULE,
386385
.open = ct_open,
387386
.read = seq_read,
388387
.llseek = seq_lseek,
@@ -475,7 +474,6 @@ static int ct_cpu_seq_open(struct inode *inode, struct file *file)
475474
}
476475

477476
static const struct file_operations ct_cpu_seq_fops = {
478-
.owner = THIS_MODULE,
479477
.open = ct_cpu_seq_open,
480478
.read = seq_read,
481479
.llseek = seq_lseek,

‎net/netfilter/nf_log.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ static int nflog_open(struct inode *inode, struct file *file)
402402
}
403403

404404
static const struct file_operations nflog_file_ops = {
405-
.owner = THIS_MODULE,
406405
.open = nflog_open,
407406
.read = seq_read,
408407
.llseek = seq_lseek,

‎net/netfilter/nf_synproxy_core.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ static int synproxy_cpu_seq_open(struct inode *inode, struct file *file)
317317
}
318318

319319
static const struct file_operations synproxy_cpu_seq_fops = {
320-
.owner = THIS_MODULE,
321320
.open = synproxy_cpu_seq_open,
322321
.read = seq_read,
323322
.llseek = seq_lseek,

‎net/netfilter/nfnetlink_log.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,6 @@ static int nful_open(struct inode *inode, struct file *file)
10541054
}
10551055

10561056
static const struct file_operations nful_file_ops = {
1057-
.owner = THIS_MODULE,
10581057
.open = nful_open,
10591058
.read = seq_read,
10601059
.llseek = seq_lseek,

‎net/netfilter/nfnetlink_queue.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,6 @@ static int nfqnl_open(struct inode *inode, struct file *file)
14771477
}
14781478

14791479
static const struct file_operations nfqnl_file_ops = {
1480-
.owner = THIS_MODULE,
14811480
.open = nfqnl_open,
14821481
.read = seq_read,
14831482
.llseek = seq_lseek,

‎net/netfilter/x_tables.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,6 @@ static int xt_table_open(struct inode *inode, struct file *file)
13621362
}
13631363

13641364
static const struct file_operations xt_table_ops = {
1365-
.owner = THIS_MODULE,
13661365
.open = xt_table_open,
13671366
.read = seq_read,
13681367
.llseek = seq_lseek,
@@ -1498,7 +1497,6 @@ static int xt_match_open(struct inode *inode, struct file *file)
14981497
}
14991498

15001499
static const struct file_operations xt_match_ops = {
1501-
.owner = THIS_MODULE,
15021500
.open = xt_match_open,
15031501
.read = seq_read,
15041502
.llseek = seq_lseek,
@@ -1551,7 +1549,6 @@ static int xt_target_open(struct inode *inode, struct file *file)
15511549
}
15521550

15531551
static const struct file_operations xt_target_ops = {
1554-
.owner = THIS_MODULE,
15551552
.open = xt_target_open,
15561553
.read = seq_read,
15571554
.llseek = seq_lseek,

0 commit comments

Comments
 (0)