Received: from eggs.gnu.org ([2001:4830:134:3::10]:36921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHv21-0002T0-Ca for qemu-devel@nongnu.org; Mon, 24 Feb 2014 07:53:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHv1u-0007DQ-36 for qemu-devel@nongnu.org; Mon, 24 Feb 2014 07:53:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHv1t-0007DJ-Q5 for qemu-devel@nongnu.org; Mon, 24 Feb 2014 07:53:06 -0500 From: Markus Armbruster References: <52EF68CA.9060604@gmail.com> <20140203103429.GB10408@redhat.com> <52EF71DC.3000309@gmail.com> <52F0C8BA.7020709@gmail.com> <20140204110631.GD5632@redhat.com> <52F0CD67.5070601@gmail.com> <87siry3l7t.fsf@linux.vnet.ibm.com> <52F17B5E.1050602@gmail.com> <52FF3182.9090106@gmail.com> <53097D8E.1030803@gmail.com> <87sir850ho.fsf@blackfin.pond.sub.org> Date: Mon, 24 Feb 2014 13:52:58 +0100 In-Reply-To: (Gang Chen's message of "Mon, 24 Feb 2014 19:16:44 +0800") Message-ID: <87ha7o3c5x.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] hw/9pfs: use g_strdup_printf() instead of PATH_MAX limitation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gang Chen Cc: "Aneesh Kumar K.V" , aliguori@amazon.com, QEMU Developers Gang Chen writes: > Firstly, thank you very much for your reviewing. :-) > > On 02/24/2014 05:22 PM, Markus Armbruster wrote: >> Chen Gang writes: >> >>> When path is truncated by PATH_MAX limitation, it causes QEMU to access >>> incorrect file. So use original full path instead of PATH_MAX within >>> 9pfs (need check/process ENOMEM for related memory allocation). >>> >>> Also find/fix several another related issues when failure occurs. >>> >>> - check 'fh' in handle_name_to_path(). >>> > > As you said at the bottom, it is not an issue, need be skipped. > >>> - need call v9fs_string_free() at 'err_out:' in local_unlinkat(). >>> >>> - sprintf() will cause memory overflow in "virtio-9p-local.c" >> >> Sound like distinct bugs. Have you considered fixing them in separate >> patches for easier review and clearer commit messages? >> > > OK, I will/should separate them, but I have to send them (the 2 patches > for 2 issues above) firstly, then send this patch (total 3 patches). > >> > [...] >> Can't happen, because g_malloc() returns NULL only when its argument is >> zero. Many more instances below, also with other memory allocation >> functions, such as g_strdup_printf(). Please clean up and resubmit. >> > > OK, thank you, I will/should clean up and resubmit. > > Excuse me, I have no enough time resources during work day, so I > will/should send the patches within week end (2014-03-02). If we can not > bear the time point, please help send the patches for me. Next weekend should be fine. Happy hacking!