Return-path: Received: from mga02.intel.com ([134.134.136.20]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fCGz6-0002tD-NV for speck@linutronix.de; Sat, 28 Apr 2018 05:57:18 +0200 Subject: [MODERATED] Re: [PATCH v2] Linux Patch 1/1 References: <92c45587-5eb3-2421-6fc1-42e74a715e30@linux.intel.com> <20180427164743.GA14180@pd.tnic> <6e2b14fc-3bf6-071d-6ce2-e518f2c4f069@redhat.com> <20180427173221.GB14180@pd.tnic> <20180427180944.GD75137@tassilo.jf.intel.com> <85e5e716-bd80-30f5-d4fe-a9bf0601e6d8@linux.intel.com> <07ad1696-ef36-27ba-67b9-150f1d33b5e5@redhat.com> From: Tim Chen Message-ID: Date: Fri, 27 Apr 2018 20:57:12 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="t34Dq99rGitoLMmIEPU9wnZLcX5zyeIsE"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --t34Dq99rGitoLMmIEPU9wnZLcX5zyeIsE Content-Type: multipart/mixed; boundary="32iTXIoMP49VJaL4db3rRKWNi2npsxx0I" --32iTXIoMP49VJaL4db3rRKWNi2npsxx0I Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04/27/2018 01:37 PM, speck for Thomas Gleixner wrote: > On Fri, 27 Apr 2018, speck for Jon Masters wrote: >> Konrad and I are sitting here chatting in my office. We debated the >> enumeration for this. Do we think simply calling and getting an EINVAL= >> on older kernels is ok, or do we need a specific enumeration for the >> ability to control SSB from software? An enumeration would be nice. Yo= u >> might want to look to how the kernel handles MPX today to indicate >> whether the prctl implemented, and also whether runtime supported. >=20 > So if you looked at what I wrote earlier: >=20 > int arch_prctl_set_rds(struct task_struct *p, unsigned long val) > { > if (!spec_store_bypass_prctl) > return -ENOTSUPP; >=20 The ENOTSUPP is in include/linux/errno.h and not in userspace api, can we return that? There is a comment in the include/linux/errno.h that says: /* * These should never be seen by user programs.... and then=20 /* Defined for the NFSv3 protocol */ > That's exactly the point. If the (older or not updated) kernel does not= > support it then you get -EINVAL because thats the default for not > implemented prctls. >=20 > So if spec_store_bypass_prctl is not enabled you can return some other > error code and we surely can make that error code depend on the mitigat= ion > state and return -ENOTVULNERABLE or whatever is suitable. You mean add a new ENOTVULNERABLE error number? I can't seem to find errno. If I need to add this, which file should it go to? I'll keep the EINVAL temporarily in my patch till I can figure out the ENOTSUPP and ENOTVULNERABLE usage. Tim >=20 > And no, you don't need the MPX way because that mitigation stuff is > unconditional and cannot be compiled out. >=20 > Thanks, >=20 > tglx >=20 --32iTXIoMP49VJaL4db3rRKWNi2npsxx0I-- --t34Dq99rGitoLMmIEPU9wnZLcX5zyeIsE--