Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1776974ybk; Thu, 21 May 2020 15:13:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOCcE3/7l9nbw4FdYyVcI1nUZO+qx4CC654WM5asjynLne3XnMr6H2Aaale2AVMtAWGCig X-Received: by 2002:aa7:cb8f:: with SMTP id r15mr800347edt.120.1590099193251; Thu, 21 May 2020 15:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590099193; cv=none; d=google.com; s=arc-20160816; b=ZLdYx/4QamVDxNWzR0SlLRW0aEDoOMABqH3HTfxdBuXe3Bq+Obs88zZCCI5Y+Zsd/S a3abu1NzwdmuTewQSCTkOPYN/4CcrjO9hirhMUFDcJt4HEMgcUo/8BkDTxHZSc0/fuMU MJcAMjj/rUl98pqAhZoVsGC2d70WQJ4l5qCwuL3p7q17mpEn1JWKqi/vkLcHiza6bCd8 e2/IE+1GpqCKN0UtaASBQnDdH+EgoXo4itzGjrBJtEB9indJ/LiKoOC9DD6C2SjI15V+ q6hUQ0N8TyVy/YuujO9Eip4HGf3qt6fHBPcPNyy9WbpKx4vHzj5ILaBHOhMn1zaGtW3P PxqQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=isMsZ2pUMyCVKxa9Y2mlyk5l3TCYNg/xt93/ki7P2xM=; b=jbVuI/tunGgH8kb5pqYDbBE9Ib2gSBxNv4Un7VySUGC/eN7Jf6jLwBkUE1v1EFfu0B lnpd8+5t+X71LtP5LyVH03D6sqXqmld28DciBOcJ25Rtg0594zwcSBgBEMf9SdjgEgNI PJ2foUwSkMx0anelMuo77AN+guiBx1dxVhpM7wLyIzrsjUcjmTFcIUtZ6yjd33NaQDYJ Fg7lzLsc4vPAocYSniKFpuNT42siVsq0cR9BOwIU5l331F9crZyJSgUJxOiQACapptqP C4BBK1AqnQsV04afbHrGRAryQQxQT/Rki3D/9TwSJFHo+0KO5LP1J+jTJkmNxFkhWCyy urQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rvtv2nZM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h63si3329627edd.451.2020.05.21.15.12.50; Thu, 21 May 2020 15:13:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rvtv2nZM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730705AbgEUWK4 (ORCPT + 99 others); Thu, 21 May 2020 18:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728701AbgEUWKz (ORCPT ); Thu, 21 May 2020 18:10:55 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69E23C061A0E; Thu, 21 May 2020 15:10:54 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id f13so8944784qkh.2; Thu, 21 May 2020 15:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=isMsZ2pUMyCVKxa9Y2mlyk5l3TCYNg/xt93/ki7P2xM=; b=rvtv2nZMjsCYj/CeRcxqSRzJYCvoWBWeEm/72+lnNyxa+Vdy9NkfFeD8cpeGY76yDk wfvMzNxbucIn7Hs+oWyf05qo9fHMcUsteanx5aU0XArHtMRRXJLuU721EUNgAES4ID8L 4BK22OGZzPIFuxQJNAXNMRKzin+VQSx6P4f7rTt5QxVcnbVdnbKLOB4xWP/9BUtlDCzG wxQKxlWDremxmA6nHO7Dnyr4bSR0bzQXoj8MWM7oqmmacFdDmArrPOzkdO2ojiT2NeXZ 3rF1QgvrXugmu2458C0loC8GmxZvMhABO4SKgIQSvB76sfSoth+Bvjqp6Btx4FaWlhSq MSyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=isMsZ2pUMyCVKxa9Y2mlyk5l3TCYNg/xt93/ki7P2xM=; b=FBptfPGUWDhzI8w9NoAiGfqiiSfE6M7fJjPj/rxL+umLgLcWDDiyVs8/v9wGhNbVAJ R4GqelqZxq5SWSEFWhPsasveFwsHtmZ7BzBWuWIRRfUO6x0HdNfTp6HmgT4zCep/9YDo HYtqGgcYqXICe4/Fgili/0M3FhyoSwMzFG3kmTXraDOtp/BFLBWsv+XYqN7P0jBITp38 1+6EsvEnhY9yJPYvpdXCbib0Q5knjbBE9gXX3QFWZJwx/m+yvy+f7jaem3GoImzYeLQq 39P4Ysmk/XeYJJr2vOC163tKIf7Yphy4VvCm+Kcsu0OQtjJp/u1SlsHYkA6do39+5iwk gYXA== X-Gm-Message-State: AOAM5324Oa27ravLh38tLiNdQMW1y5JxC8tVAi1JDLDw94HSp4AUxS49 2f1GkdaVcSxMLParkw2Jfhu4fZ8AkcJQfVXyAc0= X-Received: by 2002:ae9:e713:: with SMTP id m19mr12160235qka.39.1590099053692; Thu, 21 May 2020 15:10:53 -0700 (PDT) MIME-Version: 1.0 References: <20200521152301.2587579-1-hch@lst.de> <20200521152301.2587579-14-hch@lst.de> In-Reply-To: <20200521152301.2587579-14-hch@lst.de> From: Andrii Nakryiko Date: Thu, 21 May 2020 15:10:42 -0700 Message-ID: Subject: Re: [PATCH 13/23] bpf: rework the compat kernel probe handling To: Christoph Hellwig Cc: x86@kernel.org, Alexei Starovoitov , Daniel Borkmann , Masami Hiramatsu , Linus Torvalds , Andrew Morton , linux-parisc@vger.kernel.org, linux-um@lists.infradead.org, Networking , bpf , linux-mm@kvack.org, open list 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 Thu, May 21, 2020 at 8:26 AM Christoph Hellwig wrote: > > Instead of using the dangerous probe_kernel_read and strncpy_from_unsafe > helpers, rework the compat probes to check if an address is a kernel or > userspace one, and then use the low-level kernel or user probe helper > shared by the proper kernel and user probe helpers. This slightly > changes behavior as the compat probe on a user address doesn't check > the lockdown flags, just as the pure user probes do. > > Signed-off-by: Christoph Hellwig > --- Looks good, thanks. Acked-by: Andrii Nakryiko > kernel/trace/bpf_trace.c | 109 ++++++++++++++++++++++++--------------- > 1 file changed, 67 insertions(+), 42 deletions(-) > [...]