* [PATCH-v2] jfs: fix slab-out-of-bounds Read in dtSearch
@ 2023-10-25 6:09 Manas Ghandat
2023-11-01 15:20 ` Dave Kleikamp
0 siblings, 1 reply; 2+ messages in thread
From: Manas Ghandat @ 2023-10-25 6:09 UTC (permalink / raw)
To: dan.carpenter, dave.kleikamp, shaggy
Cc: Manas Ghandat, Linux-kernel-mentees, jfs-discussion,
linux-kernel, lkp, oe-kbuild-all, oe-kbuild
Currently while searching for current page in the sorted entry table
of the page there is a out of bound access. Added a bound check to fix
the error.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202310241724.Ed02yUz9-lkp@intel.com/
Signed-off-by: Manas Ghandat <ghandatmanas@gmail.com>
---
V1 -> V2 : Removed redundant check on stbl
fs/jfs/jfs_dtree.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 92b7c533407c..cf67d32d5b7f 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -633,6 +633,9 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
for (base = 0, lim = p->header.nextindex; lim; lim >>= 1) {
index = base + (lim >> 1);
+ if (stbl[index] < 0)
+ goto out;
+
if (p->header.flag & BT_LEAF) {
/* uppercase leaf name to compare */
cmp =
--
2.37.2
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH-v2] jfs: fix slab-out-of-bounds Read in dtSearch
2023-10-25 6:09 [PATCH-v2] jfs: fix slab-out-of-bounds Read in dtSearch Manas Ghandat
@ 2023-11-01 15:20 ` Dave Kleikamp
0 siblings, 0 replies; 2+ messages in thread
From: Dave Kleikamp @ 2023-11-01 15:20 UTC (permalink / raw)
To: Manas Ghandat, dan.carpenter, shaggy
Cc: Linux-kernel-mentees, jfs-discussion, linux-kernel, lkp,
oe-kbuild-all, oe-kbuild
On 10/25/23 1:09AM, Manas Ghandat wrote:
> Currently while searching for current page in the sorted entry table
> of the page there is a out of bound access. Added a bound check to fix
> the error.
Looks good. I made the small change of setting rc = -EIO in that case,
so we know there is something wrong with the file system.
Thanks,
Shaggy
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/r/202310241724.Ed02yUz9-lkp@intel.com/
> Signed-off-by: Manas Ghandat <ghandatmanas@gmail.com>
> ---
> V1 -> V2 : Removed redundant check on stbl
>
> fs/jfs/jfs_dtree.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
> index 92b7c533407c..cf67d32d5b7f 100644
> --- a/fs/jfs/jfs_dtree.c
> +++ b/fs/jfs/jfs_dtree.c
> @@ -633,6 +633,9 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
> for (base = 0, lim = p->header.nextindex; lim; lim >>= 1) {
> index = base + (lim >> 1);
>
> + if (stbl[index] < 0)
> + goto out;
> +
> if (p->header.flag & BT_LEAF) {
> /* uppercase leaf name to compare */
> cmp =
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-01 15:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 6:09 [PATCH-v2] jfs: fix slab-out-of-bounds Read in dtSearch Manas Ghandat
2023-11-01 15:20 ` Dave Kleikamp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®