Commit 0801c13
ksmbd: Annotate struct copychunk_ioctl_req with __counted_by_le()
Add the __counted_by_le compiler attribute to the flexible array member
Chunks to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Change the data type of the flexible array member Chunks from __u8[] to
struct srv_copychunk[] for ChunkCount to match the number of elements in
the Chunks array. (With __u8[], each srv_copychunk would occupy 24 array
entries and the __counted_by compiler attribute wouldn't be applicable.)
Use struct_size() to calculate the size of the copychunk_ioctl_req.
Read Chunks[0] after checking that ChunkCount is not 0.
Signed-off-by: Thorsten Blum <[email protected]>
Acked-by: Namjae Jeon <[email protected]>
Signed-off-by: Steve French <[email protected]>1 parent 04afb0a commit 0801c13
2 files changed
+9
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7562 | 7562 | | |
7563 | 7563 | | |
7564 | 7564 | | |
7565 | | - | |
7566 | 7565 | | |
7567 | 7566 | | |
7568 | 7567 | | |
7569 | 7568 | | |
7570 | 7569 | | |
7571 | 7570 | | |
7572 | 7571 | | |
7573 | | - | |
7574 | | - | |
| 7572 | + | |
7575 | 7573 | | |
7576 | 7574 | | |
7577 | 7575 | | |
7578 | 7576 | | |
| 7577 | + | |
7579 | 7578 | | |
7580 | 7579 | | |
7581 | 7580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | 193 | | |
201 | 194 | | |
202 | 195 | | |
203 | 196 | | |
204 | 197 | | |
205 | 198 | | |
206 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
0 commit comments