Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2487512iof; Wed, 8 Jun 2022 06:05:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkiE3TH58DsTFGgS1m9VKTBcUJgY87hLJJlxtpLhxn+R+cpOkawC4eetyd9vXSkCMCVnIQ X-Received: by 2002:a17:902:d4c2:b0:166:46c9:577b with SMTP id o2-20020a170902d4c200b0016646c9577bmr30451776plg.66.1654693552001; Wed, 08 Jun 2022 06:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654693551; cv=none; d=google.com; s=arc-20160816; b=FeYRzNSM426yFR1pNT0++4/G+6yC4zBM+5ArZsyii6ps17guWDR+wHB9NysB/quo5X Uw8WMtGo6h+swkkAj9LTwH/RLTR63c3XCCbxNIN3qc0zFuqz2GusKIi9I7ZasIjfPTvC zf+OkpHnHD+COBWel5qI0xXpz9kLfTCbB/YmIY8rMsnW3fsNYX58HZQsg1e1Y9to5IiP +aWLiaHtqveYKELpNZtKNelzzXBlDnEOT89sLpH+n/iU2f9fgsSNbPh2fR90UFi6CClQ cL16kUjepOk6m3Y1y0W/se1Lzeyo6AnkTUVMNLxeJfV+8es0Rw8rxUjk8u9ayGP3RjHz zr8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=onzjYOmR9fnF9hgh3chjb9d4M+UjOXN2Q5o+usQWbG0=; b=068NmOH0c5Va2mM53G4zW2LuXRoNpCIh3r7btT8Sv1EV4YuXVnJ1VuMjxXc7Kgb6M2 pDxCesU/qoCT3vyqhCy/rOtmSMiNCnB6Bgl/Q2u/btNUuKDDfnVKuW2JZmAbO5qgO9GU LtzbijeTQawV/8NxgwfI7rMdQfIrxtvDPewrQKkdietahGW+Z8hDOGIbqq/U0+orqh2f L7+qOspBSWqWhqUOf7ZBboEvfHRC8pImYTIBdzFM3hIKexH8p4p2bqqyjH9utPsx0hvk AK1ccIJI4hSqrBABjJIsgz+dwCyLtYfKh0b8L91BbH5CM8jMegZbxwoEaDKYmd5nMh+Y PQdQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f4-20020a170902860400b0016786f2d1d8si9342607plo.475.2022.06.08.06.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 06:05:51 -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; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 285325DD1F; Wed, 8 Jun 2022 05:39:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239512AbiFHMjH (ORCPT + 99 others); Wed, 8 Jun 2022 08:39:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239345AbiFHMjF (ORCPT ); Wed, 8 Jun 2022 08:39:05 -0400 Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B777C2CDB2E; Wed, 8 Jun 2022 05:39:03 -0700 (PDT) Received: from sslproxy01.your-server.de ([78.46.139.224]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1nyuxS-0008jR-SU; Wed, 08 Jun 2022 14:38:46 +0200 Received: from [85.1.206.226] (helo=linux.home) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nyuxR-000O0f-W8; Wed, 08 Jun 2022 14:38:46 +0200 Subject: Re: [PATCH] tracing/kprobes: Check whether get_kretprobe() returns NULL in kretprobe_dispatcher() To: Steven Rostedt , "Masami Hiramatsu (Google)" Cc: Peter Zijlstra , Ingo Molnar , Yonghong Song , bpf , Kernel Team , linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <165366693881.797669.16926184644089588731.stgit@devnote2> <0204f480-cdb0-e49f-9034-602eced02966@iogearbox.net> <7619DB57-C39B-4A49-808C-7ACF12D58592@goodmis.org> From: Daniel Borkmann Message-ID: Date: Wed, 8 Jun 2022 14:38:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <7619DB57-C39B-4A49-808C-7ACF12D58592@goodmis.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.6/26566/Wed Jun 8 10:05:45 2022) X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 On 5/31/22 12:00 AM, Steven Rostedt wrote: > On May 30, 2022 9:33:23 PM GMT+02:00, Daniel Borkmann wrote: >> On 5/27/22 5:55 PM, Masami Hiramatsu (Google) wrote: >>> From: Masami Hiramatsu (Google) >>> >>> There is a small chance that get_kretprobe(ri) returns NULL in >>> kretprobe_dispatcher() when another CPU unregisters the kretprobe >>> right after __kretprobe_trampoline_handler(). >>> >>> To avoid this issue, kretprobe_dispatcher() checks the get_kretprobe() >>> return value again. And if it is NULL, it returns soon because that >>> kretprobe is under unregistering process. >>> >>> This issue has been introduced when the kretprobe is decoupled >>> from the struct kretprobe_instance by commit d741bf41d7c7 >>> ("kprobes: Remove kretprobe hash"). Before that commit, the >>> struct kretprob_instance::rp directly points the kretprobe >>> and it is never be NULL. >>> >>> Reported-by: Yonghong Song >>> Fixes: d741bf41d7c7 ("kprobes: Remove kretprobe hash") >>> Cc: stable@vger.kernel.org >>> Signed-off-by: Masami Hiramatsu (Google) >> >> Steven, I presume you'll pick this fix up? > > I'm currently at Embedded/Kernel Recipes, but yeah, I'll take a look at it. (Just need to finish my slides first ;-) Ok, thanks. If I don't hear back I presume you'll pick it up then.