netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: bjorn@mork.no
Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	bodqhrohro@gmail.com, dennis.wassenberg@secunet.com,
	mrkiko.rs@gmail.com
Subject: Re: [PATCH net,stable] cdc_ncm: avoid padding beyond end of skb
Date: Fri, 08 Jun 2018 19:50:58 -0400 (EDT)	[thread overview]
Message-ID: <20180608.195058.2125743710867255476.davem@davemloft.net> (raw)
In-Reply-To: <20180608071524.11528-1-bjorn@mork.no>

From: Bjørn Mork <bjorn@mork.no>
Date: Fri,  8 Jun 2018 09:15:24 +0200

> Commit 4a0e3e989d66 ("cdc_ncm: Add support for moving NDP to end
> of NCM frame") added logic to reserve space for the NDP at the
> end of the NTB/skb.  This reservation did not take the final
> alignment of the NDP into account, causing us to reserve too
> little space. Additionally the padding prior to NDP addition did
> not ensure there was enough space for the NDP.
> 
> The NTB/skb with the NDP appended would then exceed the configured
> max size. This caused the final padding of the NTB to use a
> negative count, padding to almost INT_MAX, and resulting in:
 ...
> Commit e1069bbfcf3b ("net: cdc_ncm: Reduce memory use when kernel
> memory low") made this bug much more likely to trigger by reducing
> the NTB size under memory pressure.
> 
> Link: https://bugs.debian.org/893393
> Reported-by: Горбешко Богдан <bodqhrohro@gmail.com>
> Reported-and-tested-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
> Cc: Enrico Mioso <mrkiko.rs@gmail.com>
> Fixes: 4a0e3e989d66 ("cdc_ncm: Add support for moving NDP to end of NCM frame")
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
> ---
> Big thanks to Dennis for the observation that this crash depended on
> FLAG_SEND_ZLP not being set. This made it possible to pinpoint where
> the problem was.

Applied and queued up for -stable.

      reply	other threads:[~2018-06-08 23:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08  7:15 [PATCH net,stable] cdc_ncm: avoid padding beyond end of skb Bjørn Mork
2018-06-08 23:50 ` David Miller [this message]

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=20180608.195058.2125743710867255476.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bjorn@mork.no \
    --cc=bodqhrohro@gmail.com \
    --cc=dennis.wassenberg@secunet.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mrkiko.rs@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).