{"action":"created","issue":{"url":"https://api.github.com/repos/awslabs/s2n/issues/110","labels_url":"https://api.github.com/repos/awslabs/s2n/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/awslabs/s2n/issues/110/comments","events_url":"https://api.github.com/repos/awslabs/s2n/issues/110/events","html_url":"https://github.com/awslabs/s2n/issues/110","id":92450828,"number":110,"title":"madvise needs to page-alligned memory pointer","user":{"login":"user-none","id":10814,"avatar_url":"https://avatars.githubusercontent.com/u/10814?v=3","gravatar_id":"","url":"https://api.github.com/users/user-none","html_url":"https://github.com/user-none","followers_url":"https://api.github.com/users/user-none/followers","following_url":"https://api.github.com/users/user-none/following{/other_user}","gists_url":"https://api.github.com/users/user-none/gists{/gist_id}","starred_url":"https://api.github.com/users/user-none/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/user-none/subscriptions","organizations_url":"https://api.github.com/users/user-none/orgs","repos_url":"https://api.github.com/users/user-none/repos","events_url":"https://api.github.com/users/user-none/events{/privacy}","received_events_url":"https://api.github.com/users/user-none/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-01T18:13:40Z","updated_at":"2015-07-01T19:49:04Z","closed_at":null,"body":"According to the man page (http://man7.org/linux/man-pages/man2/madvise.2.html) for madvise under \"Linux notes\"\r\n\r\n> The Linux implementation requires that the address addr be page-aligned...\r\n\r\nIn utils/s2n_mem.c madvise is called:\r\n\r\n    madvise(b->data, size, MADV_DONTDUMP)\r\n\r\n(b->)data is created using realloc, witch does not guarantee page alignment. \r\n\r\nFurther the man page says the following errno will be returned in the following situation:\r\n\r\n> EINVAL addr is _not page-aligned_ or length is negative.\r\n\r\nThe current implementation can fail on Linux."},"comment":{"url":"https://api.github.com/repos/awslabs/s2n/issues/comments/117805536","html_url":"https://github.com/awslabs/s2n/issues/110#issuecomment-117805536","issue_url":"https://api.github.com/repos/awslabs/s2n/issues/110","id":117805536,"user":{"login":"baldwinmatt","id":10620513,"avatar_url":"https://avatars.githubusercontent.com/u/10620513?v=3","gravatar_id":"","url":"https://api.github.com/users/baldwinmatt","html_url":"https://github.com/baldwinmatt","followers_url":"https://api.github.com/users/baldwinmatt/followers","following_url":"https://api.github.com/users/baldwinmatt/following{/other_user}","gists_url":"https://api.github.com/users/baldwinmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/baldwinmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldwinmatt/subscriptions","organizations_url":"https://api.github.com/users/baldwinmatt/orgs","repos_url":"https://api.github.com/users/baldwinmatt/repos","events_url":"https://api.github.com/users/baldwinmatt/events{/privacy}","received_events_url":"https://api.github.com/users/baldwinmatt/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T19:49:04Z","updated_at":"2015-07-01T19:49:04Z","body":"Thanks for the report.  regarding MADV_DONTDUMP:\r\n\r\nMADV_DONTDUMP (since Linux 3.4)\r\n              Exclude from a core dump those pages in the range specified by\r\n              addr and length.  This is useful in applications that have\r\n              large areas of memory that are known not to be useful in a\r\n              core dump.  The effect of MADV_DONTDUMP takes precedence over\r\n              the bit mask that is set via the /proc/PID/coredump_filter\r\n              file (see core(5))."}}