tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   60b548237fed4b4164bab13c994dd9615f6c4323
commit: 16a26b20d2afd0cf063816725b45b12e78d5bb31 ubifs: authentication: Add 
hashes to index nodes
date:   5 weeks ago
config: i386-randconfig-x0-11291730 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
        git checkout 16a26b20d2afd0cf063816725b45b12e78d5bb31
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   fs/ubifs/tnc.o: In function `try_read_node':
>> fs/ubifs/tnc.c:493: undefined reference to `ubifs_bad_hash'
   fs/ubifs/tnc.o: In function `validate_data_node':
   fs/ubifs/tnc.c:1724: undefined reference to `ubifs_bad_hash'
   fs/ubifs/tnc_misc.o: In function `read_znode':
>> fs/ubifs/tnc_misc.c:298: undefined reference to `ubifs_bad_hash'
   fs/ubifs/tnc_misc.o: In function `ubifs_tnc_read_node':
   fs/ubifs/tnc_misc.c:509: undefined reference to `ubifs_bad_hash'

vim +493 fs/ubifs/tnc.c

   430  
   431  /**
   432   * try_read_node - read a node if it is a node.
   433   * @c: UBIFS file-system description object
   434   * @buf: buffer to read to
   435   * @type: node type
   436   * @zbr: the zbranch describing the node to read
   437   *
   438   * This function tries to read a node of known type and length, checks 
it and
   439   * stores it in @buf. This function returns %1 if a node is present and 
%0 if
   440   * a node is not present. A negative error code is returned for I/O 
errors.
   441   * This function performs that same function as ubifs_read_node except 
that
   442   * it does not require that there is actually a node present and instead
   443   * the return code indicates if a node was read.
   444   *
   445   * Note, this function does not check CRC of data nodes if 
@c->no_chk_data_crc
   446   * is true (it is controlled by corresponding mount option). However, if
   447   * @c->mounting or @c->remounting_rw is true (we are mounting or 
re-mounting to
   448   * R/W mode), @c->no_chk_data_crc is ignored and CRC is checked. This is
   449   * because during mounting or re-mounting from R/O mode to R/W mode we 
may read
   450   * journal nodes (when replying the journal or doing the recovery) and 
the
   451   * journal nodes may potentially be corrupted, so checking is required.
   452   */
   453  static int try_read_node(const struct ubifs_info *c, void *buf, int 
type,
   454                           struct ubifs_zbranch *zbr)
   455  {
   456          int len = zbr->len;
   457          int lnum = zbr->lnum;
   458          int offs = zbr->offs;
   459          int err, node_len;
   460          struct ubifs_ch *ch = buf;
   461          uint32_t crc, node_crc;
   462  
   463          dbg_io("LEB %d:%d, %s, length %d", lnum, offs, dbg_ntype(type), 
len);
   464  
   465          err = ubifs_leb_read(c, lnum, buf, offs, len, 1);
   466          if (err) {
   467                  ubifs_err(c, "cannot read node type %d from LEB %d:%d, 
error %d",
   468                            type, lnum, offs, err);
   469                  return err;
   470          }
   471  
   472          if (le32_to_cpu(ch->magic) != UBIFS_NODE_MAGIC)
   473                  return 0;
   474  
   475          if (ch->node_type != type)
   476                  return 0;
   477  
   478          node_len = le32_to_cpu(ch->len);
   479          if (node_len != len)
   480                  return 0;
   481  
   482          if (type == UBIFS_DATA_NODE && c->no_chk_data_crc && 
!c->mounting &&
   483              !c->remounting_rw)
   484                  return 1;
   485  
   486          crc = crc32(UBIFS_CRC32_INIT, buf + 8, node_len - 8);
   487          node_crc = le32_to_cpu(ch->crc);
   488          if (crc != node_crc)
   489                  return 0;
   490  
   491          err = ubifs_node_check_hash(c, buf, zbr->hash);
   492          if (err) {
 > 493                  ubifs_bad_hash(c, buf, zbr->hash, lnum, offs);
   494                  return 0;
   495          }
   496  
   497          return 1;
   498  }
   499  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to