From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [android-common:android-mainline 4/5] fs/incfs/data_mgmt.c:799:21: sparse: sparse: Using plain integer as NULL pointer
Date: Thu, 19 Mar 2020 08:23:21 +0800 [thread overview]
Message-ID: <202003190817.usWNrAN1%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3245 bytes --]
tree: https://android.googlesource.com/kernel/common android-mainline
head: e94931cb2c0ec3992df6dfe452f2145fc5ad2c74
commit: bc6a70e849cccf3717e88833b98b592af32fad83 [4/5] ANDROID: Incremental fs: Remove signature checks from kernel
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-180-g0558317d-dirty
git checkout bc6a70e849cccf3717e88833b98b592af32fad83
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> fs/incfs/data_mgmt.c:799:21: sparse: sparse: Using plain integer as NULL pointer
--
>> fs/incfs/integrity.c:65:19: sparse: sparse: cast to restricted __le32
vim +799 fs/incfs/data_mgmt.c
790
791 static int process_file_signature_md(struct incfs_file_signature *sg,
792 struct metadata_handler *handler)
793 {
794 struct data_file *df = handler->context;
795 struct mtree *hash_tree = NULL;
796 int error = 0;
797 struct incfs_df_signature *signature =
798 kzalloc(sizeof(*signature), GFP_NOFS);
> 799 void *buf = 0;
800 ssize_t read;
801
802 if (!df || !df->df_backing_file_context ||
803 !df->df_backing_file_context->bc_file) {
804 error = -ENOENT;
805 goto out;
806 }
807
808 signature->hash_offset = le64_to_cpu(sg->sg_hash_tree_offset);
809 signature->hash_size = le32_to_cpu(sg->sg_hash_tree_size);
810 signature->sig_offset = le64_to_cpu(sg->sg_sig_offset);
811 signature->sig_size = le32_to_cpu(sg->sg_sig_size);
812
813 buf = kzalloc(signature->sig_size, GFP_NOFS);
814 if (!buf) {
815 error = -ENOMEM;
816 goto out;
817 }
818
819 read = incfs_kread(df->df_backing_file_context->bc_file, buf,
820 signature->sig_size, signature->sig_offset);
821 if (read < 0) {
822 error = read;
823 goto out;
824 }
825
826 if (read != signature->sig_size) {
827 error = -EINVAL;
828 goto out;
829 }
830
831 hash_tree = incfs_alloc_mtree(range(buf, signature->sig_size),
832 df->df_block_count);
833 if (IS_ERR(hash_tree)) {
834 error = PTR_ERR(hash_tree);
835 hash_tree = NULL;
836 goto out;
837 }
838 if (hash_tree->hash_tree_area_size != signature->hash_size) {
839 error = -EINVAL;
840 goto out;
841 }
842 if (signature->hash_size > 0 &&
843 handler->md_record_offset <= signature->hash_offset) {
844 error = -EINVAL;
845 goto out;
846 }
847 if (handler->md_record_offset <= signature->sig_offset) {
848 error = -EINVAL;
849 goto out;
850 }
851 df->df_hash_tree = hash_tree;
852 hash_tree = NULL;
853 df->df_signature = signature;
854 signature = NULL;
855 out:
856 incfs_free_mtree(hash_tree);
857 kfree(signature);
858 kfree(buf);
859
860 return error;
861 }
862
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
reply other threads:[~2020-03-19 0:23 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=202003190817.usWNrAN1%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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.