Messages in this thread | | | From | David Howells <> | Subject | Re: [syzbot] [mm?] WARNING in try_grab_page | Date | Wed, 26 Jul 2023 09:25:24 +0100 |
| |
Sven Schnelle <svens@linux.ibm.com> wrote:
> However, hash_sendmsg() also unpins via af_alg_free_sg() in the error > path. From an API perspective, i would prefer if extract_user_to_sg() > does the unpinning on error. Any thoughts?
In the event of an error, extract_user_to_sg() unpins only the pages it added to the scatterlist; it doesn't unpin any pages that were already there and doesn't free the scatterlist; it also decrements sgtable->nents so that the caller doesn't see the pages it attempted to add, so calling af_alg_free_sg() shouldn't hurt.
Note that the error path also frees the result, so we do need to do at least part of it.
David
| |