From patchwork Wed Oct 17 04:17:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 985091 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Zf7k3Ppcz9sBN; Wed, 17 Oct 2018 15:18:58 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1gCdIH-0004Tk-Jp; Wed, 17 Oct 2018 04:18:49 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1gCdIF-0004So-5X for kernel-team@lists.ubuntu.com; Wed, 17 Oct 2018 04:18:47 +0000 Received: from mail-pf1-f197.google.com ([209.85.210.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1gCdHM-0002DD-LA for kernel-team@lists.ubuntu.com; Wed, 17 Oct 2018 04:17:52 +0000 Received: by mail-pf1-f197.google.com with SMTP id y73-v6so12022816pfi.16 for ; Tue, 16 Oct 2018 21:17:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=96onjvP42iBtMs4QlNcMtz9atvYQtphr2oxi0Vsszps=; b=RyrE2JhRv+2WyenrTU67S56oKn9EGb0hKyIVBv4H+g9rp4ScAk959SGtLAxieEP+Ff T0BRzLUYxT6vPbtfIj8QS9O3HUQbj8svyC+8tjrC7dJ40BIoDjuNYdGF9pLIZ21cx1O4 7iYPeLGok1qmjZAK556a941jCCoAdWYpgwLKOaIqTpHmH4olgGiJYaYODc0YjktP/p/t Yh2Pcl+1SS7NOrigh2LdUQ+IsWq3yahufmx+lyWSuhPFDNtiY5VPC+z5I5+0UjtFHPd9 EunZxg9/8zJRRQs8IUXBzfSvWgvMb2KHBHAEtvK+8ko0zLmhEDMMi2FEB8T2OFsJ9qDz Lgnw== X-Gm-Message-State: ABuFfojFSSJW4cR/sUbVvB2NADfHD+ct3p7zkqjk5uJDdkDBOr+bu2Zd /iFivs1VLHbLS51F+PqrQqWRdbTxeP9/UjU2TE+uMEJmbqRZurHsg1783XEQI5r+bcP3uX2IGVr wvLPpb0moXvc4C7L1pGST3XGF8AV6/Sv632c7NCHq X-Received: by 2002:a63:2483:: with SMTP id k125-v6mr22847855pgk.287.1539749870876; Tue, 16 Oct 2018 21:17:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV620kWkJmDbjdKgk1oaUZMzI3k6vyOtLcaIMLIR8Tv37Bzn2MBfX2220QU2AzJt5Gk9SyB23Cg== X-Received: by 2002:a63:2483:: with SMTP id k125-v6mr22847841pgk.287.1539749870624; Tue, 16 Oct 2018 21:17:50 -0700 (PDT) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id t22-v6sm23116423pfk.141.2018.10.16.21.17.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Oct 2018 21:17:49 -0700 (PDT) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [Trusty][SRU][PATCH 0/1] getxattr: use correct xattr length Date: Wed, 17 Oct 2018 12:17:43 +0800 Message-Id: <20181017041744.1232-1-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" == Justification == This issue has been addressed in bug 1789746 for other kernels. When the getxattr05 test in ubuntu_ltp_syscalls test suite, the test will failed with: tag=getxattr05 stime=1539663573 cmdline="getxattr05" contacts="" analysis=exit <<>> incrementing stop tst_test.c:1072: INFO: Timeout per run is 0h 05m 00s getxattr05.c:85: PASS: Got same data when acquiring the value of system.posix_acl_access twice getxattr05.c:80: FAIL: Got different data(00 != ffffffff) at 16 getxattr05.c:85: PASS: Got same data when acquiring the value of system.posix_acl_access twice Summary: passed 2 failed 1 skipped 0 warnings 0 This is caused by posix_acl_fix_xattr_to_user() being passed the total buffer size and not the actual size of the xattr as returned by vfs_getxattr(). == Fix == 82c9a927bc5d ("getxattr: use correct xattr length") A test kernel for Trusty could be found here: http://people.canonical.com/~phlin/kernel/lp-1798013-getxattr05/ == Regression Potential == Low, this one-liner fix just passes the actual length of the xattr as returned by vfs_getxattr() down. == Test Case == Run the getxattr05 test in ubuntu_ltp_syscalls test suite. And it will pass with the patched kernel. Christian Brauner (1): getxattr: use correct xattr length fs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)