Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3611225lfb; Mon, 9 May 2022 00:00:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0pSoanRdcY2ZwVdU53w3NLMtkUDlygwpD+PwR0kFOwPlnxexXR9EWm4Hjc314PGppYN93 X-Received: by 2002:a17:903:32c6:b0:15e:c1cc:2405 with SMTP id i6-20020a17090332c600b0015ec1cc2405mr15296384plr.117.1652079616431; Mon, 09 May 2022 00:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652079616; cv=none; d=google.com; s=arc-20160816; b=sTanIxcgfvRYc3Uw+21FfGXNe/0LwSLXp8cFWk5tWBQIaKUxnQ6cNqMAQoLCjSTQt0 KKSJMIcXZXUHCeaSqqwqbT3oUtfAfTcZefHHo0CogEYZLdU59SBuG8JHWq5BYXfZp3+N +SU2Ke5evp0YNd9s+iQxnXZzoG3QK5FRitRUtCrt+MGYH/iRncDn+G6blTvYyJfQHoGx jdj5OOIScyCKsD1HvrFo7aGeBVHV9UcqH7x+Eng0Z4RuW7iaBGt4e3zDA8uKeIQ0UQCx 9izJqnuytim0a9XmiZIuls1NWBLbOAcc1/3SqAQvJsGCAhpDligXvNEzgf+IEc64qVN0 rx9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=UoCumu7o9BabMe8Pn9KhSl2Wbtdkabdo24tDb7pIRwo=; b=xxOhnlfqkFSw9e8lk9aGk23c0Pzb5vMcAlgjJAJmX0Py8YsdbGW/yOTn2GZqTMZ2NF nBXP+cx0URJ5W3ouvl8aTnNWeNCF8LgNaTRXfjH/qfxm5O5T9bbMhRw9nuGZE/lUKYL1 axawi51u5aA5f8E9WAVdwAcJRi9UX4MNdbcTotGkbJVS3lPfHM6faKInLk+HKON2qwpa 6+2UIcWaqQEj4x43+YWjR2HETRJe6L6vYlqylMT9nbg86goUKN0BSQX6cxLpFNRCgYVd tKkE/ZPReuXEBRSlROAkw0x8rpekJSgSZvtchNZtyGKCv4nB6eJIffFLQBiv70tkwPc0 NRjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="EGZk7k/+"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p9-20020a170902e74900b00154319ca2ddsi12346919plf.397.2022.05.09.00.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:00:16 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="EGZk7k/+"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DD68E15E48A; Sun, 8 May 2022 23:57:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442073AbiEFOZn (ORCPT + 99 others); Fri, 6 May 2022 10:25:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238749AbiEFOZl (ORCPT ); Fri, 6 May 2022 10:25:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 997C268FB7 for ; Fri, 6 May 2022 07:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651846916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=UoCumu7o9BabMe8Pn9KhSl2Wbtdkabdo24tDb7pIRwo=; b=EGZk7k/+xYgoYVPesnWks0CZbrRR5SITYKdFl3ZfRruiHK17U/KFYoYzSaFuiXyuR8bvnp USzJ6IDDCmCBK4gtWBuhfwMXOm+sZqu31gUXNmJUYnZ3cZq4eQQLuoRzbQg8VxMwDqZUa0 mx3+pV5FdWzyGdV3/Hxpm5bPLnq1rjQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-418-S3f8mc3qO0CPQdTezQ4b5A-1; Fri, 06 May 2022 10:21:55 -0400 X-MC-Unique: S3f8mc3qO0CPQdTezQ4b5A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B46C4185A794; Fri, 6 May 2022 14:21:54 +0000 (UTC) Received: from asgard.redhat.com (unknown [10.36.110.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E1A940314B; Fri, 6 May 2022 14:21:51 +0000 (UTC) Date: Fri, 6 May 2022 16:21:48 +0200 From: Eugene Syromiatnikov To: Jiri Olsa , Masami Hiramatsu , Steven Rostedt , Ingo Molnar Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf] bpf_trace: bail out from bpf_kprobe_multi_link_attach when in compat Message-ID: <20220506142148.GA24802@asgard.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since bpf_kprobe_multi_link_attach doesn't support 32-bit kernels for whatever reason, having it enabled for compat processes on 64-bit kernels makes even less sense due to discrepances in the type sizes that it does not handle. Fixes: 0dcac272540613d4 ("bpf: Add multi kprobe link") Signed-off-by: Eugene Syromiatnikov --- kernel/trace/bpf_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index d8553f4..9560af6 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -2410,7 +2410,7 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr int err; /* no support for 32bit archs yet */ - if (sizeof(u64) != sizeof(void *)) + if (sizeof(u64) != sizeof(void *) || in_compat_syscall()) return -EOPNOTSUPP; if (prog->expected_attach_type != BPF_TRACE_KPROBE_MULTI) -- 2.1.4