From: Joe Perches <joe@perches.com>
To: Christian Lamparter <chunkeey@googlemail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Jiri Slaby <jslaby@suse.cz>, Kalle Valo <kvalo@codeaurora.org>
Subject: Re: [PATCH 4.9 01/12] p54: memset(0) whole array
Date: Sun, 03 Sep 2017 08:07:51 -0700 [thread overview]
Message-ID: <1504451271.31325.7.camel@perches.com> (raw)
In-Reply-To: <8363580.vTBpPrDd2o@debian64>
On Sun, 2017-09-03 at 14:32 +0200, Christian Lamparter wrote:
> On Saturday, September 2, 2017 8:51:01 AM CEST Joe Perches wrote:
> > On Thu, 2017-08-31 at 09:40 -0700, Joe Perches wrote:
> > > On Thu, 2017-08-31 at 17:44 +0200, Greg Kroah-Hartman wrote:
> > > > 4.9-stable review patch. If anyone has any objections, please let me know.
[]
> > > > +++ b/drivers/net/wireless/intersil/p54/fwio.c
> > > > @@ -488,7 +488,7 @@ int p54_scan(struct p54_common *priv, u1
> > > >
> > > > entry += sizeof(__le16);
> > > > chan->pa_points_per_curve = 8;
> > > > - memset(chan->curve_data, 0, sizeof(*chan->curve_data));
> > > > + memset(chan->curve_data, 0, sizeof(chan->curve_data));
> > > > memcpy(chan->curve_data, entry,
> > > > sizeof(struct p54_pa_curve_data_sample) *
> > > > min((u8)8, curve_data->points_per_channel));
> > > >
>
> > > Why is this change correct?
> > >
> > > curve_data is a pointer.
> > >
> > > This now clears the sizeof a pointer and not
> > > the sizeof struct p54_cal_database
> >
> > So what happens here?
> > This change seems clearly incorrect.
> > For all stable versions.
>
> hm?
>
> Please, just look again at [0]:
[]
> yes: "curve_data" is a pointer.
Thank you.
My mistake, curve_data here is an array of structs.
> This means that chan->curve_data is 64 bytes in total.
I saw only:
drivers/net/wireless/intersil/p54/p54.h: struct p54_cal_database *curve_data;
and did not notice
drivers/net/wireless/intersil/p54/lmac.h: struct p54_pa_curve_data_sample curve_data[8];
WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Christian Lamparter <chunkeey@googlemail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Jiri Slaby <jslaby@suse.cz>, Kalle Valo <kvalo@codeaurora.org>
Subject: Re: [PATCH 4.9 01/12] p54: memset(0) whole array
Date: Sun, 03 Sep 2017 08:07:51 -0700 [thread overview]
Message-ID: <1504451271.31325.7.camel@perches.com> (raw)
In-Reply-To: <8363580.vTBpPrDd2o@debian64>
On Sun, 2017-09-03 at 14:32 +0200, Christian Lamparter wrote:
> On Saturday, September 2, 2017 8:51:01 AM CEST Joe Perches wrote:
> > On Thu, 2017-08-31 at 09:40 -0700, Joe Perches wrote:
> > > On Thu, 2017-08-31 at 17:44 +0200, Greg Kroah-Hartman wrote:
> > > > 4.9-stable review patch. If anyone has any objections, please let me know.
[]
> > > > +++ b/drivers/net/wireless/intersil/p54/fwio.c
> > > > @@ -488,7 +488,7 @@ int p54_scan(struct p54_common *priv, u1
> > > >
> > > > entry += sizeof(__le16);
> > > > chan->pa_points_per_curve = 8;
> > > > - memset(chan->curve_data, 0, sizeof(*chan->curve_data));
> > > > + memset(chan->curve_data, 0, sizeof(chan->curve_data));
> > > > memcpy(chan->curve_data, entry,
> > > > sizeof(struct p54_pa_curve_data_sample) *
> > > > min((u8)8, curve_data->points_per_channel));
> > > >
>
> > > Why is this change correct?
> > >
> > > curve_data is a pointer.
> > >
> > > This now clears the sizeof a pointer and not
> > > the sizeof struct p54_cal_database
> >
> > So what happens here?
> > This change seems clearly incorrect.
> > For all stable versions.
>
> hm?
>
> Please, just look again at [0]:
[]
> yes: "curve_data" is a pointer.
Thank you.
My mistake, curve_data here is an array of structs.
> This means that chan->curve_data is 64 bytes in total.
I saw only:
drivers/net/wireless/intersil/p54/p54.h:��������struct p54_cal_database *curve_data;
and did not notice
drivers/net/wireless/intersil/p54/lmac.h: struct p54_pa_curve_data_sample curve_data[8];
next prev parent reply other threads:[~2017-09-03 15:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 15:44 [PATCH 4.9 00/12] 4.9.47-stable review Greg Kroah-Hartman
2017-08-31 15:44 ` [PATCH 4.9 01/12] p54: memset(0) whole array Greg Kroah-Hartman
2017-08-31 16:40 ` Joe Perches
2017-09-02 15:51 ` Joe Perches
2017-09-03 12:32 ` Christian Lamparter
2017-09-03 15:07 ` Joe Perches [this message]
2017-09-03 15:07 ` Joe Perches
2017-08-31 15:44 ` [PATCH 4.9 02/12] scsi: isci: avoid array subscript warning Greg Kroah-Hartman
2017-08-31 15:44 ` [PATCH 4.9 03/12] staging: wilc1000: simplify vif[i]->ndev accesses Greg Kroah-Hartman
2017-08-31 15:44 ` [PATCH 4.9 04/12] gcov: support GCC 7.1 Greg Kroah-Hartman
2017-08-31 15:44 ` [PATCH 4.9 06/12] arm64: mm: abort uaccess retries upon fatal signal Greg Kroah-Hartman
2017-08-31 15:44 ` [PATCH 4.9 08/12] arm64: fpsimd: Prevent registers leaking across exec Greg Kroah-Hartman
2017-08-31 15:44 ` [PATCH 4.9 09/12] locking/spinlock/debug: Remove spinlock lockup detection code Greg Kroah-Hartman
2017-08-31 15:44 ` [PATCH 4.9 10/12] scsi: sg: protect accesses to reserved page array Greg Kroah-Hartman
2017-08-31 15:44 ` [PATCH 4.9 11/12] scsi: sg: reset res_in_use after unlinking reserved array Greg Kroah-Hartman
2017-08-31 16:45 ` [PATCH 4.9 00/12] 4.9.47-stable review Sumit Semwal
2017-08-31 16:59 ` Greg Kroah-Hartman
2017-08-31 19:08 ` Shuah Khan
2017-09-01 5:02 ` Greg Kroah-Hartman
2017-09-01 2:32 ` Guenter Roeck
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=1504451271.31325.7.camel@perches.com \
--to=joe@perches.com \
--cc=chunkeey@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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 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.