Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2538397iob; Fri, 20 May 2022 11:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhxv4zECQykNaiYrmtIvkkWdvolvv4fGBC1gSE9KRyTWMPKKg489djgWoPwWnW0siRJGSD X-Received: by 2002:a05:6a00:1494:b0:50e:23d:831c with SMTP id v20-20020a056a00149400b0050e023d831cmr11286260pfu.31.1653071530252; Fri, 20 May 2022 11:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653071530; cv=none; d=google.com; s=arc-20160816; b=Cq4c/R+K4Ilrp4ZzpF2xYIHq36Um9glA70psPa3RKymQtW8ZqEkNksTBaVqOymo9EV dKf53ToACSrZI893wgweOEsyHXOYobCZTrDrVb4777PrDacIpJl1voY8eHrgR3EfnZGr pG+oJdQ/6n71NCswwEuMDDaA+6SvxSkWCTCcSt3yYEgDqOgaQYQlUdvqQCty5gQde2DK pWi738GSgrUBEaRIAPXE6gb2k7CpZx1seBmTErSFW4OZwo0m+RdVKl5AyavRayMaUv8o VwOLNYbM0T3g5A22j/SBaNLhbjQALudU+6dIq8aDOSHHWRzyDb4v50yxtrgAviP/HoUC +M/w== 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=/ffvSfNKs9zH72fFL+E1h0NPdgas9cPjscSEjFymamw=; b=M0FlThFLkQZYAnZGfbJj80yOR3DFnELBBkFaXPOzP12/gSdcXncU/cKCdYpm5ourAR uPc6XzDdHHD8B78QAd/VGwMMMsrMIvMxqjZGlZOhZGN8lrgdG/Y3+Yb4NepJ1+GIfZZY E1IXLo66j92BfP1Sj3KX3wKehjP1UgKRfAcNyFFcJvuyeipGJbkcJAVNAlzMvR7lAwiu uaJCoQ9SVEv0H91SX5IX9s8iY0xByMssf7REKu0x+UHvDwvMa4VW5p+L7I6OMhRTNGVW bRQ42zw10ub4UYeR62QosUHLoCtMVbitK1xWi2KLSWpzM5a9ye84DkzrerJ9DZhLOHZR sJRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P683kWLt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg9-20020a1709028e8900b0015c16a75912si150700plb.552.2022.05.20.11.31.57; Fri, 20 May 2022 11:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P683kWLt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237078AbiESSON (ORCPT + 99 others); Thu, 19 May 2022 14:14:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232479AbiESSOJ (ORCPT ); Thu, 19 May 2022 14:14:09 -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 C7612E8B8D for ; Thu, 19 May 2022 11:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652984048; 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=/ffvSfNKs9zH72fFL+E1h0NPdgas9cPjscSEjFymamw=; b=P683kWLtStvWqABTD2//Dun8/fv5LJEyY43VzYfFmvXj7wJbxfqfBI5cH8nwseJsCw5tso LEtEg0yJ7FMmTUoGIC1u0WgE/dBrptPzeSA2yw8znLkpfedtzK9rCHwKsqpenSaufHRMK5 EBdAxhIo9VqwdDiLSDm7jT2SV9sOP1o= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-D6mY1wKCOQeHLZFr6e_-4g-1; Thu, 19 May 2022 14:14:02 -0400 X-MC-Unique: D6mY1wKCOQeHLZFr6e_-4g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 19F5E3817A65; Thu, 19 May 2022 18:14:02 +0000 (UTC) Received: from asgard.redhat.com (unknown [10.36.110.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3422BC33AE5; Thu, 19 May 2022 18:13:58 +0000 (UTC) Date: Thu, 19 May 2022 20:13:55 +0200 From: Eugene Syromiatnikov To: Jiri Olsa , Masami Hiramatsu , Steven Rostedt , Ingo Molnar , Alexei Starovoitov , Daniel Borkmann Cc: 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, Shuah Khan , linux-kselftest@vger.kernel.org Subject: [PATCH bpf v4 0/3] Fix kprobe_multi interface issues for 5.18 Message-ID: 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.8 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_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 Hello. While [1] seems to require additional work[2] due to changes in the interface (and it has already been re-targeted for bpf-next), I would like to ask to consider the following three patches, that fix possible out-of-bounds write, properly disable the interface for 32-bit compat user space, and prepare the libbpf interface change, for the 5.18 release. Thank you. [1] https://lore.kernel.org/lkml/cover.1652772731.git.esyr@redhat.com/ [2] https://lore.kernel.org/lkml/YoTXiAk1EpZ0rLKE@krava/i v4: - Added additional size checks for INT_MAX, as suggested by Yonghong Song - Added the third patch for the user space kprobe_multi.addrs type change, split from the 4th bpf-next patch, as suggested by Yonghong Song and Andrii Nakryiko v3: https://lore.kernel.org/lkml/cover.1652876187.git.esyr@redhat.com/ - Split out patches for 5.18 - Removed superfluous size assignments after overflow_mul_check, as suggested by Yonghong Song v2: https://lore.kernel.org/lkml/20220516230441.GA22091@asgard.redhat.com/ - Fixed the isses reported by CI v1: https://lore.kernel.org/lkml/20220516182657.GA28596@asgard.redhat.com/ Eugene Syromiatnikov (3): bpf_trace: check size for overflow in bpf_kprobe_multi_link_attach bpf_trace: bail out from bpf_kprobe_multi_link_attach when in compat libbpf, selftests/bpf: pass array of u64 values in kprobe_multi.addrs kernel/trace/bpf_trace.c | 15 +++++++++------ tools/lib/bpf/bpf.h | 2 +- tools/lib/bpf/libbpf.c | 8 ++++---- tools/lib/bpf/libbpf.h | 2 +- tools/testing/selftests/bpf/prog_tests/bpf_cookie.c | 2 +- .../testing/selftests/bpf/prog_tests/kprobe_multi_test.c | 8 ++++---- 6 files changed, 20 insertions(+), 17 deletions(-) -- 2.1.4