{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/494","repository_url":"https://api.github.com/repos/zfsonlinux/zfs","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/494/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/494/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/494/events","html_url":"https://github.com/zfsonlinux/zfs/issues/494","id":2555322,"number":494,"title":"ZFS Crypto support","user":{"login":"FransUrbo","id":572706,"avatar_url":"https://avatars.githubusercontent.com/u/572706?v=3","gravatar_id":"","url":"https://api.github.com/users/FransUrbo","html_url":"https://github.com/FransUrbo","followers_url":"https://api.github.com/users/FransUrbo/followers","following_url":"https://api.github.com/users/FransUrbo/following{/other_user}","gists_url":"https://api.github.com/users/FransUrbo/gists{/gist_id}","starred_url":"https://api.github.com/users/FransUrbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FransUrbo/subscriptions","organizations_url":"https://api.github.com/users/FransUrbo/orgs","repos_url":"https://api.github.com/users/FransUrbo/repos","events_url":"https://api.github.com/users/FransUrbo/events{/privacy}","received_events_url":"https://api.github.com/users/FransUrbo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zfsonlinux/zfs/labels/Difficulty%20-%20Hard","name":"Difficulty - Hard","color":"207de5"},{"url":"https://api.github.com/repos/zfsonlinux/zfs/labels/Feature","name":"Feature","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":129,"created_at":"2011-12-14T17:36:57Z","updated_at":"2016-02-26T02:43:46Z","closed_at":null,"body":"As of ZFS Pool Version 30, there is support for encryption. This part is unfortunatly closed source, so an opensource implementation would be required. That means it would probably not be compatible with the Solaris version 'but who cares' :).\r\n\r\nIllumos is apparently working on this at https://www.illumos.org/projects/zfs-crypto. Source repository can be found at https://bitbucket.org/buffyg/illumos-zfs-crypto. Unfortunatly there is no changes since the fork from illumos-gate. Should ZoL start thinking about this or should we just take the back seat?\r\n\r\nDon't know how big of a problem this would be, but 'copying' the way that LUKS (Linux Unified Key Setup) do it seems to be a good place to start."},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/189085849","html_url":"https://github.com/zfsonlinux/zfs/issues/494#issuecomment-189085849","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/494","id":189085849,"user":{"login":"lundman","id":637168,"avatar_url":"https://avatars.githubusercontent.com/u/637168?v=3","gravatar_id":"","url":"https://api.github.com/users/lundman","html_url":"https://github.com/lundman","followers_url":"https://api.github.com/users/lundman/followers","following_url":"https://api.github.com/users/lundman/following{/other_user}","gists_url":"https://api.github.com/users/lundman/gists{/gist_id}","starred_url":"https://api.github.com/users/lundman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lundman/subscriptions","organizations_url":"https://api.github.com/users/lundman/orgs","repos_url":"https://api.github.com/users/lundman/repos","events_url":"https://api.github.com/users/lundman/events{/privacy}","received_events_url":"https://api.github.com/users/lundman/received_events","type":"User","site_admin":false},"created_at":"2016-02-26T02:43:46Z","updated_at":"2016-02-26T02:43:46Z","body":"Ah I'd forgotten how it sucks to work with uio on linux as you have to do everything yourself. We could just have separate repos, like we already do for uio code in `zfs_vnops.c`.\r\n\r\nBut it could be tempting to create new standard ZFS macros for uio work, something I thought about doing for ZFS too, but doubt upstream would be bothered with it.\r\n\r\nThe function `crypto_uio_data()` would essentially just become two calls, `uio_update()` and `uio_move()`. \r\n\r\nThoughts?\r\n\r\n```\r\n#ifdef LINUX\r\n#define ZUIO_ISSYSSPACE(U) ((U)->uio_segflg == UIO_SYSSPACE)\r\n#define ZUIO_ISUSERSPACE(U) ((U)->uio_segflg != UIO_SYSSPACE)\r\n#endif\r\n#ifdef __APPLE__\r\n#define ZUIO_ISUSERSPACE(U) uio_isuserspace((U))\r\n#define ZUIO_ISSYSSPACE(U) !uio_isuserspace((U))\r\n#endif\r\n#ifdef sun\r\n#define ZUIO_ISSYSSPACE(U) ((U)->uio_segflg == UIO_SYSSPACE)\r\n#define ZUIO_ISUSERSPACE(U) ((U)->uio_segflg != UIO_SYSSPACE)\r\n#endif\r\n\r\n\tif (ZUIO_ISUSERSPACE(uiop)) {\r\n\t\treturn (CRYPTO_ARGUMENTS_BAD);\r\n\t}\r\n\r\n```\r\n"}}