From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, T_DKIMWL_WL_MED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99ABEC43141 for ; Thu, 28 Jun 2018 19:30:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45D122787F for ; Thu, 28 Jun 2018 19:30:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="V7TnwCZS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45D122787F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754796AbeF1TaV (ORCPT ); Thu, 28 Jun 2018 15:30:21 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:35576 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754456AbeF1TaR (ORCPT ); Thu, 28 Jun 2018 15:30:17 -0400 Received: by mail-it0-f66.google.com with SMTP id l16-v6so13467950ita.0 for ; Thu, 28 Jun 2018 12:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XfV0YwIao1ZThy48M/rzfQwaFP3aXW3fGxtnhPWGtws=; b=V7TnwCZS3G9n5jIXFCypNlSF9O9FsGCezRgOsnjku8hdMyFfrgDneB+KarFl+m+JPE mkWSsPUu2966xHsADYVpkYloYvHn+nKF83yvgexB5XlDv7hPpBYf7/9v2LeAvQRvmGJm FdDOxPgfJzyNP0OZ1VzNihnR1MnQEsnfWuWn0ECeYGPSJV2oYiAa54w0/Xkk1RcLn152 b68wFzfOqQ3vq66MBUsR/ECIVz9dBow7jUA6WgFgxskjkpR5y3cqk7I8fx1HWAyAxCXZ vcIE3LOGtcguN0Z7JwtAvLJfP1DoohKd3RwnlibhpLcF9ykLZDM8IL4ZcJh+V2hgz18r tPEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XfV0YwIao1ZThy48M/rzfQwaFP3aXW3fGxtnhPWGtws=; b=HF72rSi1WYwFCBzms6kDJtqJRL+O22QqHiFHbCNTYjGTOoAYHkuJZm49A1oEFupmjj 7kioDYtuT8Y//lnzrIvuqmXW+LpOJwX1OIFjXBonNDHe8+WqOvkkMp7cpLLrANqWQ760 GjBY4lF13Q3WY2hXugL9iC6oinF7X/rWkTCnFnPr39f8in32Db6qD2TTOnpt5aBAU8PT 8f4q/VBYcg71rAley97WZN1AN3olKib6tqOx1FincmAn8PfQRpoXva125db5Lm0BlV6w CsJgfu7KVhRsd6J3HmoR6bHk0RMsG3V3icu0wAht2yz2Y7Bda4bjk/jesxu1AGORvwoz pSmg== X-Gm-Message-State: APt69E2ypwQP79+KwiX/2zqm76TZlDmtjz2sStLOUxec2NcyzVAsgR/e StQ1SA91fNZhAdF+wIwwoTl1z+Ig7qhplpje1BDRgQ== X-Google-Smtp-Source: AAOMgpdKcg1s52OL8mN+GAkdGe2OK2W2ILU6cjow8+aqbaqkzkYw3R5ICkk2QHv7MNG7QSxAYMWIrgn50STZiVidOPI= X-Received: by 2002:a24:b046:: with SMTP id b6-v6mr10289685itj.48.1530214216643; Thu, 28 Jun 2018 12:30:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:9082:0:0:0:0:0 with HTTP; Thu, 28 Jun 2018 12:30:16 -0700 (PDT) In-Reply-To: References: <20180626172900.ufclp2pfrhwkxjco@armageddon.cambridge.arm.com> From: Andrey Konovalov Date: Thu, 28 Jun 2018 21:30:16 +0200 Message-ID: Subject: Re: [PATCH v4 0/7] arm64: untag user pointers passed to the kernel To: Catalin Marinas Cc: Will Deacon , Mark Rutland , Robin Murphy , Al Viro , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Linux ARM , linux-doc@vger.kernel.org, Linux Memory Management List , linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, LKML , Chintan Pandya , Jacob Bramley , Ruben Ayrapetyan , Lee Smith , Kostya Serebryany , Dmitry Vyukov , Ramana Radhakrishnan , Evgeniy Stepanov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 27, 2018 at 5:05 PM, Andrey Konovalov wrote: > On Tue, Jun 26, 2018 at 7:29 PM, Catalin Marinas > wrote: >> While I support this work, as a maintainer I'd like to understand >> whether we'd be in a continuous chase of ABI breaks with every kernel >> release or we have a better way to identify potential issues. Is there >> any way to statically analyse conversions from __user ptr to long for >> example? Or, could we get the compiler to do this for us? > > > OK, got it, I'll try to figure out a way to find these conversions. I've prototyped a checker on top of clang static analyzer (initially looked at sparse, but couldn't find any documentation or examples). The results are here [1], search for "warning: user pointer cast". Sharing in case anybody wants to take a look, will look at them myself tomorrow. [1] https://gist.github.com/xairy/433edd5c86456a64026247cb2fef2115 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id 69A277D072 for ; Thu, 28 Jun 2018 19:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933040AbeF1TaT (ORCPT ); Thu, 28 Jun 2018 15:30:19 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:37007 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754336AbeF1TaR (ORCPT ); Thu, 28 Jun 2018 15:30:17 -0400 Received: by mail-it0-f66.google.com with SMTP id p17-v6so9266399itc.2 for ; Thu, 28 Jun 2018 12:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XfV0YwIao1ZThy48M/rzfQwaFP3aXW3fGxtnhPWGtws=; b=V7TnwCZS3G9n5jIXFCypNlSF9O9FsGCezRgOsnjku8hdMyFfrgDneB+KarFl+m+JPE mkWSsPUu2966xHsADYVpkYloYvHn+nKF83yvgexB5XlDv7hPpBYf7/9v2LeAvQRvmGJm FdDOxPgfJzyNP0OZ1VzNihnR1MnQEsnfWuWn0ECeYGPSJV2oYiAa54w0/Xkk1RcLn152 b68wFzfOqQ3vq66MBUsR/ECIVz9dBow7jUA6WgFgxskjkpR5y3cqk7I8fx1HWAyAxCXZ vcIE3LOGtcguN0Z7JwtAvLJfP1DoohKd3RwnlibhpLcF9ykLZDM8IL4ZcJh+V2hgz18r tPEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XfV0YwIao1ZThy48M/rzfQwaFP3aXW3fGxtnhPWGtws=; b=ub8neh9Me/tcqsegZhgfkixlLGuVh8wY5DwpG7zCN2PclqW+mYyAyD/hhMC95qYYzx 7RfPo62Wl5061Cm9CQALnt7V03NBEmLGeV/tykxFgeRRNUqtzgIeAf8+eOSfmgKr1yy0 9Q7te/s/1HsxdSq/KJG4KEjuhNKJ8Rzeoz0cWeDx2WG3qV3oK/C4gCRl6sBH4xup/cZO 2FLGwVPBU0pbSWOCXTgwkENNlCvJfi/gGEqgQc/CB7RST/kTAKxSS5fnw2Bs/ASjWh+J +WhO9+YNDfP3svm8xzckxEpqZFXmQnBpn26EYkrjfik7V1DK6inGhUZ6yuQxPdlG6reP B0uw== X-Gm-Message-State: APt69E2eZ0cENJd+HpKB3YAs824UokI11gNmotKBmiQTvJVZJfDgD0cQ GkWd+YpDT8FRvLf8jBzm+Vb+he7ir5MCImKGoMWxSQ== X-Google-Smtp-Source: AAOMgpdKcg1s52OL8mN+GAkdGe2OK2W2ILU6cjow8+aqbaqkzkYw3R5ICkk2QHv7MNG7QSxAYMWIrgn50STZiVidOPI= X-Received: by 2002:a24:b046:: with SMTP id b6-v6mr10289685itj.48.1530214216643; Thu, 28 Jun 2018 12:30:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:9082:0:0:0:0:0 with HTTP; Thu, 28 Jun 2018 12:30:16 -0700 (PDT) In-Reply-To: References: <20180626172900.ufclp2pfrhwkxjco@armageddon.cambridge.arm.com> From: Andrey Konovalov Date: Thu, 28 Jun 2018 21:30:16 +0200 Message-ID: Subject: Re: [PATCH v4 0/7] arm64: untag user pointers passed to the kernel To: Catalin Marinas Cc: Will Deacon , Mark Rutland , Robin Murphy , Al Viro , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Linux ARM , linux-doc@vger.kernel.org, Linux Memory Management List , linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, LKML , Chintan Pandya , Jacob Bramley , Ruben Ayrapetyan , Lee Smith , Kostya Serebryany , Dmitry Vyukov , Ramana Radhakrishnan , Evgeniy Stepanov Content-Type: text/plain; charset="UTF-8" Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Wed, Jun 27, 2018 at 5:05 PM, Andrey Konovalov wrote: > On Tue, Jun 26, 2018 at 7:29 PM, Catalin Marinas > wrote: >> While I support this work, as a maintainer I'd like to understand >> whether we'd be in a continuous chase of ABI breaks with every kernel >> release or we have a better way to identify potential issues. Is there >> any way to statically analyse conversions from __user ptr to long for >> example? Or, could we get the compiler to do this for us? > > > OK, got it, I'll try to figure out a way to find these conversions. I've prototyped a checker on top of clang static analyzer (initially looked at sparse, but couldn't find any documentation or examples). The results are here [1], search for "warning: user pointer cast". Sharing in case anybody wants to take a look, will look at them myself tomorrow. [1] https://gist.github.com/xairy/433edd5c86456a64026247cb2fef2115 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: andreyknvl at google.com (Andrey Konovalov) Date: Thu, 28 Jun 2018 21:30:16 +0200 Subject: [PATCH v4 0/7] arm64: untag user pointers passed to the kernel In-Reply-To: References: <20180626172900.ufclp2pfrhwkxjco@armageddon.cambridge.arm.com> Message-ID: On Wed, Jun 27, 2018 at 5:05 PM, Andrey Konovalov wrote: > On Tue, Jun 26, 2018 at 7:29 PM, Catalin Marinas > wrote: >> While I support this work, as a maintainer I'd like to understand >> whether we'd be in a continuous chase of ABI breaks with every kernel >> release or we have a better way to identify potential issues. Is there >> any way to statically analyse conversions from __user ptr to long for >> example? Or, could we get the compiler to do this for us? > > > OK, got it, I'll try to figure out a way to find these conversions. I've prototyped a checker on top of clang static analyzer (initially looked at sparse, but couldn't find any documentation or examples). The results are here [1], search for "warning: user pointer cast". Sharing in case anybody wants to take a look, will look at them myself tomorrow. [1] https://gist.github.com/xairy/433edd5c86456a64026247cb2fef2115 -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: andreyknvl@google.com (Andrey Konovalov) Date: Thu, 28 Jun 2018 21:30:16 +0200 Subject: [PATCH v4 0/7] arm64: untag user pointers passed to the kernel In-Reply-To: References: <20180626172900.ufclp2pfrhwkxjco@armageddon.cambridge.arm.com> Message-ID: Content-Type: text/plain; charset="UTF-8" Message-ID: <20180628193016.2YKwNsdixl9aXfKtwFrjdv_AkTlF8DEGlIPWzIVa7PE@z> On Wed, Jun 27, 2018@5:05 PM, Andrey Konovalov wrote: > On Tue, Jun 26, 2018 at 7:29 PM, Catalin Marinas > wrote: >> While I support this work, as a maintainer I'd like to understand >> whether we'd be in a continuous chase of ABI breaks with every kernel >> release or we have a better way to identify potential issues. Is there >> any way to statically analyse conversions from __user ptr to long for >> example? Or, could we get the compiler to do this for us? > > > OK, got it, I'll try to figure out a way to find these conversions. I've prototyped a checker on top of clang static analyzer (initially looked at sparse, but couldn't find any documentation or examples). The results are here [1], search for "warning: user pointer cast". Sharing in case anybody wants to take a look, will look at them myself tomorrow. [1] https://gist.github.com/xairy/433edd5c86456a64026247cb2fef2115 -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Konovalov Subject: Re: [PATCH v4 0/7] arm64: untag user pointers passed to the kernel Date: Thu, 28 Jun 2018 21:30:16 +0200 Message-ID: References: <20180626172900.ufclp2pfrhwkxjco@armageddon.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Catalin Marinas Cc: Will Deacon , Mark Rutland , Robin Murphy , Al Viro , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Linux ARM , linux-doc@vger.kernel.org, Linux Memory Management List , linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, LKML , Chintan Pandya , Jacob Bramley , Ruben List-Id: linux-arch.vger.kernel.org On Wed, Jun 27, 2018 at 5:05 PM, Andrey Konovalov wrote: > On Tue, Jun 26, 2018 at 7:29 PM, Catalin Marinas > wrote: >> While I support this work, as a maintainer I'd like to understand >> whether we'd be in a continuous chase of ABI breaks with every kernel >> release or we have a better way to identify potential issues. Is there >> any way to statically analyse conversions from __user ptr to long for >> example? Or, could we get the compiler to do this for us? > > > OK, got it, I'll try to figure out a way to find these conversions. I've prototyped a checker on top of clang static analyzer (initially looked at sparse, but couldn't find any documentation or examples). The results are here [1], search for "warning: user pointer cast". Sharing in case anybody wants to take a look, will look at them myself tomorrow. [1] https://gist.github.com/xairy/433edd5c86456a64026247cb2fef2115 From mboxrd@z Thu Jan 1 00:00:00 1970 From: andreyknvl@google.com (Andrey Konovalov) Date: Thu, 28 Jun 2018 21:30:16 +0200 Subject: [PATCH v4 0/7] arm64: untag user pointers passed to the kernel In-Reply-To: References: <20180626172900.ufclp2pfrhwkxjco@armageddon.cambridge.arm.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Jun 27, 2018 at 5:05 PM, Andrey Konovalov wrote: > On Tue, Jun 26, 2018 at 7:29 PM, Catalin Marinas > wrote: >> While I support this work, as a maintainer I'd like to understand >> whether we'd be in a continuous chase of ABI breaks with every kernel >> release or we have a better way to identify potential issues. Is there >> any way to statically analyse conversions from __user ptr to long for >> example? Or, could we get the compiler to do this for us? > > > OK, got it, I'll try to figure out a way to find these conversions. I've prototyped a checker on top of clang static analyzer (initially looked at sparse, but couldn't find any documentation or examples). The results are here [1], search for "warning: user pointer cast". Sharing in case anybody wants to take a look, will look at them myself tomorrow. [1] https://gist.github.com/xairy/433edd5c86456a64026247cb2fef2115