[Bug 1770480] Re: preadv2 test does not consider new flag from linux 4.16
Launchpad Bug Tracker
1770480 at bugs.launchpad.net
Mon Nov 2 18:40:35 UTC 2020
This bug was fixed in the package glibc - 2.27-3ubuntu1.3
---------------
glibc (2.27-3ubuntu1.3) bionic; urgency=medium
[ Balint Reczey ]
* debian/gbp.conf: Add initial configuration
* debian/control.in/main: Add Vcs-* pointing to Ubuntu packaging repository
* arm64: Enable searching shared libraries in atomics/ on LSE HW
* Ship arm64 variant with LSE support in libc6-lse (LP: #1885012)
* Run tests of libc6-lse on HW supporting LSE
* debian/patches/git-updates.diff: update from upstream stable branch
- pthread_cond_broadcast: Fix waiters-after-spinning case
- Fix SSe2-based memmove corrupting memory (CVE-2017-18269)
- Fix strstr() performance regression on Haswell processors
- Support Japanese new era "令和 (Reiwa)"
- io: Remove copy_file_range emulation
(LP: #1851263, #1858203, #1838327, #1797335, #1756209, #1853193)
* XFAIL stdlib/tst-getrandom (LP: #1891403)
* debian/testsuite-xfail-debian.mk: XFAIL new tst-support_descriptors
[ Thadeu Lima de Souza Cascardo ]
* tests: Make preadwritev2 invalid flags tests unsupported (LP: #1770480)
[ Andreas Hasenack ]
* branch-pthread_rwlock_trywrlock-hang-23844.patch:
nptl: Fix pthread_rwlock_try*lock stalls (Bug 23844) (LP: #1864864)
-- Balint Reczey <rbalint at ubuntu.com> Wed, 02 Sep 2020 11:18:37 +0200
** Changed in: glibc (Ubuntu Bionic)
Status: Fix Committed => Fix Released
** CVE added: https://cve.mitre.org/cgi-bin/cvename.cgi?name=2017-18269
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1770480
Title:
preadv2 test does not consider new flag from linux 4.16
Status in glibc package in Ubuntu:
Fix Released
Status in glibc source package in Bionic:
Fix Released
Status in glibc source package in Cosmic:
Fix Released
Bug description:
[Impact]
When tested against newer versions of linux, glibc tests will fail as it makes some assumptions about supportead features on the kernel.
[Fix]
Ignore "invalid" (rather unknown) flags success as failure, instead exiting as unsupported (equivalent to skip).
[Test case]
Build glibc and run its tests on linux 5.3.
[Regression potential]
The same test is being ignored right now, we risk ignoring a failure on an older version of linux, like 4.15. However, that could happen because the feature is backported to said kernel. And we are currently ignoring the failure anyway.
======================================
https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-cosmic-canonical-kernel-team-bootstrap/cosmic/arm64/g/glibc/20180510_173125_32961@/log.gz
FAIL: misc/tst-preadvwritev2
original exit status 1
error: tst-preadvwritev2-common.c:45: preadv2 did not fail with an invalid flag
error: 1 test failures
----------
----------
FAIL: misc/tst-preadvwritev64v2
original exit status 1
error: tst-preadvwritev2-common.c:45: preadv2 did not fail with an invalid flag
error: 1 test failures
This is testing for the flag immediately after the last known flag.
So, if it's 0x8, it's going to test for 0x10.
The test snippet:
int invalid_flag = RWF_SUPPORTED != 0 ? __builtin_clz (RWF_SUPPORTED) : 2;
invalid_flag = 0x1 << ((sizeof (int) * CHAR_BIT) - invalid_flag);
char buf[32];
const struct iovec vec = { .iov_base = buf, .iov_len = sizeof (buf) };
if (preadv2 (temp_fd, &vec, 1, 0, invalid_flag) != -1)
FAIL_EXIT1 ("preadv2 did not fail with an invalid flag");
However, linux 4.16 has introduced RWF_APPEND.
commit e1fc742e14e01d84d9693c4aca4ab23da65811fb
Author: Jürg Billeter <j at bitron.ch>
Date: Fri Sep 29 14:07:17 2017 +0200
fs: add RWF_APPEND
---
+/* per-IO O_APPEND */
+#define RWF_APPEND ((__force __kernel_rwf_t)0x00000010)
+
/* mask of flags supported by the kernel */
-#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT)
+#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
+ RWF_APPEND)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1770480/+subscriptions
More information about the foundations-bugs
mailing list