From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752132AbaANTfg (ORCPT ); Tue, 14 Jan 2014 14:35:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20375 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbaANTfd (ORCPT ); Tue, 14 Jan 2014 14:35:33 -0500 Date: Tue, 14 Jan 2014 14:35:08 -0500 From: Vivek Goyal To: linux kernel mailing list , Andrew Morton Cc: Kexec Mailing List , Greg KH Subject: Re: [PATCH] kdump: Fix exported size of vmcoreinfo note Message-ID: <20140114193508.GM3096@redhat.com> References: <20140114193311.GL3096@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140114193311.GL3096@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CCed to old mail id of Greg. Fixing it. On Tue, Jan 14, 2014 at 02:33:11PM -0500, Vivek Goyal wrote: > Right now we seem to be exporting the max data size contained inside > vmcoreinfo note. But this does not include the size of meta data around > vmcore info data. Like name of the note and starting and ending elf_note. > > I think user space expects total size and that size is put in PT_NOTE > elf header. Things seem to be fine so far because we are not using > vmcoreinfo note to the maximum capacity. But as it starts filling up, > to capacity, at some point of time, problem will be visible. > > Signed-off-by: Vivek Goyal > --- > kernel/ksysfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: linux-2.6/kernel/ksysfs.c > =================================================================== > --- linux-2.6.orig/kernel/ksysfs.c 2014-01-14 14:09:42.107767503 -0500 > +++ linux-2.6/kernel/ksysfs.c 2014-01-14 14:15:24.385510314 -0500 > @@ -126,7 +126,7 @@ static ssize_t vmcoreinfo_show(struct ko > { > return sprintf(buf, "%lx %x\n", > paddr_vmcoreinfo_note(), > - (unsigned int)vmcoreinfo_max_size); > + (unsigned int)sizeof(vmcoreinfo_note)); > } > KERNEL_ATTR_RO(vmcoreinfo); >