linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Roberto Sassu <roberto.sassu@huawei.com>
Cc: kbuild-all@lists.01.org, linux-integrity@vger.kernel.org,
	Mimi Zohar <zohar@linux.ibm.com>
Subject: [integrity:next-integrity-testing 4/9] security/integrity/ima/ima_template_lib.c:571:28: sparse: sparse: incorrect type in assignment (different base types)
Date: Fri, 4 Jun 2021 15:33:42 +0800	[thread overview]
Message-ID: <202106041539.U04QXEXV-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3490 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git next-integrity-testing
head:   d721c15fd519c08819fbc6de39b713e2ed1d9894
commit: 7dcfeacc5a9d0c130160b86de23279793a8732c8 [4/9] ima: Define new template fields iuid and igid
config: nios2-randconfig-s031-20210604 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git/commit/?id=7dcfeacc5a9d0c130160b86de23279793a8732c8
        git remote add integrity https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
        git fetch --no-tags integrity next-integrity-testing
        git checkout 7dcfeacc5a9d0c130160b86de23279793a8732c8
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   security/integrity/ima/ima_template_lib.c:100:44: sparse: sparse: cast to restricted __le16
   security/integrity/ima/ima_template_lib.c:107:44: sparse: sparse: cast to restricted __le32
   security/integrity/ima/ima_template_lib.c:114:44: sparse: sparse: cast to restricted __le64
   security/integrity/ima/ima_template_lib.c:135:60: sparse: sparse: restricted __le32 degrades to integer
   security/integrity/ima/ima_template_lib.c:230:49: sparse: sparse: cast to restricted __le32
>> security/integrity/ima/ima_template_lib.c:571:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [assigned] id @@     got restricted __le16 [usertype] @@
   security/integrity/ima/ima_template_lib.c:571:28: sparse:     expected unsigned int [assigned] id
   security/integrity/ima/ima_template_lib.c:571:28: sparse:     got restricted __le16 [usertype]
>> security/integrity/ima/ima_template_lib.c:573:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [assigned] id @@     got restricted __le32 [usertype] @@
   security/integrity/ima/ima_template_lib.c:573:28: sparse:     expected unsigned int [assigned] id
   security/integrity/ima/ima_template_lib.c:573:28: sparse:     got restricted __le32 [usertype]

vim +571 security/integrity/ima/ima_template_lib.c

   554	
   555	static int ima_eventinodedac_init_common(struct ima_event_data *event_data,
   556						 struct ima_field_data *field_data,
   557						 bool get_uid)
   558	{
   559		unsigned int id;
   560	
   561		if (!event_data->file)
   562			return 0;
   563	
   564		if (get_uid)
   565			id = i_uid_read(file_inode(event_data->file));
   566		else
   567			id = i_gid_read(file_inode(event_data->file));
   568	
   569		if (ima_canonical_fmt) {
   570			if (sizeof(id) == sizeof(u16))
 > 571				id = cpu_to_le16(id);
   572			else
 > 573				id = cpu_to_le32(id);
   574		}
   575	
   576		return ima_write_template_field_data((void *)&id, sizeof(id),
   577						     DATA_FMT_UINT, field_data);
   578	}
   579	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 21406 bytes --]

                 reply	other threads:[~2021-06-04  7:34 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=202106041539.U04QXEXV-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=roberto.sassu@huawei.com \
    --cc=zohar@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).