OXIESEC PANEL
- Current Dir:
/
/
usr
/
src
/
linux-headers-4.15.0-213
/
scripts
/
coccinelle
/
api
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2024 07:14:16 AM
rwxr-xr-x
📁
alloc
-
05/09/2024 07:14:16 AM
rwxr-xr-x
📄
check_bq27xxx_data.cocci
3.42 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
d_find_alias.cocci
1.28 KB
01/28/2018 09:20:33 PM
rw-r--r--
📁
debugfs
-
05/09/2024 07:14:16 AM
rwxr-xr-x
📄
drm-get-put.cocci
1.93 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
err_cast.cocci
1.07 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kstrdup.cocci
2.4 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
memdup.cocci
1.35 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
memdup_user.cocci
1.28 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
platform_no_drv_owner.cocci
3.78 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pm_runtime.cocci
2.34 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
ptr_ret.cocci
1.77 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
resource_size.cocci
2.07 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
simple_open.cocci
1.21 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
stream_open.cocci
7.6 KB
06/16/2023 05:32:39 PM
rw-r--r--
📄
vma_pages.cocci
1.48 KB
01/28/2018 09:20:33 PM
rw-r--r--
Editing: simple_open.cocci
Close
// SPDX-License-Identifier: GPL-2.0 /// Remove an open coded simple_open() function /// and replace file operations references to the function /// with simple_open() instead. /// // Confidence: High // Comments: // Options: --no-includes --include-headers virtual patch virtual report @ open depends on patch @ identifier open_f != simple_open; identifier i, f; @@ -int open_f(struct inode *i, struct file *f) -{ ( -if (i->i_private) -f->private_data = i->i_private; | -f->private_data = i->i_private; ) -return 0; -} @ has_open depends on open @ identifier fops; identifier open.open_f; @@ struct file_operations fops = { ..., -.open = open_f, +.open = simple_open, ... }; @ openr depends on report @ identifier open_f != simple_open; identifier i, f; position p; @@ int open_f@p(struct inode *i, struct file *f) { ( if (i->i_private) f->private_data = i->i_private; | f->private_data = i->i_private; ) return 0; } @ has_openr depends on openr @ identifier fops; identifier openr.open_f; position p; @@ struct file_operations fops = { ..., .open = open_f@p, ... }; @script:python@ pf << openr.p; ps << has_openr.p; @@ coccilib.report.print_report(pf[0],"WARNING opportunity for simple_open, see also structure on line %s"%(ps[0].line))