From patchwork Thu Oct 12 15:30:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 115640 Delivered-To: patches@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2070633qgn; Thu, 12 Oct 2017 08:30:45 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TJteIovXrSLj772PC7daH5HphUG78ZPuAQD8bhIgZkcRQ1cU6jFtLpHAt7dDyLKoQcaMbI X-Received: by 10.46.29.65 with SMTP id d62mr283963ljd.139.1507822245034; Thu, 12 Oct 2017 08:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507822245; cv=none; d=google.com; s=arc-20160816; b=scGGcoLQPZBcCea59OofXg0gwxsOEB8RX9osi1acMcQmX9ZTo/gZtXB4XmW9rPSLPT L9E5ZH72A0+DNv0SmplXuu7r2F67Z7vgQFygkOfhyucB7GwDgYSOaJwJvwbnzz0oDWgQ iAXwj1QZ9XY7YmLqW9YCXEWbyXWF7Pq/Kk9YZzzq7E6AZ4NOWrrELzquzJAHo4XCfC8i rLlyo1a1Ay7naXnVG8IqG6FW7ry6bPaOrCArH1/1tNAu76NGLrv0JMMHQueafoS7iwxU +89+9I1QOlTvWo98gWCOVVKAcM4QxhKglhDy2P+tLE63w0FoZAPQFfn1lVfMrymEmfV/ x/PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=r1oBAXhDqahLj/X52sgidhsl+B6NqSM8ZHdC2UmDFA0=; b=XO/FqLReB45QJfhGDs4cLJMQmy5ZJcMatGdBY+ZQjg+VOWOjDiZ+H5Zjl2pzEseCod oRCZYcjhUfKlllMqge0PdXTeHY0R7VuWoEuflStuOT8iiPzqIIU0IO2Fg1St4v/bamZb 76Xr9t+PlfZHhhEOcNLGdLHHrAeQD27HFftg8L7YVZG2dP0zSKV2nQkaEZdnF6bNVwlX YKwLA/VGi/opvv/XFUN0JhIc/5JSOcfak9Z1HOYAAjmdOqg27dUhryoYCTq9SJ8Ps7lz WNNHBakijw9xUj/S16CyfKhcSnWpbJR9+8wCWKhfvj0m+djUCMLsNtnDkpchgHIYiQt+ wlBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id v1si7731557ljd.302.2017.10.12.08.30.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 08:30:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1e2fRZ-0000Ws-Do; Thu, 12 Oct 2017 16:30:41 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Riku Voipio , Laurent Vivier , pgndev Subject: [PATCH 1/2] linux-user: Fix target FS_IOC_GETFLAGS and FS_IOC_SETFLAGS numbers Date: Thu, 12 Oct 2017 16:30:44 +0100 Message-Id: <1507822245-15748-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507822245-15748-1-git-send-email-peter.maydell@linaro.org> References: <1507822245-15748-1-git-send-email-peter.maydell@linaro.org> We were defining TARGET_FS_IOC_GETFLAGS and TARGET_FS_IOC_SETFLAGS using the host 'long' type in the size field, which meant that they had the wrong values if the host and guest had different sized longs. Switch to abi_long instead. This fixes a bug where these ioctls don't work on 32-bit guests on 64-bit hosts (and makes the LTP test 'setxattr03' pass where it did not previously.) Reported-by: pgndev Signed-off-by: Peter Maydell --- linux-user/syscall_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 Reviewed-by: Laurent Vivier diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 40c5027..f7cc9f9 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1101,8 +1101,8 @@ struct target_pollfd { /* Note that the ioctl numbers claim type "long" but the actual type * used by the kernel is "int". */ -#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, long) -#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, long) +#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, abi_long) +#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, abi_long) #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap)