Re: [Ocf-linux-users] Cryptosoft problem...
Brought to you by:
david-m
|
From: David M. <dav...@mc...> - 2012-01-26 22:52:04
|
Jivin Schuurman, Herman lays it down ...
> Hi David,
>
> It looks like the OCF cryptosoft driver is not terminating scatterlists correctly. The problem shows up if a crypto API hardware driver relies on sg_next() to return NULL at the end of a scatterlist chain, eventually leading to a bad pointer reference if the end is not marked correctly.
>
> The following change to crypto/ocf/cryptosoft.c looks like it resolves the problem:
>
> *** crypto/ocf/cryptosoft.c 2011-11-18 16:00:50.399693999 -0600
> --- crypto/ocf/cryptosoft.c 2012-01-25 11:45:48.637623644 -0600
> ***************
> *** 814,819 ****
> --- 814,820 ----
> sg_len, offset_in_page(crp->crp_buf + skip));
> sg_num = 1;
> }
> + sg_mark_end(&req->sg[sg_num-1]);
>
> switch (sw->sw_type & SW_TYPE_ALG_AMASK) {
>
> This marks the last sg entry written with sg_mark_end().
I think you are right, beats me how this survived for so long.
I'll get this incorporated and look for other users,
Thanks,
Davidm
--
David McCullough, dav...@mc..., Ph:+61 734352815
McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org
|