linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Manas Ghandat <ghandatmanas@gmail.com>
Cc: anton@tuxera.com, linkinjeon@kernel.org,
	linux-ntfs-dev@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	syzbot+4768a8f039aa677897d0@syzkaller.appspotmail.com,
	linux-fsdevel@vger.kernel.org,
	Linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] ntfs : fix shift-out-of-bounds in ntfs_iget
Date: Tue, 8 Aug 2023 07:27:02 +0200	[thread overview]
Message-ID: <2023080821-blandness-survival-44af@gregkh> (raw)
In-Reply-To: <20230808043404.9028-1-ghandatmanas@gmail.com>

On Tue, Aug 08, 2023 at 10:04:05AM +0530, Manas Ghandat wrote:
> Added a check to the compression_unit so that out of bound doesn't
> occur.
> 
> Signed-off-by: Manas Ghandat <ghandatmanas@gmail.com>
> Reported-by: syzbot+4768a8f039aa677897d0@syzkaller.appspotmail.com
> ---
>  fs/ntfs/inode.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
> index 6c3f38d66579..2ee100a7df32 100644
> --- a/fs/ntfs/inode.c
> +++ b/fs/ntfs/inode.c
> @@ -1077,6 +1077,17 @@ static int ntfs_read_locked_inode(struct inode *vi)
>  					goto unm_err_out;
>  				}
>  				if (a->data.non_resident.compression_unit) {
> +					if(a->data.non_resident.compression_unit + 
> +						vol->cluster_size_bits > 32) {
> +							ntfs_error(vi->i_sb, "Found "
> +								"non-standard "
> +								"compression unit (%u).   "
> +								"Cannot handle this.",

Please do not split strings across lines.

And checkpatch will find other problems with this change as well, did
you run it before submitting it.

thanks,

greg k-h

  reply	other threads:[~2023-08-08 17:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  4:34 [PATCH] ntfs : fix shift-out-of-bounds in ntfs_iget Manas Ghandat
2023-08-08  5:27 ` Greg KH [this message]
2023-08-08 10:29   ` [PATCH v2] " Manas Ghandat
2023-08-08 10:45     ` Greg KH
     [not found]       ` <CAEt2hJ5icep5dF_OhuZwe0zig4VKCTKuQ0=iYfpOek7Ebp12Lw@mail.gmail.com>
2023-08-08 16:36         ` Greg KH
2023-08-10 16:13           ` [PATCH v3] " Manas Ghandat
2023-08-10 17:32             ` Greg KH

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=2023080821-blandness-survival-44af@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=Linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=anton@tuxera.com \
    --cc=ghandatmanas@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=syzbot+4768a8f039aa677897d0@syzkaller.appspotmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).