From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from aserp2130.oracle.com ([141.146.126.79]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fDFAD-0004FS-TI for speck@linutronix.de; Mon, 30 Apr 2018 22:12:46 +0200 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3UKB5Pa053585 for ; Mon, 30 Apr 2018 20:12:39 GMT Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2hmeg5nr1r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Apr 2018 20:12:39 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3UKCcnU005655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Apr 2018 20:12:38 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3UKCcI4016101 for ; Mon, 30 Apr 2018 20:12:38 GMT Date: Mon, 30 Apr 2018 16:12:36 -0400 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [patch V8 13/15] SSB 13 Message-ID: <20180430201236.GB18631@char.us.oracle.com> References: <20180430150423.180110059@linutronix.de> <20180430151232.853543083@linutronix.de> MIME-Version: 1.0 In-Reply-To: <20180430151232.853543083@linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: ..snip.. > The common return values are: > ..snip.. > EUCLEAN The unused prctl() arguments are not 0 This EUCLEAN and this > @@ -2450,6 +2462,18 @@ SYSCALL_DEFINE5(prctl, int, option, unsi > case PR_SVE_GET_VL: > error = SVE_GET_VL(); > break; > + case PR_SET_SPECULATION_CTRL: > + if (arg4 || arg5) > + error = -EUCLEAN; > + else > + error = arch_prctl_set_spec_ctrl(arg2, arg3); > + break; > + case PR_GET_SPECULATION_CTRL: > + if (arg3 || arg4 || arg5) > + error = -EUCLEAN; Is interesting. The man page for prctl at length have: EINVAL option is PR_SET_NO_NEW_PRIVS and arg2 is not equal to 1 or arg3, arg4, or arg5 is nonzero. EINVAL option is PR_GET_NO_NEW_PRIVS and arg2, arg3, arg4, or arg5 is nonzero. EINVAL option is PR_SET_THP_DISABLE and arg3, arg4, or arg5 is nonzero. EINVAL option is PR_GET_THP_DISABLE and arg2, arg3, arg4, or arg5 is nonzero. and so on. Perhaps it would make sense to align the return code to be EINVAL for the check against the other arguments? > + else > + error = arch_prctl_get_spec_ctrl(arg2); > + break; > default: > error = -EINVAL; > break; >