From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle McMartin Subject: Re: [PATCH] arch: parisc: kernel: using strlcpy() instead of strcpy() Date: Thu, 30 May 2013 11:35:51 -0400 Message-ID: <20130530153551.GN19205@redacted.bos.redhat.com> References: <51A6A8F3.2030200@asianux.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mx1.redhat.com ([209.132.183.28]:16689 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933196Ab3E3PgG (ORCPT ); Thu, 30 May 2013 11:36:06 -0400 Content-Disposition: inline In-Reply-To: <51A6A8F3.2030200@asianux.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Chen Gang Cc: "James E.J. Bottomley" , Helge Deller , udknight@gmail.com, Greg KH , Parisc List , "linux-kernel@vger.kernel.org" , Linux-Arch 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! Acked-by: Kyle McMartin