From: Chen Gang <gang.chen@asianux.com>
To: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
Greg KH <gregkh@linuxfoundation.org>,
zhangyanfei@cn.fujitsu.com,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linux-Arch <linux-arch@vger.kernel.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>Thomas Gleixner
<tglx@linutronix.de>
Subject: Re: [PATCH] arch: x86: platform: mrst: pr_err() need notice that 'sdev->modalias' may not a NUL terminated string.
Date: Mon, 27 May 2013 16:16:41 +0800 [thread overview]
Message-ID: <51A31669.7080309@asianux.com> (raw)
In-Reply-To: <20130527070634.GA1494@breakpoint.cc>
On 05/27/2013 03:06 PM, Sebastian Andrzej Siewior wrote:
> On Sun, May 26, 2013 at 04:50:22PM +0800, Chen Gang wrote:
>> >
>> > According to the areas which use "%16.16s" within this file, the
>> > 'sdev->modalias' may not always be a NUL terminated string.
>> >
>> > So need use "%.16s" instead of "%s" in pr_err(), or may cause issue.
> No. spi_match_id() expects a NULL terminated string and I would be suprised if
> it would be otherwise. Therefore moorsetown or this files has to learn to NULL
> terminate its strings.
>
In spi_match_id(), it is 'spi_device', not 'spi_board_info'. ;-)
But all together, it is my fault, the original implementation has no
issue: "I treated SFI_NAME_LEN as SPI_NAME_LEN when strncpy()".
BTW: 'pentry->name' in sfi_parse_devs() may not always be a NUL
terminated string, could you give a check, too ? ;-)
Thanks.
--
Chen Gang
Asianux Corporation
WARNING: multiple messages have this Message-ID (diff)
From: Chen Gang <gang.chen@asianux.com>
To: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
"mingo@redhat.com" <mingo@redhat.com>,
Greg KH <gregkh@linuxfoundation.org>,
zhangyanfei@cn.fujitsu.com,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linux-Arch <linux-arch@vger.kernel.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] arch: x86: platform: mrst: pr_err() need notice that 'sdev->modalias' may not a NUL terminated string.
Date: Mon, 27 May 2013 16:16:41 +0800 [thread overview]
Message-ID: <51A31669.7080309@asianux.com> (raw)
In-Reply-To: <20130527070634.GA1494@breakpoint.cc>
On 05/27/2013 03:06 PM, Sebastian Andrzej Siewior wrote:
> On Sun, May 26, 2013 at 04:50:22PM +0800, Chen Gang wrote:
>> >
>> > According to the areas which use "%16.16s" within this file, the
>> > 'sdev->modalias' may not always be a NUL terminated string.
>> >
>> > So need use "%.16s" instead of "%s" in pr_err(), or may cause issue.
> No. spi_match_id() expects a NULL terminated string and I would be suprised if
> it would be otherwise. Therefore moorsetown or this files has to learn to NULL
> terminate its strings.
>
In spi_match_id(), it is 'spi_device', not 'spi_board_info'. ;-)
But all together, it is my fault, the original implementation has no
issue: "I treated SFI_NAME_LEN as SPI_NAME_LEN when strncpy()".
BTW: 'pentry->name' in sfi_parse_devs() may not always be a NUL
terminated string, could you give a check, too ? ;-)
Thanks.
--
Chen Gang
Asianux Corporation
next prev parent reply other threads:[~2013-05-27 8:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-26 8:50 [PATCH] arch: x86: platform: mrst: pr_err() need notice that 'sdev->modalias' may not a NUL terminated string Chen Gang
2013-05-27 7:06 ` Sebastian Andrzej Siewior
2013-05-27 8:16 ` Chen Gang [this message]
2013-05-27 8:16 ` Chen Gang
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=51A31669.7080309@asianux.com \
--to=gang.chen@asianux.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=sebastian@breakpoint.cc \
--cc=tglx@linutronix.de \
--cc=zhangyanfei@cn.fujitsu.com \
/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.