From patchwork Thu Feb 7 10:18:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 1037933 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43wDnX2cXdz9sMM for ; Thu, 7 Feb 2019 21:19:26 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C481A294A7B for ; Thu, 7 Feb 2019 11:19:20 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id EBE703EA141 for ; Thu, 7 Feb 2019 11:19:16 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id B3C841401DBC for ; Thu, 7 Feb 2019 11:19:15 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0D321AD12; Thu, 7 Feb 2019 10:19:14 +0000 (UTC) From: Richard Palethorpe To: ltp@lists.linux.it Date: Thu, 7 Feb 2019 11:18:35 +0100 Message-Id: <20190207101835.641-1-rpalethorpe@suse.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190202001727.13269-1-smuckle@google.com> References: <20190202001727.13269-1-smuckle@google.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Cc: pvorel@suse.com, Richard Palethorpe Subject: [LTP] [PATCH] ustat: Fix EFAULT in 32bit compatability mode X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" This test fails with -m32 on Intel because the user land dev_num is too large. Signed-off-by: Richard Palethorpe --- From looking at glibc, this test may also be broken on mips, but I am not sure if that matters. AFAICT on all other platforms glibc always casts to uint after performing a sanity check.. testcases/kernel/syscalls/ustat/ustat01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c index 3f1186c49..2e7dcc9d7 100644 --- a/testcases/kernel/syscalls/ustat/ustat01.c +++ b/testcases/kernel/syscalls/ustat/ustat01.c @@ -20,7 +20,7 @@ void run(void) { struct ustat ubuf; - TEST(tst_syscall(__NR_ustat, dev_num, &ubuf)); + TEST(tst_syscall(__NR_ustat, (unsigned int)dev_num, &ubuf)); if (TST_RET == -1) tst_res(TFAIL | TTERRNO, "ustat(2) failed");