|
2022-10-07
| ||
| 11:20 | • Ticket [1599352cca] Tcl_Merge(): out-of-bounds write, more signed integer overfl... artifact: 19856075b2 user: jan.nijtmans | |
| 10:18 | Follow-up to [1599352cca]: Tcl_Merge(): out-of-bounds write, more signed integer overflow. Better pa... check-in: 63b0443866 user: jan.nijtmans tags: core-8-6-branch | |
|
2022-10-06
| ||
| 20:17 | • Ticket [1599352cca] Tcl_Merge(): out-of-bounds write, more signed integer overfl... artifact: e7689f573f user: chrstphrchvz | |
| 20:06 | • Ticket [1599352cca]: 5 changes artifact: 6fd5b1699d user: chrstphrchvz | |
| 10:23 | • Closed ticket [1599352cca]. artifact: 9dfc7dd265 user: jan.nijtmans | |
| 09:06 | Fix [e32a44e2e4], [1599352cca], [5ec43cfd9b] and [74cc95b563] check-in: 0e2b23ff84 user: jan.nijtmans tags: core-8-6-branch | |
|
2022-10-05
| ||
| 15:31 | Fix [1599352cca] and related issues closed check-in: 337d46bdb8 user: jan.nijtmans tags: bug-1599352cca | |
|
2022-10-02
| ||
| 14:06 | • Add attachment 1599352cca83.diff to ticket [1599352cca83527b|1599352cca... artifact: baf3c5a6bb user: chrstphrchvz | |
| 14:04 | • New ticket [1599352cca] Tcl_Merge(): out-of-bounds write, more signed integer ov... artifact: f65dc39c7e user: chrstphrchvz | |
Tcl_Merge(): out-of-bounds write, more signed integer overflow
- When argc is negative, there is signed integer overflow in the expression INT_MAX - argc + 1.
(Assuming 32-bit int.) If argc == INT_MIN, the current behavior is to allocate a 2GiB buffer and then write '\0' to the byte prior to the beginning of buffer. Otherwise, if INT_MIN < argc && argc < 0, then the function panics, claiming max size for a Tcl value (2147483647 bytes) exceeded.
At a minimum, I would suggest changing the behavior of the function slightly so that it always panics to prevent the out-of-bounds write; panicking is already possible in that case during the ckalloc(INT_MIN) call. Maybe a more helpful panic message can be used. See attached patch for a possible solution.
63b0443866Follow-up to [1599352cca]: Tcl_Merge(): out-of-bounds write, more signed integer overflow. Better panic message when argc < 0. check-in2022-10-07 10:18:330e2b23ff84Fix [e32a44e2e4], [1599352cca], [5ec43cfd9b] and [74cc95b563] check-in2022-10-06 09:06:07337d46bdb8Fix [1599352cca] and related issues check-in2022-10-05 15:31:31
Should be fixed [here]
[0e2b23ff845b] does fix quite a few issues, including some I had suspected or had not yet reported.
However there is still the issue of argc == INT_MAX leading to an out-of-bounds write. Is this won't-fix for Tcl < 9.0?
I meant argc == INT_MIN in the previous comment.
Should be better now: [63b0443866958521]
Attachments:
- 1599352cca83.diff [download] added by chrstphrchvz on 2022-10-02 14:06:20. [details]