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(a)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@lists.01.org