Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1271538imm; Tue, 22 May 2018 01:05:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqIhJLR3Xi9lHMMqn4KZbG4X+LjTvM26IT/0BQLbqUIwmbAjFJX8ezu+5Q+mOKT667WEsPu X-Received: by 2002:a63:894a:: with SMTP id v71-v6mr18716620pgd.423.1526976316942; Tue, 22 May 2018 01:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526976316; cv=none; d=google.com; s=arc-20160816; b=YYEdSED+Jf4wVn7DyIIjiqFDueCGe+sxos954V+JdJLtSslSps/S9bjsolB+xxF/An ASRJFRwVytsEWcftNpIcU2j2RVFWcpfTIWrMNCPT3GlfDQxefUbGRGCfHzV3aKrflSQl ItqL2yQv0w5UjMXN5wyK5+KK9qz4Ntw2VDEAcJeER4b+jMcVWzFPELqtR8Gnw+cfT+Kq xclMWeXZsKDCub0HuukbtSjoeskMrP7kltTU+EOySQjZGPD8UIoXvdydD8XopyYqp0B4 mPaUTWlc/S7dN+QXzssHqpj5bVYrQec1Q0lQjMahxWZ//sPfisPuzX5/yRv9YqEg46qc GujA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:reply-to:mime-version:dkim-signature :arc-authentication-results; bh=s+u7eN6Ae7wW4efXBpF1oNLqt4iNhQjrRuRQILGzgBg=; b=ZA1D53kzgW4PGtWH72+ySmQDQB5K77S4sd3sc2vRnMYBNzyFzxSYFnLprBCAUd16Tv B6hTUPYzYFzLU1HukhJJoQGvvOcVPUbGw6gonPqGb2gEaFnsGaxlcVNBopgfZcNgIB4X vvWsNIhErgeZjmFQSPmWRIDjbJ5s4wXAC9nrTct7DeM4eyqTPipjDSSFDuX5fRuR7u0U /D/DN5dMtHg9woUJHf8wk4wt1/eJqXhxJnMIvlmRzDFXuxQz7VVjf5osgYppVcXc2RMh psqvTSMW08lfPWdvsDOySe7AG2MfSFsZ5uUAAsVH8sjD4h1lsP19IPkjm25YfeZkApQN ktRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=THmL1My8; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a96-v6si15968589pla.169.2018.05.22.01.05.02; Tue, 22 May 2018 01:05:16 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=THmL1My8; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751214AbeEVIE7 (ORCPT + 99 others); Tue, 22 May 2018 04:04:59 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:33816 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbeEVIEz (ORCPT ); Tue, 22 May 2018 04:04:55 -0400 Received: by mail-lf0-f44.google.com with SMTP id x145-v6so15763305lff.1 for ; Tue, 22 May 2018 01:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=s+u7eN6Ae7wW4efXBpF1oNLqt4iNhQjrRuRQILGzgBg=; b=THmL1My8bYYQzUnnMex5ANJ4sghbfq1ZFkHTWrnpW36ITr2M9vnBgEC/yr9Fxfo3bP stltil7MGh/POq3Zq0DDMQmC+21oweMwp1NezOs0G88cMqSw7e2YiRCgSfIuKla8VGnE 5JvqG1r33/frdykOxpC+dK3IJsV38f9p7S6ZajRJ7iwfR7tfiKdzS4W1dgkMdDnTEKxU gmta1OBHOmhAIMk03UrKqf1U31Zr2kY/XT5dTuFDwd8qkIVRi1VvKaDN9Z5R7UaSaT37 8P6zVneh6Q4iwp02a+OlnsQZM0nmYysFu4FXFoXDrlgyqKWpbMwLqrJf5ffQQRl/EDEk 2Cmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=s+u7eN6Ae7wW4efXBpF1oNLqt4iNhQjrRuRQILGzgBg=; b=nYjtLiF2bWh+IondBc0PZotE+PP1XKtTByNd0qwyBgGVEHvtKSDY3QK5d9I/71ZV+Z L6QGt+PKYaX4QhzJw6Qogj2+Ie0UA9l/Wuqfg3W5FomyAP3UgxA7um1Nr1kOXl6bfRKu lrMZsTVd2yN8dzCxiXzKWbxoD0+M5hKFukqgmn9Kjg7Bm/CMs/9iBb9iOxyEVkO9ftWp oLyhT1My+JToEKpuiG35IYjcUs++py8NVdytTLj4xX2qrpbq47gNExa0tBND2tyMWoFP xg7cNr87cNWtQWWzY8o9uhMo/MqOpJurWN7w6FCP8orhGk6est+kt+ZI2qhdXDCEHy82 S5TA== X-Gm-Message-State: ALKqPwdYpjnfdrVqWOLRIW2/pr/Xhi/XhwFHOks7Pdu7W5bpEs7S/slb O3kg21bRjiYDYNjyMNU1/+rjF53DjWEayIr6LoYe1g== X-Received: by 2002:a2e:2a45:: with SMTP id q66-v6mr13934307ljq.40.1526976294135; Tue, 22 May 2018 01:04:54 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:ce89:0:0:0:0:0 with HTTP; Tue, 22 May 2018 01:04:53 -0700 (PDT) Reply-To: sedat.dilek@gmail.com In-Reply-To: References: <20180423174224.GA243180@google.com> <20180424230645.GB243180@google.com> <20180507174909.GF19594@google.com> From: Sedat Dilek Date: Tue, 22 May 2018 10:04:53 +0200 Message-ID: Subject: Re: Clang patch stacks for LTS kernels (v4.4 and v4.9) and status update To: Nick Desaulniers Cc: Matthias Kaehlcke , lkml , Arnd Bergmann , Manoj Gupta , AlistairStrachan , "Steven Rostedt (VMware)" Content-Type: multipart/mixed; boundary="00000000000097d0a8056cc6dfba" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000097d0a8056cc6dfba Content-Type: text/plain; charset="UTF-8" On Tue, May 22, 2018 at 9:39 AM, Sedat Dilek wrote: > On Sat, May 19, 2018 at 12:54 AM, Nick Desaulniers > wrote: >> Sedat, >> Thanks for the report. We have a fix ready in >> https://bugs.llvm.org/show_bug.cgi?id=37512. Can you report what >> version of clang you were using and if earlier versions of clang have >> this issue? >> Thanks, > > Can you give some advices on how to implement > "attribute((no_stack_protector))" for Clang? > > I looked on how this is done for GCC... > > [ include/linux/compiler-gcc.h ] > > #if GCC_VERSION >= 40400 > #define __optimize(level) __attribute__((__optimize__(level))) > #define __nostackprotector __optimize("no-stack-protector") > #endif /* GCC_VERSION >= 40400 */ > > [ include/linux/compiler_types.h ] > > #ifndef __nostackprotector > # define __nostackprotector > #endif > > LLVM-bug #37512 says: > > "GCC option for this is: attribute((optimize("no-stack-protector"))) > and the equivalent clang syntax would be: attribute((no_stack_protector))" > > So, there should be a define in "include/linux/compiler-clang.h" for this? > > [ include/linux/compiler-clang.h ] > > #define __nostackprotector attribute((no_stack_protector)) > > Looks that good to you? > I am trying with the attached files and... CONFIG_PARAVIRT=y CONFIG_CC_STACKPROTECTOR_STRONG=y - Sedat - --00000000000097d0a8056cc6dfba Content-Type: text/x-patch; charset="US-ASCII"; name="0001-compiler-clang.h-Add-__nostackprotector-function-att.patch" Content-Disposition: attachment; filename="0001-compiler-clang.h-Add-__nostackprotector-function-att.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jhhe63g20 RnJvbSBlZDA3ZmYzNmFlN2FlMTIxZTQ4ZDZjMDU3OWZmM2ZkNTc5NmJmNTdhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTZWRhdCBEaWxlayA8c2VkYXQuZGlsZWtAY3JlZGF0aXYuZGU+ CkRhdGU6IFR1ZSwgMjIgTWF5IDIwMTggMDk6NDY6MTggKzAyMDAKU3ViamVjdDogW1BBVENIIDEv Ml0gY29tcGlsZXItY2xhbmcuaDogQWRkIF9fbm9zdGFja3Byb3RlY3RvciBmdW5jdGlvbgogYXR0 cmlidXRlCgotLS0KIGluY2x1ZGUvbGludXgvY29tcGlsZXItY2xhbmcuaCB8IDUgKysrKysKIDEg ZmlsZSBjaGFuZ2VkLCA1IGluc2VydGlvbnMoKykKCmRpZmYgLS1naXQgYS9pbmNsdWRlL2xpbnV4 L2NvbXBpbGVyLWNsYW5nLmggYi9pbmNsdWRlL2xpbnV4L2NvbXBpbGVyLWNsYW5nLmgKaW5kZXgg MDcwZjg1ZDkyYzE1Li4xZGE5NTdjMzMxNDAgMTAwNjQ0Ci0tLSBhL2luY2x1ZGUvbGludXgvY29t cGlsZXItY2xhbmcuaAorKysgYi9pbmNsdWRlL2xpbnV4L2NvbXBpbGVyLWNsYW5nLmgKQEAgLTIx LDMgKzIxLDggQEAKICNpZmRlZiBfX25vcmV0cG9saW5lCiAjdW5kZWYgX19ub3JldHBvbGluZQog I2VuZGlmCisKKy8qIEZvciBkZXRhaWxzIHNlZSA8aHR0cHM6Ly9idWdzLmxsdm0ub3JnL3Nob3df YnVnLmNnaT9pZD0zNzUxMj4uCisgKiBUaGlzIGZlYXR1cmUgcmVxdWlyZXMgQ2xhbmcgdmVyc2lv biA3ID49IHN2bjMzMTkyNS4KKyAqLworI2RlZmluZSBfX25vc3RhY2twcm90ZWN0b3IgYXR0cmli dXRlKChub19zdGFja19wcm90ZWN0b3IpKQotLSAKMi4xNy4wCgo= --00000000000097d0a8056cc6dfba Content-Type: text/x-patch; charset="US-ASCII"; name="0002-x86-paravirt-Mark-native_save_fl-with-__nostackprote.patch" Content-Disposition: attachment; filename="0002-x86-paravirt-Mark-native_save_fl-with-__nostackprote.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jhhe6ale1 RnJvbSA2ZmY0MzcxOWQyZjIyNWVlOTAzNjRjZTA1NGE5NTU1OTBhMDdlOTExIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTZWRhdCBEaWxlayA8c2VkYXQuZGlsZWtAY3JlZGF0aXYuZGU+ CkRhdGU6IFR1ZSwgMjIgTWF5IDIwMTggMDk6NTI6MTUgKzAyMDAKU3ViamVjdDogW1BBVENIIDIv Ml0geDg2L3BhcmF2aXJ0OiBNYXJrIG5hdGl2ZV9zYXZlX2ZsKCkgd2l0aAogX19ub3N0YWNrcHJv dGVjdG9yIGF0dHJpYnV0ZQoKLS0tCiBhcmNoL3g4Ni9pbmNsdWRlL2FzbS9pcnFmbGFncy5oIHwg MiArLQogMSBmaWxlIGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspLCAxIGRlbGV0aW9uKC0pCgpkaWZm IC0tZ2l0IGEvYXJjaC94ODYvaW5jbHVkZS9hc20vaXJxZmxhZ3MuaCBiL2FyY2gveDg2L2luY2x1 ZGUvYXNtL2lycWZsYWdzLmgKaW5kZXggODlmMDg5NTVmZmY3Li42ZGVmMDQzMjExODEgMTAwNjQ0 Ci0tLSBhL2FyY2gveDg2L2luY2x1ZGUvYXNtL2lycWZsYWdzLmgKKysrIGIvYXJjaC94ODYvaW5j bHVkZS9hc20vaXJxZmxhZ3MuaApAQCAtMTMsNyArMTMsNyBAQAogICogSW50ZXJydXB0IGNvbnRy b2w6CiAgKi8KIAotc3RhdGljIGlubGluZSB1bnNpZ25lZCBsb25nIG5hdGl2ZV9zYXZlX2ZsKHZv aWQpCitzdGF0aWMgaW5saW5lIHVuc2lnbmVkIGxvbmcgX19ub3N0YWNrcHJvdGVjdG9yIG5hdGl2 ZV9zYXZlX2ZsKHZvaWQpCiB7CiAJdW5zaWduZWQgbG9uZyBmbGFnczsKIAotLSAKMi4xNy4wCgo= --00000000000097d0a8056cc6dfba--