Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3876729ybi; Fri, 19 Jul 2019 10:34:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwbt1ikVpiDiJOK7qX4OUJkEBqkokrfLShklr7ctp0QWYNGf6ag7zytRjI2xeLCBVBqnJj X-Received: by 2002:a63:ff66:: with SMTP id s38mr55882335pgk.363.1563557667136; Fri, 19 Jul 2019 10:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563557667; cv=none; d=google.com; s=arc-20160816; b=hGpjNMK/nPRfhxP8HcL4Y/MDC6XlxEffX7+Urr/6kEF6m3TqFNeQvml3/R/fM5gOrI eeNaFIRvN+/goxbyVBh6UdLYIBFB4udftn6qMH04m/VSNMTOWWYxWc/FiiBYBE3bQEo2 gA5SmnOl3IYCTX1AA7soLxK9HzUE+LDlzfhpPUEzyza4u3X3T4zxCwpSBn0palkDe1is CA7IIgKNU6nDPSwoomRvpq2BCOrANNQfdZfHwGG6+ZESF477LhDErXc//0/w9y9fG4O4 DCpcJZGxZLY7TlzHTIu6bnREVdS+OypItrSU4g8w2qkEZqZ0FaML1CYvq3CHz+WGgTPY EpvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=YIY4/zfYxollRDtSZOzBx6tiTF3RMSnUivhLnIBKBeU=; b=s+RM+NHkcGUZfC+3mEme8wZJ50ZywPQ9CEGWQyL8HphcWHqPj7cBbALv0dvQq7171N wjIgOyM5qg0JX7ekxDj3BHshldzlOu8fvuXeo92BYoD1gWek1bXD0bCvv24XJfgrbqpj uyYNqSxyU1625x1bkLUFXJnuX/YAPx7JrMK+ke9BqdzhyCZ6sbfIQQlmISRk6v01azQM /8K7UhpSMmopUqhZv3cIZatA7fgolBe1TTnJ1bZ6EYieb4pK/rxEUg/iHOwXx7OWKn7d EYRJ3scGQoF5xE+cWa24kWl398YyTd80TM71NbzCPAp3NiL0RUG7DevDGgGBbf2PCK2e z1Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si1438154plz.201.2019.07.19.10.34.11; Fri, 19 Jul 2019 10:34:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730685AbfGSRDp (ORCPT + 99 others); Fri, 19 Jul 2019 13:03:45 -0400 Received: from mga09.intel.com ([134.134.136.24]:43190 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727972AbfGSRDp (ORCPT ); Fri, 19 Jul 2019 13:03:45 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 10:03:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,283,1559545200"; d="scan'208";a="170185090" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.165]) by fmsmga007.fm.intel.com with ESMTP; 19 Jul 2019 10:03:44 -0700 Date: Fri, 19 Jul 2019 10:03:44 -0700 From: Sean Christopherson To: Thomas Gleixner , Andy Lutomirski , Vincenzo Frascino Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: [5.2 REGRESSION] Generic vDSO breaks seccomp-enabled userspace on i386 Message-ID: <20190719170343.GA13680@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The generic vDSO implementation, starting with commit 7ac870747988 ("x86/vdso: Switch to generic vDSO implementation") breaks seccomp-enabled userspace on 32-bit x86 (i386) kernels. Prior to the generic implementation, the x86 vDSO used identical code for both x86_64 and i386 kernels, which worked because it did all calcuations using structs with naturally sized variables, i.e. didn't use __kernel_timespec. The generic vDSO does its internal calculations using __kernel_timespec, which in turn requires the i386 fallback syscall to use the 64-bit variation, __NR_clock_gettime64. Using __NR_clock_gettime64 instead of __NR_clock_gettime breaks userspace applications that use seccomp filtering to block syscalls, as applications are completely unaware of the newly added of __NR_clock_gettime64, e.g. sshd gets zapped on syscall(403) when attempting to ssh into the system. I can fudge around the issue easily enough, but I have no idea how to fix this properly without duplicating __cvdso_clock_gettime, do_hres, etc..., especially now that the i386 vDSO exposes __vdso_clock_gettime64().