From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJeSQ-0007Fc-TB for qemu-devel@nongnu.org; Thu, 14 Jan 2016 04:44:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJeSN-00050H-LU for qemu-devel@nongnu.org; Thu, 14 Jan 2016 04:44:42 -0500 Received: from mail113-249.mail.alibaba.com ([205.204.113.249]:50627 helo=us-alimail-mta1.hst.scl.en.alidc.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJeSN-0004zx-6w for qemu-devel@nongnu.org; Thu, 14 Jan 2016 04:44:39 -0500 References: <1452752664-11818-1-git-send-email-chengang@emindsoft.com.cn> <5697593A.5020304@vivier.eu> <569763EF.3010702@emindsoft.com.cn> <56976603.3090805@vivier.eu> <56976C49.20705@emindsoft.com.cn> <56976D45.8060306@vivier.eu> From: Chen Gang Message-ID: <56976DFF.8030003@emindsoft.com.cn> Date: Thu, 14 Jan 2016 17:44:31 +0800 MIME-Version: 1.0 In-Reply-To: <56976D45.8060306@vivier.eu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] linux-user/syscall.c: Let lv always match val in do_getsockopt() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , riku.voipio@iki.fi Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, rth@twiddle.net On 2016年01月14日 17:41, Laurent Vivier wrote: > > Le 14/01/2016 10:37, Chen Gang a écrit : >> >> On 2016年01月14日 17:10, Laurent Vivier wrote: >>> >>> Le 14/01/2016 10:01, Chen Gang a écrit : >>>> >>>> I am not quite sure whether kernel always returns sizeof(int) (I guess, >>>> it should be). >>> >>> it can be 1 only if len is 1, but this is managed below. >>> >> >> Excuse me, I do not quite understand your meaning. >> >> For me, if we are sure lv is always 4 for SO_TYPE, we don't need this >> patch. >> >> If lv may be 1 for SO_TYPE (it means val >> 8 may be zero), after call >> host_to_target_sock_type, val >> 8 may be non-zero, theoretically. In >> this case, we need modify lv to 4. >> >>>> For me, if you are sure, we can skip this patch. >>> >>> Does it fix something ? >>> >> >> It is only theoretical, not real world, at present. > > So I think we can skip it. > It is OK to me. Thanks. -- Chen Gang (陈刚) Open, share, and attitude like air, water, and life which God blessed