{"action":"opened","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51649","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51649/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51649/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51649/events","html_url":"https://github.com/NixOS/nixpkgs/issues/51649","id":388519224,"node_id":"MDU6SXNzdWUzODg1MTkyMjQ=","number":51649,"title":"noOverflow: An effort to fight integer overflow for security and correctness","user":{"login":"nh2","id":399535,"node_id":"MDQ6VXNlcjM5OTUzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/399535?v=4","gravatar_id":"","url":"https://api.github.com/users/nh2","html_url":"https://github.com/nh2","followers_url":"https://api.github.com/users/nh2/followers","following_url":"https://api.github.com/users/nh2/following{/other_user}","gists_url":"https://api.github.com/users/nh2/gists{/gist_id}","starred_url":"https://api.github.com/users/nh2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nh2/subscriptions","organizations_url":"https://api.github.com/users/nh2/orgs","repos_url":"https://api.github.com/users/nh2/repos","events_url":"https://api.github.com/users/nh2/events{/privacy}","received_events_url":"https://api.github.com/users/nh2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-07T06:11:19Z","updated_at":"2018-12-07T06:11:19Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"This is an overflow issue coordinating and summarising multiple activities.\r\n\r\n## Goal\r\n\r\nTo build a hardened nixpkgs overlay in which integer overflow is forbidden and fails loudly.\r\n\r\nFix as many packages as possible and submit as many fixes upstream as possible.\r\n\r\n## Rationale\r\n\r\nAccidental integer overflow has been a security and correctness nightmare for ages, and is becoming ever more frequent.\r\n\r\nIf we continue like this, humanity isn't going to make it far. :rocket: :boom: \r\n\r\nNew programming languages like Rust already improve a lot on this by making all non-explicit integer overflows hard errors -- at least during developer (non-release) builds and runs.\r\n\r\nBut this is not enough: Even modern programming languages rely on many existing, older libraries (written e.g. in C) and some very modern and otherwise safe programming languages default to programmers throwing around non-explicit integer conversion constructs (like Haskell's `fromIntegral`, which has caused many bugs).\r\n\r\nWe strive to find and fix non-explicit overflow and make the results available.\r\n\r\nWe hope that nixpkgs' advanced tooling, programmable package set, and ease-of-community-contribution will make this feasible.\r\n\r\n## People interested\r\n\r\n@nh2 @dtzWill \r\n\r\nAdd yourself here or ping to be added, or subscribe.\r\n\r\n## Useful terms\r\n\r\n* **narrowing:** converting a numeric type into one that has smaller domain (not all values fit into the target type), like `64-bit int -> 32-bit int`\r\n\r\n# Items\r\n\r\nBuild an overlay to provide:\r\n\r\n* Compilers overridden to emit as many overflow-related warnings as possible\r\n  * [ ] gcc\r\n  * [ ] clang\r\n* C\r\n  * [ ] Add compiler flags (or write compiler patch) that turn integer overflow into runtime panic\r\n  * [ ] Build and test as much of nixpkgs as possible with it, add patches or exceptions on the way\r\n* Haskell\r\n  * [ ] Ensure that integer primops that error out on overflow, and those that explicitly allow it, are implemented\r\n  * [ ] Write GHC option or patch that enables them\r\n  * [ ] Build and test as much of `haskellPackages` (or the Stackage subset) as possible with it, add patches or exceptions on the way\r\n* Rust\r\n  * [ ] Enable overflow checking also in release mode\r\n\r\nThis list will get updated as progress is made.\r\n\r\nYou can add items here or ask for them to be added in the discussion below."}}
{"actor":{"display_login":"nh2"}}