From aa891330baca4c28f9afd70baa478ef2cc8f4131 Mon Sep 17 00:00:00 2001 From: Jerry Jelinek Date: Mon, 22 Jun 2015 18:53:43 +0000 Subject: OS-4446 capget version probing incorrect --- usr/src/lib/brand/lx/lx_brand/common/capabilities.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'usr/src') diff --git a/usr/src/lib/brand/lx/lx_brand/common/capabilities.c b/usr/src/lib/brand/lx/lx_brand/common/capabilities.c index 81f3bbddb4..2b46041547 100644 --- a/usr/src/lib/brand/lx/lx_brand/common/capabilities.c +++ b/usr/src/lib/brand/lx/lx_brand/common/capabilities.c @@ -359,6 +359,14 @@ lx_capget(uintptr_t p1, uintptr_t p2) cap_count = 2; break; default: + /* + * As per the man page: call will fail with EINVAL and set the + * version field of the header to the kernel preferred version + * when an unsupported version value is provided. + */ + uh.version = LX_CAP_VERSION_3; + if (uucopy(&uh, uhp, sizeof (uh)) != 0) + return (-errno); return (-EINVAL); } -- cgit v1.2.3