Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
"This fixes a boot failure on some platforms when crypto self test is
enabled along with the new acomp interface"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: testmgr - Use heap buffer for acomp test input

+28 -2
+28 -2
crypto/testmgr.c
··· 1461 1461 for (i = 0; i < ctcount; i++) { 1462 1462 unsigned int dlen = COMP_BUF_SIZE; 1463 1463 int ilen = ctemplate[i].inlen; 1464 + void *input_vec; 1464 1465 1466 + input_vec = kmalloc(ilen, GFP_KERNEL); 1467 + if (!input_vec) { 1468 + ret = -ENOMEM; 1469 + goto out; 1470 + } 1471 + 1472 + memcpy(input_vec, ctemplate[i].input, ilen); 1465 1473 memset(output, 0, dlen); 1466 1474 init_completion(&result.completion); 1467 - sg_init_one(&src, ctemplate[i].input, ilen); 1475 + sg_init_one(&src, input_vec, ilen); 1468 1476 sg_init_one(&dst, output, dlen); 1469 1477 1470 1478 req = acomp_request_alloc(tfm); 1471 1479 if (!req) { 1472 1480 pr_err("alg: acomp: request alloc failed for %s\n", 1473 1481 algo); 1482 + kfree(input_vec); 1474 1483 ret = -ENOMEM; 1475 1484 goto out; 1476 1485 } ··· 1492 1483 if (ret) { 1493 1484 pr_err("alg: acomp: compression failed on test %d for %s: ret=%d\n", 1494 1485 i + 1, algo, -ret); 1486 + kfree(input_vec); 1495 1487 acomp_request_free(req); 1496 1488 goto out; 1497 1489 } ··· 1501 1491 pr_err("alg: acomp: Compression test %d failed for %s: output len = %d\n", 1502 1492 i + 1, algo, req->dlen); 1503 1493 ret = -EINVAL; 1494 + kfree(input_vec); 1504 1495 acomp_request_free(req); 1505 1496 goto out; 1506 1497 } ··· 1511 1500 i + 1, algo); 1512 1501 hexdump(output, req->dlen); 1513 1502 ret = -EINVAL; 1503 + kfree(input_vec); 1514 1504 acomp_request_free(req); 1515 1505 goto out; 1516 1506 } 1517 1507 1508 + kfree(input_vec); 1518 1509 acomp_request_free(req); 1519 1510 } 1520 1511 1521 1512 for (i = 0; i < dtcount; i++) { 1522 1513 unsigned int dlen = COMP_BUF_SIZE; 1523 1514 int ilen = dtemplate[i].inlen; 1515 + void *input_vec; 1524 1516 1517 + input_vec = kmalloc(ilen, GFP_KERNEL); 1518 + if (!input_vec) { 1519 + ret = -ENOMEM; 1520 + goto out; 1521 + } 1522 + 1523 + memcpy(input_vec, dtemplate[i].input, ilen); 1525 1524 memset(output, 0, dlen); 1526 1525 init_completion(&result.completion); 1527 - sg_init_one(&src, dtemplate[i].input, ilen); 1526 + sg_init_one(&src, input_vec, ilen); 1528 1527 sg_init_one(&dst, output, dlen); 1529 1528 1530 1529 req = acomp_request_alloc(tfm); 1531 1530 if (!req) { 1532 1531 pr_err("alg: acomp: request alloc failed for %s\n", 1533 1532 algo); 1533 + kfree(input_vec); 1534 1534 ret = -ENOMEM; 1535 1535 goto out; 1536 1536 } ··· 1554 1532 if (ret) { 1555 1533 pr_err("alg: acomp: decompression failed on test %d for %s: ret=%d\n", 1556 1534 i + 1, algo, -ret); 1535 + kfree(input_vec); 1557 1536 acomp_request_free(req); 1558 1537 goto out; 1559 1538 } ··· 1563 1540 pr_err("alg: acomp: Decompression test %d failed for %s: output len = %d\n", 1564 1541 i + 1, algo, req->dlen); 1565 1542 ret = -EINVAL; 1543 + kfree(input_vec); 1566 1544 acomp_request_free(req); 1567 1545 goto out; 1568 1546 } ··· 1573 1549 i + 1, algo); 1574 1550 hexdump(output, req->dlen); 1575 1551 ret = -EINVAL; 1552 + kfree(input_vec); 1576 1553 acomp_request_free(req); 1577 1554 goto out; 1578 1555 } 1579 1556 1557 + kfree(input_vec); 1580 1558 acomp_request_free(req); 1581 1559 } 1582 1560