From: kernel test robot <lkp@intel.com>
To: Roberto Sassu <roberto.sassu@huawei.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [robertosassu:ima-evm-lsms-v2-devel-v6 23/25] security/integrity/evm/evm_main.c:930:5: warning: no previous prototype for 'evm_inode_init_security'
Date: Thu, 31 Aug 2023 03:38:39 +0800 [thread overview]
Message-ID: <202308310335.FCDCwTrB-lkp@intel.com> (raw)
tree: https://github.com/robertosassu/linux ima-evm-lsms-v2-devel-v6
head: 8d3db5840032b2f14a363ad273bc13baeaec3cc5
commit: 07adc69271289ead1d641de66c78e118ce1e4672 [23/25] evm: Move to LSM infrastructure
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230831/202308310335.FCDCwTrB-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230831/202308310335.FCDCwTrB-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308310335.FCDCwTrB-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> security/integrity/evm/evm_main.c:930:5: warning: no previous prototype for 'evm_inode_init_security' [-Wmissing-prototypes]
930 | int evm_inode_init_security(struct inode *inode, struct inode *dir,
| ^~~~~~~~~~~~~~~~~~~~~~~
vim +/evm_inode_init_security +930 security/integrity/evm/evm_main.c
66dbc325afcef9 Mimi Zohar 2011-03-15 926
cb72318069d5e9 Mimi Zohar 2011-03-09 927 /*
9eea2904292c2d Roberto Sassu 2021-05-14 928 * evm_inode_init_security - initializes security.evm HMAC value
cb72318069d5e9 Mimi Zohar 2011-03-09 929 */
6db7d1dee80039 Roberto Sassu 2023-06-10 @930 int evm_inode_init_security(struct inode *inode, struct inode *dir,
6db7d1dee80039 Roberto Sassu 2023-06-10 931 const struct qstr *qstr, struct xattr *xattrs,
6db7d1dee80039 Roberto Sassu 2023-06-10 932 int *xattr_count)
cb72318069d5e9 Mimi Zohar 2011-03-09 933 {
650b29dbdf2caf Thiago Jung Bauermann 2019-06-11 934 struct evm_xattr *xattr_data;
c31288e56c1a7b Roberto Sassu 2023-06-10 935 struct xattr *xattr, *evm_xattr;
c31288e56c1a7b Roberto Sassu 2023-06-10 936 bool evm_protected_xattrs = false;
cb72318069d5e9 Mimi Zohar 2011-03-09 937 int rc;
cb72318069d5e9 Mimi Zohar 2011-03-09 938
c31288e56c1a7b Roberto Sassu 2023-06-10 939 if (!(evm_initialized & EVM_INIT_HMAC) || !xattrs)
c31288e56c1a7b Roberto Sassu 2023-06-10 940 return 0;
c31288e56c1a7b Roberto Sassu 2023-06-10 941
c31288e56c1a7b Roberto Sassu 2023-06-10 942 /*
c31288e56c1a7b Roberto Sassu 2023-06-10 943 * security_inode_init_security() makes sure that the xattrs array is
c31288e56c1a7b Roberto Sassu 2023-06-10 944 * contiguous, there is enough space for security.evm, and that there is
c31288e56c1a7b Roberto Sassu 2023-06-10 945 * a terminator at the end of the array.
c31288e56c1a7b Roberto Sassu 2023-06-10 946 */
c31288e56c1a7b Roberto Sassu 2023-06-10 947 for (xattr = xattrs; xattr->name; xattr++) {
c31288e56c1a7b Roberto Sassu 2023-06-10 948 if (evm_protected_xattr(xattr->name))
c31288e56c1a7b Roberto Sassu 2023-06-10 949 evm_protected_xattrs = true;
c31288e56c1a7b Roberto Sassu 2023-06-10 950 }
c31288e56c1a7b Roberto Sassu 2023-06-10 951
c31288e56c1a7b Roberto Sassu 2023-06-10 952 /* EVM xattr not needed. */
c31288e56c1a7b Roberto Sassu 2023-06-10 953 if (!evm_protected_xattrs)
5a4730ba9517cf Mimi Zohar 2011-08-11 954 return 0;
cb72318069d5e9 Mimi Zohar 2011-03-09 955
6db7d1dee80039 Roberto Sassu 2023-06-10 956 evm_xattr = lsm_get_xattr_slot(xattrs, xattr_count);
c31288e56c1a7b Roberto Sassu 2023-06-10 957 /*
c31288e56c1a7b Roberto Sassu 2023-06-10 958 * Array terminator (xattr name = NULL) must be the first non-filled
c31288e56c1a7b Roberto Sassu 2023-06-10 959 * xattr slot.
c31288e56c1a7b Roberto Sassu 2023-06-10 960 */
c31288e56c1a7b Roberto Sassu 2023-06-10 961 WARN_ONCE(evm_xattr != xattr,
c31288e56c1a7b Roberto Sassu 2023-06-10 962 "%s: xattrs terminator is not the first non-filled slot\n",
c31288e56c1a7b Roberto Sassu 2023-06-10 963 __func__);
6db7d1dee80039 Roberto Sassu 2023-06-10 964
cb72318069d5e9 Mimi Zohar 2011-03-09 965 xattr_data = kzalloc(sizeof(*xattr_data), GFP_NOFS);
cb72318069d5e9 Mimi Zohar 2011-03-09 966 if (!xattr_data)
cb72318069d5e9 Mimi Zohar 2011-03-09 967 return -ENOMEM;
cb72318069d5e9 Mimi Zohar 2011-03-09 968
650b29dbdf2caf Thiago Jung Bauermann 2019-06-11 969 xattr_data->data.type = EVM_XATTR_HMAC;
6db7d1dee80039 Roberto Sassu 2023-06-10 970 rc = evm_init_hmac(inode, xattrs, xattr_data->digest);
cb72318069d5e9 Mimi Zohar 2011-03-09 971 if (rc < 0)
cb72318069d5e9 Mimi Zohar 2011-03-09 972 goto out;
cb72318069d5e9 Mimi Zohar 2011-03-09 973
cb72318069d5e9 Mimi Zohar 2011-03-09 974 evm_xattr->value = xattr_data;
cb72318069d5e9 Mimi Zohar 2011-03-09 975 evm_xattr->value_len = sizeof(*xattr_data);
9548906b2bb7ff Tetsuo Handa 2013-07-25 976 evm_xattr->name = XATTR_EVM_SUFFIX;
cb72318069d5e9 Mimi Zohar 2011-03-09 977 return 0;
cb72318069d5e9 Mimi Zohar 2011-03-09 978 out:
cb72318069d5e9 Mimi Zohar 2011-03-09 979 kfree(xattr_data);
cb72318069d5e9 Mimi Zohar 2011-03-09 980 return rc;
cb72318069d5e9 Mimi Zohar 2011-03-09 981 }
cb72318069d5e9 Mimi Zohar 2011-03-09 982 EXPORT_SYMBOL_GPL(evm_inode_init_security);
cb72318069d5e9 Mimi Zohar 2011-03-09 983
:::::: The code at line 930 was first introduced by commit
:::::: 6db7d1dee8003921b353d7e613471fe8995f46b5 evm: Align evm_inode_init_security() definition with LSM infrastructure
:::::: TO: Roberto Sassu <roberto.sassu@huawei.com>
:::::: CC: Paul Moore <paul@paul-moore.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-08-30 19:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202308310335.FCDCwTrB-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=roberto.sassu@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.