From patchwork Fri Mar 8 21:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bethany Jamison X-Patchwork-Id: 1909865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TrzVS1mZRz1yX6 for ; Sat, 9 Mar 2024 08:15:59 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rihZB-0006Ms-2x; Fri, 08 Mar 2024 21:15:45 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rihZ7-0006MQ-Po for kernel-team@lists.ubuntu.com; Fri, 08 Mar 2024 21:15:41 +0000 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 5C0EB41120 for ; Fri, 8 Mar 2024 21:15:41 +0000 (UTC) Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-69065c97416so28101666d6.3 for ; Fri, 08 Mar 2024 13:15:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709932540; x=1710537340; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=z/fVLeJ50ojreUw74Pr9YaqRVJWq2pZbe8F5Dv6ktjU=; b=YiUNo9aItY/+7ERqVRtTTIsOFbUp5FoMgKQ4dPF+awgetK4+m/j2/cq4Pjecn2qebr OmU+ZZpfCGKfz3h180OSc6oh3jw4gN+BP1QHzyLBKlxrM2bE5RrJbU1DRlhcrQfzvUi1 Y1QyjUH5xZGVJJZRKbqXsB3j73JdCM4miwUH/FC87ec4AKuzXiKSi96oMXYHfL6y/cO0 cq54SQg9q5V5OxSb9C5zDh1UilbJHSHHkKcfS9bd/npNhhyyE8mGZSfZlXjLwFq5GANT sgGB9S7ji9xdEHbVqZtTySS3S4KLGqkoC5lOShDpX/+Nr+QzRudY8Xwnk3NequW9D7uz ZJag== X-Gm-Message-State: AOJu0YwxqHWetc7GA4RSSy1b+D953nhuOKMQx/ohp0BOiMZASPyX6TQX sGv9kj8OAscNStho7tkAo2SZmbW0DudbbXCBbDWIEBgFPfEUZjcfXIyYsvka4kKaHl9nuLGpRKw j6POXmzEWJ73xQ35Lsr6UHlozK40udFEnCcMcX3d759QYMjo/osfCEgAVGWSLwbIHA3y2tPbeGq qe8jHh/kLDkQ== X-Received: by 2002:a0c:f74a:0:b0:690:b3a3:2260 with SMTP id e10-20020a0cf74a000000b00690b3a32260mr260907qvo.60.1709932539981; Fri, 08 Mar 2024 13:15:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEdiyFgIl0moKh9ELVg7E21CtVV8KB6XRypJ8T+tMc36q/MYGurbM2HSzi5uqgGTMkr0VPM4Q== X-Received: by 2002:a0c:f74a:0:b0:690:b3a3:2260 with SMTP id e10-20020a0cf74a000000b00690b3a32260mr260891qvo.60.1709932539644; Fri, 08 Mar 2024 13:15:39 -0800 (PST) Received: from smtp.gmail.com (104-218-69-129.dynamic.lnk.ne.allofiber.net. [104.218.69.129]) by smtp.gmail.com with ESMTPSA id cz14-20020a056214088e00b0068f4520e42dsm126531qvb.16.2024.03.08.13.15.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 13:15:39 -0800 (PST) From: Bethany Jamison To: kernel-team@lists.ubuntu.com Subject: [SRU][M][PATCH 0/1] CVE-2024-26591 Date: Fri, 8 Mar 2024 15:15:36 -0600 Message-Id: <20240308211537.31181-1-bethany.jamison@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" [Impact] In the Linux kernel, the following vulnerability has been resolved: bpf: Fix re-attachment branch in bpf_tracing_prog_attach The following case can cause a crash due to missing attach_btf: 1) load rawtp program 2) load fentry program with rawtp as target_fd 3) create tracing link for fentry program with target_fd = 0 4) repeat 3 In the end we have: - prog->aux->dst_trampoline == NULL - tgt_prog == NULL (because we did not provide target_fd to link_create) - prog->aux->attach_btf == NULL (the program was loaded with attach_prog_fd=X) - the program was loaded for tgt_prog but we have no way to find out which one BUG: kernel NULL pointer dereference, address: 0000000000000058 Call Trace: ? __die+0x20/0x70 ? page_fault_oops+0x15b/0x430 ? fixup_exception+0x22/0x330 ? exc_page_fault+0x6f/0x170 ? asm_exc_page_fault+0x22/0x30 ? bpf_tracing_prog_attach+0x279/0x560 ? btf_obj_id+0x5/0x10 bpf_tracing_prog_attach+0x439/0x560 __sys_bpf+0x1cf4/0x2de0 __x64_sys_bpf+0x1c/0x30 do_syscall_64+0x41/0xf0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 Return -EINVAL in this situation. [Fix] Mantic: Clean cherry-pick. [Test Case] Compile and boot tested. [Where problems could occur] Issues could occur when the user uses bpf, though the risk of regression is reasonably low as the only change is an additional validation check. Jiri Olsa (1): bpf: Fix re-attachment branch in bpf_tracing_prog_attach kernel/bpf/syscall.c | 9 +++++++++ 1 file changed, 9 insertions(+)