Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2194116/?format=api
{ "id": 2194116, "url": "http://patchwork.ozlabs.org/api/patches/2194116/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260206214613.work.184-kees@kernel.org/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/projects/8/?format=api", "name": "Linux ext4 filesystem development", "link_name": "linux-ext4", "list_id": "linux-ext4.vger.kernel.org", "list_email": "linux-ext4@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260206214613.work.184-kees@kernel.org>", "list_archive_url": null, "date": "2026-02-06T21:46:18", "name": "[ALTERNATIVE] ext4: Treat s_mount_opts and mount_opts as __nonstring", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "bd5c0add63163606af5d9589f283f918f99a0989", "submitter": { "id": 85255, "url": "http://patchwork.ozlabs.org/api/people/85255/?format=api", "name": "Kees Cook", "email": "kees@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260206214613.work.184-kees@kernel.org/mbox/", "series": [ { "id": 491340, "url": "http://patchwork.ozlabs.org/api/series/491340/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=491340", "date": "2026-02-06T21:46:18", "name": "[ALTERNATIVE] ext4: Treat s_mount_opts and mount_opts as __nonstring", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491340/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2194116/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2194116/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=TUsk=AK=vger.kernel.org=linux-ext4+bounces-13606-patchwork-incoming=ozlabs.org@ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-ext4@vger.kernel.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "patchwork-incoming@ozlabs.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=miTX8q/b;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=tusk=ak=vger.kernel.org=linux-ext4+bounces-13606-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c04:e001:36c::12fc:5321\"\n arc.chain=subspace.kernel.org", "gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org", "gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=miTX8q/b;\n\tdkim-atps=neutral", "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-ext4+bounces-13606-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"miTX8q/b\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4f772b3SHvz1xvW\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 07 Feb 2026 08:46:31 +1100 (AEDT)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4f772b2jZ6z4wCk\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 07 Feb 2026 08:46:31 +1100 (AEDT)", "by gandalf.ozlabs.org (Postfix)\n\tid 4f772b2cLnz4wCp; Sat, 07 Feb 2026 08:46:31 +1100 (AEDT)", "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4f772W2Xzwz4wCk\n\tfor <patchwork-incoming@ozlabs.org>; Sat, 07 Feb 2026 08:46:27 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id D32D5303EFCA\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 6 Feb 2026 21:46:24 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id E17302F0C7E;\n\tFri, 6 Feb 2026 21:46:20 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id A403835975;\n\tFri, 6 Feb 2026 21:46:20 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 50F03C16AAE;\n\tFri, 6 Feb 2026 21:46:20 +0000 (UTC)" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1770414391; cv=pass;\n\tb=Wdwl3DZQ7sNHn7nH6gxUu770Xz4hcT93z2sk26ul3i6F0AhAAE1riVWAxPE+UP6jVZfACaEdCDk4XcT0QwIOz0XvWACvj2WQdPucgMIX2b8/uRSH4O0lrO7ZuET/yrkNhwc4F0lgrt5G7ArmDSm7yI9F+ce3LmiMbSRy5vUoBfGSb4IhNb4kodnTvdOgsgPoiQWKFGSBnkRVISIq9yZ+72/GU+qSy7ppK4TYD5NbbktKZKmb75LutLizkjSf8YvnQKQ6zs9ZHzfQ0JZzIMMpkmJZ+c9U/jVrz0XcQl1kCFw8u3M/TuxEJFB9RwNTdjVJv7q/k0u1RUY1NhdJTgEKuw==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1770414380; cv=none;\n b=AjIK1od5uqkcsicsBOnkkGaJundAHf0vBVh0hlgoWS/Kgm+pnmIst0wl8bp4p7MAQ2KGoraIfYfB0V3Z496twaVqwYl/GbM1FPQybluEnX1/LaBRhcIBIvuBFBhOLlGilGY7elEI6bam3Jy3v8564CNRNf82W2IHukqh7CMbapU=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1770414391; c=relaxed/relaxed;\n\tbh=OF5JgdEuBO7zhGDOlqqoNSaRX/JSUSAfyUu4TBNYcu4=;\n\th=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type;\n b=azGNp28VmHtVl4PTpabPx3K5OImhnjsE/YImsFHIe7MMPWE1d16XBX1ymC9SXeEfdsAFmqCSqW+cd+Hhkr4ISfK7lNOCkCxxuPDjq3iZmjQgenSrdgLX9LJ9geMX2U/UoOnVypsPWsgQAZcc2VQoAgAFVyePXYWuKQ78nQSCIBfu+GpDZtrJO1bjOYZTWFFX/gh4nps/OtnSqf56TlGxPwVg1hxr6MkdcGJO84XcX2j6XZtd07FQicWSCsOZi+K0moPPu2fZjVkBEIoHTKRDCAo/K18fg8NJ7ciPNSvuW4qyPlTYf2mUHyaSzmjjqP1E+fslmG9PMQI/qWqqGbCPSw==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1770414380; c=relaxed/simple;\n\tbh=33n7JfvoxNjoA9AcZk3us7gGXm6K7pn0EwypmZJlHiI=;\n\th=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type;\n b=n+IUyfzU5jt+Ix8puLImtyjyP9+X+8JT4O+H7DZ8qya6e2+6+ZNjRvw5WCOV+rjkb66zO95oOOCMgF2U+OHG469MwbYJttPqiLEJkvR83Cu2G88jUlJSKiR66nkuI9fLjS+GGVJ0fBew0kfkG+QerUShORSmRXnBfOw+yNVxyJI=" ], "ARC-Authentication-Results": [ "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=miTX8q/b; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-ext4+bounces-13606-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org", "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=miTX8q/b; arc=none smtp.client-ip=10.30.226.201" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1770414380;\n\tbh=33n7JfvoxNjoA9AcZk3us7gGXm6K7pn0EwypmZJlHiI=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=miTX8q/bvOs594rk2qZlTUwETYZ6KP73QhNYozPll/gUzxwYtL9nm0aKuotaz9gl5\n\t uhmculosjUTVetczxTRZ0JzsxeUjt1iJ8R4TtLz3A5LeDZZotg+4QnB6ZrBNzKZftH\n\t eW1AdpZlH+4IMDQ4CecvIAvBzOJroa1gvhMp2BsLHWchf60POduXlja4/Hx1XfUIa8\n\t LGp5ZRve/a5AzAui0CFM+4GXTfQmw7AWZRZUBxIBYkJifPQo7Ux6ecMi3bvVaSrd/V\n\t BoIOwZcaGjKvF7iTR4dwN36/rFGvclurhy/4RHmd2/8G/M0nH/x2gQaMWtYV/atqMw\n\t qMJhFdbaV96rQ==", "From": "Kees Cook <kees@kernel.org>", "To": "\"Theodore Ts'o\" <tytso@mit.edu>", "Cc": "Kees Cook <kees@kernel.org>,\n =?utf-8?b?5p2O6b6Z5YW0?= <coregee2000@gmail.com>,\n Andreas Dilger <adilger.kernel@dilger.ca>,\n Andy Shevchenko <andriy.shevchenko@intel.com>, linux-ext4@vger.kernel.org,\n linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org", "Subject": "[PATCH ALTERNATIVE] ext4: Treat s_mount_opts and mount_opts as\n __nonstring", "Date": "Fri, 6 Feb 2026 13:46:18 -0800", "Message-Id": "<20260206214613.work.184-kees@kernel.org>", "X-Mailer": "git-send-email 2.34.1", "Precedence": "bulk", "X-Mailing-List": "linux-ext4@vger.kernel.org", "List-Id": "<linux-ext4.vger.kernel.org>", "List-Subscribe": "<mailto:linux-ext4+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-ext4+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "X-Developer-Signature": "v=1; a=openpgp-sha256; l=7802; i=kees@kernel.org;\n h=from:subject:message-id; bh=33n7JfvoxNjoA9AcZk3us7gGXm6K7pn0EwypmZJlHiI=;\n b=owGbwMvMwCVmps19z/KJym7G02pJDJltiZoFx+LebbPOVwsqflPmeOB96fzbwbPrQtLkWCJ9P\n 0b+T7rWUcrCIMbFICumyBJk5x7n4vG2Pdx9riLMHFYmkCEMXJwCMJFzQgz/XUNKtRfoN4fHJM5I\n ff9yirCL49W2xPSFumIHD2moOG3/x/A/+KRfXifnitlF/lGmfw9N1VhyOd7MZUv57hu/u87s/XS\n cDQA=", "X-Developer-Key": "i=kees@kernel.org; a=openpgp;\n fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026", "Content-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org" }, "content": "When mounting an ext4 filesystem, the on-disk superblock's s_mount_opts\nfield (which stores default mount options set via tune2fs) is read and\nparsed. Unlike userspace-provided mount options which are validated by\nthe VFS layer before reaching the filesystem, the on-disk s_mount_opts\nis read directly from the disk buffer without NUL-termination validation.\n\nThe two option paths use the same parser but arrive differently:\n\n Userspace mount options:\n VFS -> ext4_parse_param()\n\n On-disk default options:\n parse_apply_sb_mount_options() -> parse_options() -> ext4_parse_param()\n\nWhen s_mount_opts lacks NUL-termination, strscpy_pad()'s internal\nfortified strnlen() detects reading beyond the 64-byte field, triggering\nan Oops:\n\n strnlen: detected buffer overflow: 65 byte read of buffer size 64\n WARNING: CPU: 0 PID: 179 at lib/string_helpers.c:1035 __fortify_report+0x5a/0x100\n ...\n Call Trace:\n strnlen+0x71/0xa0 lib/string.c:155\n sized_strscpy+0x48/0x2a0 lib/string.c:298\n parse_apply_sb_mount_options+0x94/0x4a0 fs/ext4/super.c:2486\n __ext4_fill_super+0x31d6/0x51b0 fs/ext4/super.c:5306\n ext4_fill_super+0x3972/0xaf70 fs/ext4/super.c:5736\n get_tree_bdev_flags+0x38c/0x620 fs/super.c:1698\n vfs_get_tree+0x8e/0x340 fs/super.c:1758\n fc_mount fs/namespace.c:1199\n do_new_mount fs/namespace.c:3718\n path_mount+0x7b9/0x23a0 fs/namespace.c:4028\n ...\n\nThe painful history here is:\n\n8b67f04ab9de (\"ext4: Add mount options in superblock\")\n s_mount_opts is created and treated as __nonstring: kstrndup is used to\n make sure all 64 potential characters are available for use (i.e. up\n to 65 bytes may be allocated).\n\n04a91570ac67 (\"ext4: implemet new ioctls to set and get superblock parameters\")\n Created ext4_tune_sb_params::mount_opts as 64 bytes in size but\n incorrectly treated it and s_mount_opts as a C strings (it used\n strscpy_pad() to copy between them).\n\n8ecb790ea8c3 (\"ext4: avoid potential buffer over-read in parse_apply_sb_mount_options()\")\n As a prerequisite to the ioctl treating s_mount_opts as a C string, this\n attempted to switch to using strscpy_pad() with a 65 byte destination\n for the case of an unterminated s_mount_opts. (But strscpy_pad will\n fail due to the over-read of s_mount_opts by strnlen().)\n\n3db63d2c2d1d (\"ext4: check if mount_opts is NUL-terminated in ext4_ioctl_set_tune_sb()\")\n As a continuation of trying to solve the 64/65 mismatch, this started\n enforcing a 63 character limit (i.e. 64 bytes total) to incoming values\n from userspace to the ioctl API. (But did not check s_mount_opts coming\n from disk.)\n\nee5a977b4e77 (\"ext4: fix string copying in parse_apply_sb_mount_options()\")\n Notices the loud failures of strscpy_pad introduced by 8ecb790ea8c3,\n and attempted to silence them by making the destination 64 and rejecting\n too-long strings from the on-disk copy of s_mount_opts, but didn't\n actually solve it at all, since the problem was always the over-read\n of the source seen by strnlen(). (Note that the report quoted in this\n commit exactly match the report today.)\n\nEffectively revert 8ecb790ea8c3, 3db63d2c2d1d, and ee5a977b4e77, and fix\n04a91570ac67 to treat s_mount_opts and ext4_tune_sb_params::mount_opts\nas __nonstring.\n\nReported-by: 李龙兴 <coregee2000@gmail.com>\nCloses: https://lore.kernel.org/lkml/CAHPqNmzBb2LruMA6jymoHXQRsoiAKMFZ1wVEz8JcYKg4U6TBbw@mail.gmail.com/\nFixes: ee5a977b4e77 (\"ext4: fix string copying in parse_apply_sb_mount_options()\")\nSigned-off-by: Kees Cook <kees@kernel.org>\n---\nHere's the alternative, though I have not heavily tested this. I'm hoping\nthe ext4 regression tests have images with 64 character s_mount_opts...\n\nCc: \"Theodore Ts'o\" <tytso@mit.edu>\nCc: Andreas Dilger <adilger.kernel@dilger.ca>\nCc: Andy Shevchenko <andriy.shevchenko@intel.com>\nCc: <linux-ext4@vger.kernel.org>\n---\n fs/ext4/ext4.h | 2 +-\n include/uapi/linux/ext4.h | 2 +-\n fs/ext4/ioctl.c | 12 ++++++------\n fs/ext4/super.c | 5 ++---\n 4 files changed, 10 insertions(+), 11 deletions(-)", "diff": "diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\nindex 56112f201cac..588d51a41c38 100644\n--- a/fs/ext4/ext4.h\n+++ b/fs/ext4/ext4.h\n@@ -1448,7 +1448,7 @@ struct ext4_super_block {\n \t__le64\ts_last_error_block;\t/* block involved of last error */\n \t__u8\ts_last_error_func[32] __nonstring;\t/* function where the error happened */\n #define EXT4_S_ERR_END offsetof(struct ext4_super_block, s_mount_opts)\n-\t__u8\ts_mount_opts[64];\n+\t__u8\ts_mount_opts[64] __nonstring;\n \t__le32\ts_usr_quota_inum;\t/* inode for tracking user quota */\n \t__le32\ts_grp_quota_inum;\t/* inode for tracking group quota */\n \t__le32\ts_overhead_clusters;\t/* overhead blocks/clusters in fs */\ndiff --git a/include/uapi/linux/ext4.h b/include/uapi/linux/ext4.h\nindex 9c683991c32f..551373a775be 100644\n--- a/include/uapi/linux/ext4.h\n+++ b/include/uapi/linux/ext4.h\n@@ -138,7 +138,7 @@ struct ext4_tune_sb_params {\n \t__u32 clear_feature_compat_mask;\n \t__u32 clear_feature_incompat_mask;\n \t__u32 clear_feature_ro_compat_mask;\n-\t__u8 mount_opts[64];\n+\t__u8 mount_opts[64] __kernel_nonstring;\n \t__u8 pad[68];\n };\n \ndiff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c\nindex 7ce0fc40aec2..9fd4118c9805 100644\n--- a/fs/ext4/ioctl.c\n+++ b/fs/ext4/ioctl.c\n@@ -1292,7 +1292,9 @@ static int ext4_ioctl_get_tune_sb(struct ext4_sb_info *sbi,\n \tret.raid_stripe_width = le32_to_cpu(es->s_raid_stripe_width);\n \tret.encoding = le16_to_cpu(es->s_encoding);\n \tret.encoding_flags = le16_to_cpu(es->s_encoding_flags);\n-\tstrscpy_pad(ret.mount_opts, es->s_mount_opts);\n+\tmemcpy_and_pad(ret.mount_opts, sizeof(ret.mount_opts),\n+\t\t es->s_mount_opts,\n+\t\t strnlen(es->s_mount_opts, sizeof(es->s_mount_opts)), 0);\n \tret.feature_compat = le32_to_cpu(es->s_feature_compat);\n \tret.feature_incompat = le32_to_cpu(es->s_feature_incompat);\n \tret.feature_ro_compat = le32_to_cpu(es->s_feature_ro_compat);\n@@ -1353,7 +1355,9 @@ static void ext4_sb_setparams(struct ext4_sb_info *sbi,\n \t\tes->s_encoding = cpu_to_le16(params->encoding);\n \tif (params->set_flags & EXT4_TUNE_FL_ENCODING_FLAGS)\n \t\tes->s_encoding_flags = cpu_to_le16(params->encoding_flags);\n-\tstrscpy_pad(es->s_mount_opts, params->mount_opts);\n+\tmemcpy_and_pad(es->s_mount_opts, sizeof(es->s_mount_opts),\n+\t\t params->mount_opts,\n+\t\t strnlen(params->mount_opts, sizeof(params->mount_opts)), 0);\n \tif (params->set_flags & EXT4_TUNE_FL_EDIT_FEATURES) {\n \t\tes->s_feature_compat |=\n \t\t\tcpu_to_le32(params->set_feature_compat_mask);\n@@ -1394,10 +1398,6 @@ static int ext4_ioctl_set_tune_sb(struct file *filp,\n \tif (copy_from_user(¶ms, in, sizeof(params)))\n \t\treturn -EFAULT;\n \n-\tif (strnlen(params.mount_opts, sizeof(params.mount_opts)) ==\n-\t sizeof(params.mount_opts))\n-\t\treturn -E2BIG;\n-\n \tif ((params.set_flags & ~TUNE_OPS_SUPPORTED) != 0)\n \t\treturn -EOPNOTSUPP;\n \ndiff --git a/fs/ext4/super.c b/fs/ext4/super.c\nindex 87205660c5d0..fe3a8e7c6f03 100644\n--- a/fs/ext4/super.c\n+++ b/fs/ext4/super.c\n@@ -2477,7 +2477,7 @@ static int parse_apply_sb_mount_options(struct super_block *sb,\n \t\t\t\t\tstruct ext4_fs_context *m_ctx)\n {\n \tstruct ext4_sb_info *sbi = EXT4_SB(sb);\n-\tchar s_mount_opts[64];\n+\tchar s_mount_opts[sizeof(sbi->s_es->s_mount_opts) + 1];\n \tstruct ext4_fs_context *s_ctx = NULL;\n \tstruct fs_context *fc = NULL;\n \tint ret = -ENOMEM;\n@@ -2485,8 +2485,7 @@ static int parse_apply_sb_mount_options(struct super_block *sb,\n \tif (!sbi->s_es->s_mount_opts[0])\n \t\treturn 0;\n \n-\tif (strscpy_pad(s_mount_opts, sbi->s_es->s_mount_opts) < 0)\n-\t\treturn -E2BIG;\n+\tmemtostr(s_mount_opts, sbi->s_es->s_mount_opts);\n \n \tfc = kzalloc(sizeof(struct fs_context), GFP_KERNEL);\n \tif (!fc)\n", "prefixes": [ "ALTERNATIVE" ] }