[Ocf-linux-users] Cryptosoft problem...
Brought to you by:
david-m
From: Schuurman, H. <he...@ti...> - 2012-01-25 18:37:14
|
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(). Best regards, Herman Schuurman |