[ SYSTEM ]: Linux srv.persadacompanies.com 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
[ SERVER ]: Apache | PHP: 8.4.19
[ USER ]: persadamedika | IP: 45.64.1.108
GEFORCE FILE MANAGER
/
usr
/
src
/
kernels
/
4.18.0-553.56.1.el8_10.x86_64
/
scripts
/
coccinelle
/
api
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📁 alloc
SET
[ DEL ]
📁 debugfs
SET
[ DEL ]
📄 check_bq27xxx_data.cocci
3,504 B
SET
[ EDIT ]
|
[ DEL ]
📄 d_find_alias.cocci
1,309 B
SET
[ EDIT ]
|
[ DEL ]
📄 drm-get-put.cocci
1,532 B
SET
[ EDIT ]
|
[ DEL ]
📄 err_cast.cocci
1,097 B
SET
[ EDIT ]
|
[ DEL ]
📄 kstrdup.cocci
2,461 B
SET
[ EDIT ]
|
[ DEL ]
📄 memdup.cocci
1,350 B
SET
[ EDIT ]
|
[ DEL ]
📄 memdup_user.cocci
1,306 B
SET
[ EDIT ]
|
[ DEL ]
📄 platform_no_drv_owner.cocci
3,869 B
SET
[ EDIT ]
|
[ DEL ]
📄 pm_runtime.cocci
2,394 B
SET
[ EDIT ]
|
[ DEL ]
📄 ptr_ret.cocci
1,814 B
SET
[ EDIT ]
|
[ DEL ]
📄 resource_size.cocci
2,115 B
SET
[ EDIT ]
|
[ DEL ]
📄 simple_open.cocci
1,244 B
SET
[ EDIT ]
|
[ DEL ]
📄 vma_pages.cocci
1,519 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: memdup_user.cocci
/// Use memdup_user rather than duplicating its implementation /// This is a little bit restricted to reduce false positives /// // Confidence: High // Copyright: (C) 2010-2012 Nicolas Palix. GPLv2. // Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2. // Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2. // URL: http://coccinelle.lip6.fr/ // Comments: // Options: --no-includes --include-headers virtual patch virtual context virtual org virtual report @depends on patch@ expression from,to,size; identifier l1,l2; @@ - to = \(kmalloc\|kzalloc\)(size,GFP_KERNEL); + to = memdup_user(from,size); if ( - to==NULL + IS_ERR(to) || ...) { <+... when != goto l1; - -ENOMEM + PTR_ERR(to) ...+> } - if (copy_from_user(to, from, size) != 0) { - <+... when != goto l2; - -EFAULT - ...+> - } @r depends on !patch@ expression from,to,size; position p; statement S1,S2; @@ * to = \(kmalloc@p\|kzalloc@p\)(size,GFP_KERNEL); if (to==NULL || ...) S1 if (copy_from_user(to, from, size) != 0) S2 @script:python depends on org@ p << r.p; @@ coccilib.org.print_todo(p[0], "WARNING opportunity for memdup_user") @script:python depends on report@ p << r.p; @@ coccilib.report.print_report(p[0], "WARNING opportunity for memdup_user")