Julia Lawall
32d462a5c3
octeon_ep: use vmalloc_array and vcalloc
...
Use vmalloc_array and vcalloc to protect against
multiplication overflows.
The changes were done using the following Coccinelle
semantic patch:
// <smpl>
@initialize:ocaml@
@@
let rename alloc =
match alloc with
"vmalloc" -> "vmalloc_array"
| "vzalloc" -> "vcalloc"
| _ -> failwith "unknown"
@@
size_t e1,e2;
constant C1, C2;
expression E1, E2, COUNT, x1, x2, x3;
typedef u8;
typedef __u8;
type t = {u8,__u8,char,unsigned char};
identifier alloc = {vmalloc,vzalloc};
fresh identifier realloc = script:ocaml(alloc) { rename alloc };
@@
(
alloc(x1*x2*x3)
|
alloc(C1 * C2)
|
alloc((sizeof(t)) * (COUNT), ...)
|
- alloc((e1) * (e2))
+ realloc(e1, e2)
|
- alloc((e1) * (COUNT))
+ realloc(COUNT, e1)
|
- alloc((E1) * (E2))
+ realloc(E1, E2)
)
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20230627144339.144478-3-Julia.Lawall@inria.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-27 09:30:23 -07:00
..
2023-06-15 09:01:05 +01:00
2023-06-22 09:44:30 +02:00
2023-06-22 19:51:42 -07:00
2023-06-27 09:30:23 -07:00
2023-06-07 09:46:49 +01:00
2023-06-24 15:41:46 -07:00
2023-06-01 13:29:18 +02:00
2023-06-15 22:19:41 -07:00
2023-06-13 20:46:20 -07:00
2023-06-12 10:56:01 +01:00
2023-06-22 19:41:01 -07:00
2023-06-24 15:05:40 -07:00
2023-06-06 13:28:30 +02:00
2023-05-19 22:46:37 -07:00
2023-06-15 22:19:41 -07:00
2023-05-13 19:47:56 +01:00
2023-05-13 17:02:33 +01:00
2023-06-15 08:55:22 +01:00
2023-06-10 00:11:41 -07:00
2023-06-22 20:09:13 -07:00
2023-06-22 18:40:38 -07:00
2023-05-13 19:47:56 +01:00
2023-05-10 09:57:39 +01:00
2023-06-15 11:41:01 +01:00
2023-06-10 00:11:41 -07:00
2023-05-17 09:02:55 +01:00
2023-05-10 09:57:39 +01:00
2023-06-08 11:35:14 -07:00