Re: general protection fault in af_alg_free_areq_sgls

From: Eric Biggers
Date: Tue Nov 28 2017 - 04:03:04 EST


On Mon, Nov 27, 2017 at 10:56:47AM -0800, syzbot wrote:
> Hello,
>
> syzkaller hit the following crash on
> b0a84f19a5161418d4360cd57603e94ed489915e
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master
> compiler: gcc (GCC) 7.1.1 20170620
> .config is attached
> Raw console output is attached.
>
> Unfortunately, I don't have any reproducer for this bug yet.
>

This was probably caused by taking the path where areq->tsgl could not be
allocated. (syzkaller probably reached it after injecting a memory allocation
failure.) The following should fix it:

---8<---