From: Ahsan Atta
Remove redundant nrbg rings.
Signed-off-by: Ahsan Atta
Signed-off-by: Tadeusz Struk
---
drivers/crypto/qat/qat_common/adf_cfg_strings.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/crypto/qat/qat_common/adf_cfg_strings.h
b/drivers/crypto/qat/qat_common/adf_cf
FW requires the const_tab to be 1024 bytes aligned.
Signed-off-by: Tadeusz Struk
---
drivers/crypto/qat/qat_common/adf_admin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/qat/qat_common/adf_admin.c
b/drivers/crypto/qat/qat_common/adf_admin.c
index eb557f6.
Le 22/03/2016 17:04, LABBE Corentin a écrit :
> The current sun4i-ss driver is subject to data corruption when
> ciphering/deciphering.
> It occurs randomly on end of handled data.
> No root cause have been found and the only way to remove it is to replace
> all spin_lock_bh by they irq counterpart
The current sun4i-ss driver is subject to data corruption when
ciphering/deciphering.
It occurs randomly on end of handled data.
No root cause have been found and the only way to remove it is to replace
all spin_lock_bh by they irq counterparts.
Signed-off-by: LABBE Corentin
Cc: stable
---
driv
On 03/22/2016 12:06 AM, Nicolai Stange wrote:
> Ugh. I'll send a v3 fixing this up during the course of the day. Or do
> you prefer to apply your incremental patch below to this v2 as it
> stands?
Either way is fine with me.
Thanks,
--
TS
--
To unsubscribe from this list: send the line "unsubscri
Within the copying loop in mpi_read_raw_from_sgl(), the last input SGE's
byte count gets artificially extended as follows:
if (sg_is_last(sg) && (len % BYTES_PER_MPI_LIMB))
len += BYTES_PER_MPI_LIMB - (len % BYTES_PER_MPI_LIMB);
Within the following byte copying loop, this causes reads beyo
Within the byte reading loop in mpi_read_raw_sgl(), there are two
housekeeping indices used, z and x.
At all times, the index z represents the number of output bytes covered
by the input SGEs for which processing has completed so far. This includes
any leading zero bytes within the most significan
The number of bits, nbits, is calculated in mpi_read_raw_from_sgl() as
follows:
nbits = nbytes * 8;
Afterwards, the number of leading zero bits of the first byte get
subtracted:
nbits -= count_leading_zeros(*(u8 *)(sg_virt(sgl) + lzeros));
However, count_leading_zeros() takes an unsigned lo
Currently, the endian conversion from CPU order to BE is open coded in
mpi_write_sgl().
Replace this by the centrally provided cpu_to_be*() macros.
Signed-off-by: Nicolai Stange
---
lib/mpi/mpicoder.c | 27 +++
1 file changed, 11 insertions(+), 16 deletions(-)
diff --gi
Currently, the nbytes local variable is calculated from the len argument
as follows:
... mpi_read_raw_from_sgl(..., unsigned int len)
{
unsigned nbytes;
...
if (!ents)
nbytes = 0;
else
nbytes = len - lzeros;
...
}
Given that nbytes is derived from len in a tr
Currently, mpi_read_buffer() writes full limbs to the output buffer
and moves memory around to purge leading zero limbs afterwards.
However, with
commit 9cbe21d8f89d ("lib/mpi: only require buffers as big as needed for
the integer")
the caller is only required to provid
In mpi_read_raw_from_sgl(), unsigned nbits is calculated as follows:
nbits = nbytes * 8;
and redundantly cleared later on if nbytes == 0:
if (nbytes > 0)
...
else
nbits = 0;
Purge this redundant clearing for the sake of clarity.
Signed-off-by: Nicolai Stange
---
lib/mpi/mpicode
At the very beginning of mpi_read_raw_from_sgl(), the leading zeros of
the input scatterlist are counted:
lzeros = 0;
for_each_sg(sgl, sg, ents, i) {
...
if (/* sg contains nonzero bytes */)
break;
/* sg contains nothing but zeros here */
ents--;
lzeros = 0;
}
Lat
Currently, the endian conversion from CPU order to BE is open coded in
mpi_read_buffer().
Replace this by the centrally provided cpu_to_be*() macros.
Copy from the temporary storage on stack to the destination buffer
by means of memcpy().
Signed-off-by: Nicolai Stange
---
lib/mpi/mpicoder.c | 2
Currently, if the number of leading zeros is greater than fits into a
complete limb, mpi_read_buffer() skips them by iterating over them
limb-wise.
Instead of skipping the high order zero limbs within the loop as shown
above, adjust the copying loop's bounds.
Signed-off-by: Nicolai Stange
---
l
Within the copying loop in mpi_write_sgl(), we have
if (lzeros) {
mpi_limb_t *limb1 = (void *)p - sizeof(alimb);
mpi_limb_t *limb2 = (void *)p - sizeof(alimb)
+ lzeros;
*limb1 = *limb2;
...
}
where p points past the end of alimb2 which lives on t
Within the copying loop in mpi_write_sgl(), we have
if (lzeros) {
...
p -= lzeros;
y = lzeros;
}
p = p - (sizeof(alimb) - y);
If lzeros == 0, then y == 0, too. Thus, lzeros gets subtracted and added
back again to p.
Purge this redundancy.
Signed-off-by: Nicolai Stange
---
li
Within the copying loop in mpi_write_sgl(), we have
if (lzeros > 0) {
...
lzeros -= sizeof(alimb);
}
However, at this point, lzeros < sizeof(alimb) holds. Make this fact
explicit by rewriting the above to
if (lzeros) {
...
lzeros = 0;
}
Signed-off-by: Nicolai Stange
---
Currently, if the number of leading zeros is greater than fits into a
complete limb, mpi_write_sgl() skips them by iterating over them limb-wise.
However, it fails to adjust its internal leading zeros tracking variable,
lzeros, accordingly: it does a
p -= sizeof(alimb);
continue;
which shoul
that is [1-7,9-14/14], go unchanged and have got a
Tested-by: Tadeusz Struk
already.
Applicable to linux-next-20160322.
Changes to v2:
- [8/14] ("lib/mpi: mpi_read_buffer(): fix buffer overflow")
+ Fix the pointer arithmetic issue found by Tadeusz Struk
Changes to v1:
- [
On Tue, Mar 15, 2016 at 01:28:01PM +0100, Steffen Klassert wrote:
> On Mon, Mar 14, 2016 at 09:52:05PM +, Mark McKinstry wrote:
> > Your patch adds a dst_release() call to my suggested fix, but this is
> > problematic because the kfree_skb() call at tx_error already takes care
> > of releasin
Hi Tadeusz,
thank you very much for your quick reply!
Tadeusz Struk writes:
> On 03/21/2016 06:26 AM, Nicolai Stange wrote:
>> This is a resend of v2 with the crypto people properly CC'd.
>>
>> The original v1 can be found here:
>>
>>
>> http://lkml.kernel.org/g/1458237606-4954-1-git-send-
22 matches
Mail list logo