linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yueyi Li <liyueyi@live.com>
To: Dave Rodgman <dave.rodgman@arm.com>,
	"dsterba@suse.cz" <dsterba@suse.cz>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"w@1wt.eu" <w@1wt.eu>,
	"donb@securitymouse.com" <donb@securitymouse.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"markus@oberhumer.com" <markus@oberhumer.com>
Cc: nd <nd@arm.com>
Subject: Re: [PATCH v2] lzo: fix ip overrun during compress.
Date: Fri, 30 Nov 2018 03:05:38 +0000	[thread overview]
Message-ID: <SN1PR13MB030426DBA527C725AE28B5A9DFD30@SN1PR13MB0304.namprd13.prod.outlook.com> (raw)
In-Reply-To: <c03227b3-1c79-d214-5880-19f2f1ea0491@arm.com>

Hi Dave,


On 2018/11/30 0:49, Dave Rodgman wrote:
> On 28/11/2018 1:52 pm, David Sterba wrote:
>
>> The fix is adding a few branches to code that's supposed to be as fast
>> as possible. The branches would be evaluated all the time while
>> protecting against one signle bad page address. This does not look like
>> a good performance tradeoff.
> As an alternative, for all but the first case, instead of:
>
> if (unlikely(OVERFLOW_ADD_CHECK(ip, m_len) || (ip + m_len >= ip_end)))
>
> I'd suggest we do:
>
> if (unlikely((ip_end - ip) <= m_len))
>
> which will be about as efficient as what's currently there, but doesn't
> have issues with overflow.

Ooh, yes, pretty good solution to this, thanks.

> Dave

Thanks,
Yueyi

  reply	other threads:[~2018-11-30  3:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28  7:31 [PATCH v2] lzo: fix ip overrun during compress Yueyi Li
2018-11-28 13:52 ` David Sterba
2018-11-28 14:15   ` Willy Tarreau
2018-11-29 16:49   ` Dave Rodgman
2018-11-30  3:05     ` Yueyi Li [this message]
2018-11-30 12:20       ` Dave Rodgman
2018-12-03  2:46         ` Yueyi Li
2018-12-03  3:05           ` Yueyi Li
2018-12-04 10:20   ` Markus F.X.J. Oberhumer
2018-12-05  3:07     ` Yueyi Li
2018-12-06 15:03       ` Markus F.X.J. Oberhumer
2018-12-12  5:21         ` Yueyi Li
2018-12-12 12:35           ` Markus F.X.J. Oberhumer
2018-12-14 13:56             ` Richard Weinberger
2018-12-14 16:46               ` Kees Cook
2018-12-16 16:56                 ` Markus F.X.J. Oberhumer
2018-12-18  9:25                   ` Yueyi Li

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=SN1PR13MB030426DBA527C725AE28B5A9DFD30@SN1PR13MB0304.namprd13.prod.outlook.com \
    --to=liyueyi@live.com \
    --cc=dave.rodgman@arm.com \
    --cc=donb@securitymouse.com \
    --cc=dsterba@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus@oberhumer.com \
    --cc=nd@arm.com \
    --cc=w@1wt.eu \
    /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).