All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: yang.yang29@zte.com.cn
Cc: wang.yi59@zte.com.cn, richard.weinberger@gmail.com,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	xue.zhihong@zte.com.cn, dwmw2@infradead.org
Subject: Re: [PATCH] jffs2: check dstlen for jffs2_zlib_compress()
Date: Mon, 21 Jan 2019 12:35:24 +0100	[thread overview]
Message-ID: <3151900.SLYxvDXFDr@blindfold> (raw)
In-Reply-To: <201901211659107381808@zte.com.cn>

Am Montag, 21. Januar 2019, 09:59:10 CET schrieb yang.yang29@zte.com.cn:
> Thanks for reply.
> But I think if (*dstlen < 2) is not good enough.

Not enough in terms of what?
My patch does what the commit message says, it fixes the out of bound access.
What do I miss?

> Because if  the length of data_in is equals to 2, the length of output compressed data is also 2.
> So there's no meaning to do all the compress calculates.
> 
> And I had do an experiment:
> If dstlen equals to 3, and data_in has 3 same bytes, the length of output compressed data will be 2. 
> Which means compress is effective.

This is a different issue and a possible further optimization.

Thanks,
//richard




______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Richard Weinberger <richard@nod.at>
To: yang.yang29@zte.com.cn
Cc: richard.weinberger@gmail.com, dwmw2@infradead.org,
	wang.yi59@zte.com.cn, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn
Subject: Re: [PATCH] jffs2: check dstlen for jffs2_zlib_compress()
Date: Mon, 21 Jan 2019 12:35:24 +0100	[thread overview]
Message-ID: <3151900.SLYxvDXFDr@blindfold> (raw)
In-Reply-To: <201901211659107381808@zte.com.cn>

Am Montag, 21. Januar 2019, 09:59:10 CET schrieb yang.yang29@zte.com.cn:
> Thanks for reply.
> But I think if (*dstlen < 2) is not good enough.

Not enough in terms of what?
My patch does what the commit message says, it fixes the out of bound access.
What do I miss?

> Because if  the length of data_in is equals to 2, the length of output compressed data is also 2.
> So there's no meaning to do all the compress calculates.
> 
> And I had do an experiment:
> If dstlen equals to 3, and data_in has 3 same bytes, the length of output compressed data will be 2. 
> Which means compress is effective.

This is a different issue and a possible further optimization.

Thanks,
//richard




       reply	other threads:[~2019-01-21 11:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201901211659107381808@zte.com.cn>
2019-01-21 11:35 ` Richard Weinberger [this message]
2019-01-21 11:35   ` [PATCH] jffs2: check dstlen for jffs2_zlib_compress() Richard Weinberger
     [not found] <201903201046335762775@zte.com.cn>
2019-03-20 21:06 ` Richard Weinberger
2019-03-20 21:06   ` Richard Weinberger
2019-01-21  0:21 Yang Yang
2019-01-21  8:04 ` Richard Weinberger
2019-01-21  8:04   ` Richard Weinberger

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=3151900.SLYxvDXFDr@blindfold \
    --to=richard@nod.at \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard.weinberger@gmail.com \
    --cc=wang.yi59@zte.com.cn \
    --cc=xue.zhihong@zte.com.cn \
    --cc=yang.yang29@zte.com.cn \
    /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.