From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753604Ab3FCI4d (ORCPT ); Mon, 3 Jun 2013 04:56:33 -0400 Received: from intranet.asianux.com ([58.214.24.6]:64518 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751100Ab3FCI4b (ORCPT ); Mon, 3 Jun 2013 04:56:31 -0400 X-Spam-Score: -100.8 Message-ID: <51AC5A0E.4080408@asianux.com> Date: Mon, 03 Jun 2013 16:55:42 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Kyle McMartin CC: "James E.J. Bottomley" , Helge Deller , udknight@gmail.com, Greg KH , Parisc List , "linux-kernel@vger.kernel.org" , Linux-Arch Subject: Re: [PATCH] arch: parisc: kernel: using strlcpy() instead of strcpy() References: <51A6A8F3.2030200@asianux.com> <20130530153551.GN19205@redacted.bos.redhat.com> In-Reply-To: <20130530153551.GN19205@redacted.bos.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/30/2013 11:35 PM, Kyle McMartin wrote: > On Thu, May 30, 2013 at 09:18:43AM +0800, Chen Gang wrote: >> > >> > '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. >> > > This is basically impossible, since boot_args is fixed in size by palo, > initialized to zero, and length checked in the bootloader. It's also > only 256+4 bytes compared to the 1024 bytes set aside for > boot_command_line. > > That said, it's harmless to use strlcpy here, and obviously (more) > correct. Thanks! > OK, thanks. > Acked-by: Kyle McMartin > > Thank you. :-) -- Chen Gang Asianux Corporation