From: Chen Gang <gang.chen@asianux.com>
To: "James E.J. Bottomley" <jejb@parisc-linux.org>,
Helge Deller <deller@gmx.de>,
udknight@gmail.com
Cc: Greg KH <gregkh@linuxfoundation.org>,
Parisc List <linux-parisc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linux-Arch <linux-arch@vger.kernel.org>
Subject: [PATCH] arch: parisc: kernel: using strlcpy() instead of strcpy()
Date: Thu, 30 May 2013 09:18:43 +0800 [thread overview]
Message-ID: <51A6A8F3.2030200@asianux.com> (raw)
'boot_args' is an input args, and 'boot_command_line' has a fix length.
So need use strlcpy() instead of strcpy() to avoid memory overflow.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
arch/parisc/kernel/setup.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index 60c1ae6..7349a3f 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -69,7 +69,8 @@ void __init setup_cmdline(char **cmdline_p)
/* called from hpux boot loader */
boot_command_line[0] = '\0';
} else {
- strcpy(boot_command_line, (char *)__va(boot_args[1]));
+ strlcpy(boot_command_line, (char *)__va(boot_args[1]),
+ COMMAND_LINE_SIZE);
#ifdef CONFIG_BLK_DEV_INITRD
if (boot_args[2] != 0) /* did palo pass us a ramdisk? */
--
1.7.7.6
next reply other threads:[~2013-05-30 1:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 1:18 Chen Gang [this message]
2013-05-30 15:06 ` [PATCH] arch: parisc: kernel: using strlcpy() instead of strcpy() Wang YanQing
2013-06-03 8:50 ` Chen Gang
2013-05-30 15:35 ` Kyle McMartin
2013-06-03 8:55 ` 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=51A6A8F3.2030200@asianux.com \
--to=gang.chen@asianux.com \
--cc=deller@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=jejb@parisc-linux.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=udknight@gmail.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.