All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Edward Adam Davis <eadavis@sina.com>,
	syzbot+68178aa1e39c8606392e@syzkaller.appspotmail.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	djwong@kernel.org, jack@suse.cz, krisman@kernel.org,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	tytso@mit.edu
Subject: Re: [PATCH] ext4: Add validity checks for the casefold feature
Date: Tue, 1 Dec 2026 00:44:21 +0800	[thread overview]
Message-ID: <20261201003713.BSu5NSdv-lkp@intel.com> (raw)
In-Reply-To: <20261130110526.116017-1-eadavis@sina.com>

Hi Edward,

kernel test robot noticed the following build errors:

[auto build test ERROR on tytso-ext4/dev]
[also build test ERROR on linus/master v7.4-rc5 next-20261127]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Edward-Adam-Davis/ext4-Add-validity-checks-for-the-casefold-feature/20261130-190526
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
patch link:    https://lore.kernel.org/r/20261130110526.116017-1-eadavis%40sina.com
patch subject: [PATCH] ext4: Add validity checks for the casefold feature
config: um-x86_64_defconfig (https://download.01.org/0day-ci/archive/20261201/20261201003713.BSu5NSdv-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project ed93dc8f7a98c7dfdbf6f203bf72e6e9a82cde3e)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261201/20261201003713.BSu5NSdv-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/20261201003713.BSu5NSdv-lkp@intel.com/

All errors (new ones prefixed by >>):

>> fs/ext4/ioctl.c:1470:13: error: no member named 's_encoding' in 'struct super_block'
    1470 |                      !sb->s_encoding))
         |                       ~~  ^
   1 error generated.


vim +1470 fs/ext4/ioctl.c

  1404	
  1405	static int ext4_validate_tune_sb_params(struct super_block *sb,
  1406						struct ext4_tune_sb_params *params)
  1407	{
  1408		struct ext4_sb_info *sbi = EXT4_SB(sb);
  1409		struct ext4_super_block *es = sbi->s_es;
  1410		int enabling_casefold = 0;
  1411	
  1412		if (strnlen(params->mount_opts, sizeof(params->mount_opts)) ==
  1413		    sizeof(params->mount_opts))
  1414			return -E2BIG;
  1415	
  1416		if ((params->set_flags & ~TUNE_OPS_SUPPORTED) != 0)
  1417			return -EOPNOTSUPP;
  1418	
  1419		if ((params->set_flags & EXT4_TUNE_FL_ERRORS_BEHAVIOR) &&
  1420		    (params->errors_behavior > EXT4_ERRORS_PANIC))
  1421			return -EINVAL;
  1422	
  1423		if ((params->set_flags & EXT4_TUNE_FL_RESERVED_BLOCKS) &&
  1424		    (params->reserved_blocks > ext4_blocks_count(sbi->s_es) / 2))
  1425			return -EINVAL;
  1426		if ((params->set_flags & EXT4_TUNE_FL_DEF_HASH_ALG) &&
  1427		    ((params->def_hash_alg > DX_HASH_LAST) ||
  1428		     (params->def_hash_alg == DX_HASH_SIPHASH)))
  1429			return -EINVAL;
  1430		if ((params->set_flags & EXT4_TUNE_FL_FEATURES) &&
  1431		    (params->set_flags & EXT4_TUNE_FL_EDIT_FEATURES))
  1432			return -EINVAL;
  1433	
  1434		if (params->set_flags & EXT4_TUNE_FL_FEATURES) {
  1435			params->set_feature_compat_mask =
  1436				params->feature_compat &
  1437				~le32_to_cpu(es->s_feature_compat);
  1438			params->set_feature_incompat_mask =
  1439				params->feature_incompat &
  1440				~le32_to_cpu(es->s_feature_incompat);
  1441			params->set_feature_ro_compat_mask =
  1442				params->feature_ro_compat &
  1443				~le32_to_cpu(es->s_feature_ro_compat);
  1444			params->clear_feature_compat_mask =
  1445				~params->feature_compat &
  1446				le32_to_cpu(es->s_feature_compat);
  1447			params->clear_feature_incompat_mask =
  1448				~params->feature_incompat &
  1449				le32_to_cpu(es->s_feature_incompat);
  1450			params->clear_feature_ro_compat_mask =
  1451				~params->feature_ro_compat &
  1452				le32_to_cpu(es->s_feature_ro_compat);
  1453			params->set_flags |= EXT4_TUNE_FL_EDIT_FEATURES;
  1454		}
  1455		if (params->set_flags & EXT4_TUNE_FL_EDIT_FEATURES) {
  1456			if ((params->set_feature_compat_mask &
  1457			     ~EXT4_TUNE_SET_COMPAT_SUPP) ||
  1458			    (params->set_feature_incompat_mask &
  1459			     ~EXT4_TUNE_SET_INCOMPAT_SUPP) ||
  1460			    (params->set_feature_ro_compat_mask &
  1461			     ~EXT4_TUNE_SET_RO_COMPAT_SUPP) ||
  1462			    (params->clear_feature_compat_mask &
  1463			     ~EXT4_TUNE_CLEAR_COMPAT_SUPP) ||
  1464			    (params->clear_feature_incompat_mask &
  1465			     ~EXT4_TUNE_CLEAR_INCOMPAT_SUPP) ||
  1466			    (params->clear_feature_ro_compat_mask &
  1467			     ~EXT4_TUNE_CLEAR_RO_COMPAT_SUPP) ||
  1468			    (params->set_feature_incompat_mask &
  1469			     EXT4_FEATURE_INCOMPAT_CASEFOLD &&
> 1470			     !sb->s_encoding))
  1471				return -EOPNOTSUPP;
  1472	
  1473			/*
  1474			 * Filter out the features that are already set from
  1475			 * the set_mask.
  1476			 */
  1477			params->set_feature_compat_mask &=
  1478				~le32_to_cpu(es->s_feature_compat);
  1479			params->set_feature_incompat_mask &=
  1480				~le32_to_cpu(es->s_feature_incompat);
  1481			params->set_feature_ro_compat_mask &=
  1482				~le32_to_cpu(es->s_feature_ro_compat);
  1483			if (params->set_feature_incompat_mask &
  1484			    EXT4_FEATURE_INCOMPAT_CASEFOLD) {
  1485				enabling_casefold = 1;
  1486				if (!(params->set_flags & EXT4_TUNE_FL_ENCODING)) {
  1487					params->encoding = EXT4_ENC_UTF8_12_1;
  1488					params->set_flags |= EXT4_TUNE_FL_ENCODING;
  1489				}
  1490				if (!(params->set_flags &
  1491				      EXT4_TUNE_FL_ENCODING_FLAGS)) {
  1492					params->encoding_flags = 0;
  1493					params->set_flags |=
  1494						EXT4_TUNE_FL_ENCODING_FLAGS;
  1495				}
  1496			}
  1497			if (params->set_feature_compat_mask &
  1498			    EXT4_FEATURE_COMPAT_DIR_INDEX) {
  1499				uuid_t uu;
  1500	
  1501				memcpy(&uu, sbi->s_hash_seed, UUID_SIZE);
  1502				if (uuid_is_null(&uu))
  1503					generate_random_uuid((char *)&sbi->s_hash_seed);
  1504				if (params->set_flags & EXT4_TUNE_FL_DEF_HASH_ALG)
  1505					sbi->s_def_hash_version = params->def_hash_alg;
  1506				else if (sbi->s_def_hash_version == 0)
  1507					sbi->s_def_hash_version = DX_HASH_HALF_MD4;
  1508				if (!(es->s_flags &
  1509				      cpu_to_le32(EXT2_FLAGS_UNSIGNED_HASH)) &&
  1510				    !(es->s_flags &
  1511				      cpu_to_le32(EXT2_FLAGS_SIGNED_HASH))) {
  1512	#ifdef __CHAR_UNSIGNED__
  1513					sbi->s_hash_unsigned = 3;
  1514	#else
  1515					sbi->s_hash_unsigned = 0;
  1516	#endif
  1517				}
  1518			}
  1519		}
  1520		if (params->set_flags & EXT4_TUNE_FL_ENCODING) {
  1521			if (!enabling_casefold)
  1522				return -EINVAL;
  1523			if (params->encoding == 0)
  1524				params->encoding = EXT4_ENC_UTF8_12_1;
  1525			else if (params->encoding != EXT4_ENC_UTF8_12_1)
  1526				return -EINVAL;
  1527		}
  1528		if (params->set_flags & EXT4_TUNE_FL_ENCODING_FLAGS) {
  1529			if (!enabling_casefold)
  1530				return -EINVAL;
  1531			if (params->encoding_flags & ~SB_ENC_SUPP_MASK)
  1532				return -EINVAL;
  1533		}
  1534	
  1535		return 0;
  1536	}
  1537	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      parent reply	other threads:[~2026-11-30 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  2:39 [syzbot] [ext4?] general protection fault in utf8nlookup (2) syzbot
2026-11-30 11:05 ` [PATCH] ext4: Add validity checks for the casefold feature Edward Adam Davis
2026-11-30 11:14   ` sashiko-bot
2026-11-30 16:32   ` kernel test robot
2026-11-30 16:35   ` Gabriel Krisman Bertazi
2026-11-30 16:44   ` kernel test robot [this message]

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=20261201003713.BSu5NSdv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=djwong@kernel.org \
    --cc=eadavis@sina.com \
    --cc=jack@suse.cz \
    --cc=krisman@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=syzbot+68178aa1e39c8606392e@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tytso@mit.edu \
    /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.