Linux Serial subsystem development
 help / color / mirror / Atom feed
From: "Alexander Shiyan" <shc_work@mail.ru>
To: cantona <cantona@cantona.net>
Cc: "Jiri Slaby" <jslaby@suse.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v2] serial: max310x: Fix out of bounds access
Date: Wed, 12 Aug 2015 12:46:05 +0300	[thread overview]
Message-ID: <1439372765.705411926@f362.i.mail.ru> (raw)
In-Reply-To: <CABJLtPHPCw7VN+wG4ApDxB-ZM7wRz_1xHfpNLL4o4_80JYyKaQ@mail.gmail.com>

> Среда, 12 августа 2015, 15:36 +08:00 от cantona <cantona@cantona.net>:
> 
> 
> added Alexander Shiyan < shc_work@mail.ru >.
> 
> On 12 August 2015 at 15:22, Su Kang Yin  < cantona@cantona.net > wrote:
> >Max310x driver supports up to 4 UART devices but array size of
> >"struct max310x_one" is set to 1. That leads to out of bounds
> >access on UART port registration.
> >
> >This patch fixed it by increase the array size to 4 which is
> >maximum supported UART.
> >
> >Signed-off-by: Su Kang Yin < cantona@cantona.net >
> >---
...

This seems incorrect. The number of ports is allocated dynamically by:
...
/* Alloc port structure */
s = devm_kzalloc(dev, sizeof(*s) + sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL);
...

Thanks.

---


  parent reply	other threads:[~2015-08-12  9:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12  7:22 [PATCH v2] serial: max310x: Fix out of bounds access Su Kang Yin
     [not found] ` <CABJLtPHPCw7VN+wG4ApDxB-ZM7wRz_1xHfpNLL4o4_80JYyKaQ@mail.gmail.com>
2015-08-12  9:46   ` Alexander Shiyan [this message]
2015-08-12 11:50     ` Kang Yin Su
2015-08-12 15:17       ` Greg Kroah-Hartman

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=1439372765.705411926@f362.i.mail.ru \
    --to=shc_work@mail.ru \
    --cc=cantona@cantona.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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