[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202006120100.vAwRFHVk%lkp@intel.com>
Date: Fri, 12 Jun 2020 01:43:03 +0800
From: kernel test robot <lkp@...el.com>
To: Harald Freudenberger <freude@...ux.ibm.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Vasily Gorbik <gor@...ux.ibm.com>
Subject: drivers/s390/crypto/pkey_api.c:1606 pkey_ccacipher_aes_attr_read()
warn: inconsistent indenting
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b29482fde649c72441d5478a4ea2c52c56d97a5e
commit: 55d0a513a0e202c68af2c8f4b1e923a345227bbb s390/pkey/zcrypt: Support EP11 AES secure keys
date: 4 months ago
config: s390-randconfig-m031-20200611 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
smatch warnings:
drivers/s390/crypto/pkey_api.c:1606 pkey_ccacipher_aes_attr_read() warn: inconsistent indenting
vim +1606 drivers/s390/crypto/pkey_api.c
f71fee2711a788 Ingo Franzki 2019-08-20 1569
f71fee2711a788 Ingo Franzki 2019-08-20 1570 /*
f71fee2711a788 Ingo Franzki 2019-08-20 1571 * Sysfs attribute read function for all secure key ccacipher binary attributes.
f71fee2711a788 Ingo Franzki 2019-08-20 1572 * The implementation can not deal with partial reads, because a new random
f71fee2711a788 Ingo Franzki 2019-08-20 1573 * secure key blob is generated with each read. In case of partial reads
f71fee2711a788 Ingo Franzki 2019-08-20 1574 * (i.e. off != 0 or count < key blob size) -EINVAL is returned.
f71fee2711a788 Ingo Franzki 2019-08-20 1575 */
f71fee2711a788 Ingo Franzki 2019-08-20 1576 static ssize_t pkey_ccacipher_aes_attr_read(enum pkey_key_size keybits,
f71fee2711a788 Ingo Franzki 2019-08-20 1577 bool is_xts, char *buf, loff_t off,
f71fee2711a788 Ingo Franzki 2019-08-20 1578 size_t count)
f71fee2711a788 Ingo Franzki 2019-08-20 1579 {
55d0a513a0e202 Harald Freudenberger 2019-12-06 1580 int i, rc, card, dom;
55d0a513a0e202 Harald Freudenberger 2019-12-06 1581 u32 nr_apqns, *apqns = NULL;
55d0a513a0e202 Harald Freudenberger 2019-12-06 1582 size_t keysize = CCACIPHERTOKENSIZE;
f71fee2711a788 Ingo Franzki 2019-08-20 1583
f71fee2711a788 Ingo Franzki 2019-08-20 1584 if (off != 0 || count < CCACIPHERTOKENSIZE)
f71fee2711a788 Ingo Franzki 2019-08-20 1585 return -EINVAL;
f71fee2711a788 Ingo Franzki 2019-08-20 1586 if (is_xts)
f71fee2711a788 Ingo Franzki 2019-08-20 1587 if (count < 2 * CCACIPHERTOKENSIZE)
f71fee2711a788 Ingo Franzki 2019-08-20 1588 return -EINVAL;
f71fee2711a788 Ingo Franzki 2019-08-20 1589
55d0a513a0e202 Harald Freudenberger 2019-12-06 1590 /* build a list of apqns able to generate an cipher key */
55d0a513a0e202 Harald Freudenberger 2019-12-06 1591 rc = cca_findcard2(&apqns, &nr_apqns, 0xFFFF, 0xFFFF,
55d0a513a0e202 Harald Freudenberger 2019-12-06 1592 ZCRYPT_CEX6, 0, 0, 0);
f71fee2711a788 Ingo Franzki 2019-08-20 1593 if (rc)
f71fee2711a788 Ingo Franzki 2019-08-20 1594 return rc;
f71fee2711a788 Ingo Franzki 2019-08-20 1595
55d0a513a0e202 Harald Freudenberger 2019-12-06 1596 memset(buf, 0, is_xts ? 2 * keysize : keysize);
55d0a513a0e202 Harald Freudenberger 2019-12-06 1597
55d0a513a0e202 Harald Freudenberger 2019-12-06 1598 /* simple try all apqns from the list */
55d0a513a0e202 Harald Freudenberger 2019-12-06 1599 for (i = 0, rc = -ENODEV; i < nr_apqns; i++) {
55d0a513a0e202 Harald Freudenberger 2019-12-06 1600 card = apqns[i] >> 16;
55d0a513a0e202 Harald Freudenberger 2019-12-06 1601 dom = apqns[i] & 0xFFFF;
55d0a513a0e202 Harald Freudenberger 2019-12-06 1602 rc = cca_gencipherkey(card, dom, keybits, 0, buf, &keysize);
55d0a513a0e202 Harald Freudenberger 2019-12-06 1603 if (rc == 0)
55d0a513a0e202 Harald Freudenberger 2019-12-06 1604 break;
55d0a513a0e202 Harald Freudenberger 2019-12-06 1605 }
f71fee2711a788 Ingo Franzki 2019-08-20 @1606 if (rc)
f71fee2711a788 Ingo Franzki 2019-08-20 1607 return rc;
f71fee2711a788 Ingo Franzki 2019-08-20 1608
55d0a513a0e202 Harald Freudenberger 2019-12-06 1609 if (is_xts) {
55d0a513a0e202 Harald Freudenberger 2019-12-06 1610 keysize = CCACIPHERTOKENSIZE;
55d0a513a0e202 Harald Freudenberger 2019-12-06 1611 buf += CCACIPHERTOKENSIZE;
55d0a513a0e202 Harald Freudenberger 2019-12-06 1612 rc = cca_gencipherkey(card, dom, keybits, 0, buf, &keysize);
55d0a513a0e202 Harald Freudenberger 2019-12-06 1613 if (rc == 0)
f71fee2711a788 Ingo Franzki 2019-08-20 1614 return 2 * CCACIPHERTOKENSIZE;
f71fee2711a788 Ingo Franzki 2019-08-20 1615 }
f71fee2711a788 Ingo Franzki 2019-08-20 1616
f71fee2711a788 Ingo Franzki 2019-08-20 1617 return CCACIPHERTOKENSIZE;
f71fee2711a788 Ingo Franzki 2019-08-20 1618 }
f71fee2711a788 Ingo Franzki 2019-08-20 1619
:::::: The code at line 1606 was first introduced by commit
:::::: f71fee2711a788b94ff0acb02fbd2bfe2de7e0a3 s390/pkey: Add sysfs attributes to emit AES CIPHER key blobs
:::::: TO: Ingo Franzki <ifranzki@...ux.ibm.com>
:::::: CC: Vasily Gorbik <gor@...ux.ibm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (22854 bytes)
Powered by blists - more mailing lists