* [PATCH v3] mm: shmem: Use signed int for version handling in casefold option
@ 2025-01-11 15:31 Karan Sanghavi
2025-01-13 14:44 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Karan Sanghavi @ 2025-01-11 15:31 UTC (permalink / raw)
To: Hugh Dickins, Andrew Morton, Gabriel Krisman Bertazi,
André Almeida, Christian Brauner
Cc: linux-mm, linux-kernel, Shuah Khan, Karan Sanghavi
Fixes an issue where the use of an unsigned data type in
`shmem_parse_opt_casefold()` caused incorrect evaluation of
negative conditions.
Fixes: 58e55efd6c72 ("tmpfs: Add casefold lookup support")
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Reviewed-by: Gabriel Krisman Bertazi <gabriel@krisman.be>
Signed-off-by: Karan Sanghavi <karansanghvi98@gmail.com>
---
Coverity Message:
CID 1601569: (#1 of 1): Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This less-than-zero comparison of an unsigned
value is never true. version < 0U
Coverity Link:
https://scan7.scan.coverity.com/#/project-view/10043/11354?selectedIssue=1601569
---
Changes in v3:
- Changed patch subject adn summary log.
- Link to v2: https://lore.kernel.org/r/20241127-unsignedcompare1601569-v2-1-e85098fb02b2@gmail.com
Changes in v2:
- Updated the log summary.
- Link to v1: https://lore.kernel.org/r/20241111-unsignedcompare1601569-v1-1-c4a9c3c75a52@gmail.com
---
mm/shmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 7987deb2be9b..17a1d4fa8870 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4367,7 +4367,7 @@ static int shmem_parse_opt_casefold(struct fs_context *fc, struct fs_parameter *
bool latest_version)
{
struct shmem_options *ctx = fc->fs_private;
- unsigned int version = UTF8_LATEST;
+ int version = UTF8_LATEST;
struct unicode_map *encoding;
char *version_str = param->string + 5;
---
base-commit: 6d59cab07b8d74d0f0422b750038123334f6ecc2
change-id: 20241111-unsignedcompare1601569-05b5932145ef
Best regards,
--
Karan Sanghavi <karansanghvi98@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v3] mm: shmem: Use signed int for version handling in casefold option
2025-01-11 15:31 [PATCH v3] mm: shmem: Use signed int for version handling in casefold option Karan Sanghavi
@ 2025-01-13 14:44 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2025-01-13 14:44 UTC (permalink / raw)
To: Karan Sanghavi
Cc: Christian Brauner, linux-mm, linux-kernel, Shuah Khan,
Hugh Dickins, Andrew Morton, Gabriel Krisman Bertazi,
André Almeida
On Sat, 11 Jan 2025 15:31:30 +0000, Karan Sanghavi wrote:
> Fixes an issue where the use of an unsigned data type in
> `shmem_parse_opt_casefold()` caused incorrect evaluation of
> negative conditions.
>
>
Applied to the vfs-6.14.misc branch of the vfs/vfs.git tree.
Patches in the vfs-6.14.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.14.misc
[1/1] mm: shmem: Use signed int for version handling in casefold option
https://git.kernel.org/vfs/vfs/c/5fb18263e9bf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-13 14:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-11 15:31 [PATCH v3] mm: shmem: Use signed int for version handling in casefold option Karan Sanghavi
2025-01-13 14:44 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox