From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6787BC4332F for ; Fri, 23 Dec 2022 15:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236294AbiLWPCG (ORCPT ); Fri, 23 Dec 2022 10:02:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236454AbiLWPCB (ORCPT ); Fri, 23 Dec 2022 10:02:01 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 141A4205D7 for ; Fri, 23 Dec 2022 07:01:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jGTZSdyngRKzjzBfe0/ecutPYFiMdCVieiSey3gpzJA=; b=zV2WPcOwTj1gVfuE6w/XIubUPl yGenidnCU/e1jYunxjlqqEysto+FilWIltmsROkiL13dJpgWLfmqN0WdQbIHNH9FCjYexqz7Hx9KM 44Q4xV7c7j3tbShWe7nnYgkhylgOWlyrJIS8yjwLruG9X//wbZSou+UYERsZ+3QbHrDX7rcyyyGJu klHS78xW1TDXW00iLqyQJbuf0r3D1E5wTwwmGuIdAgnwbAM+VleDFbgYv1EuxFlcJyC1IukNegK27 luLEWuysZ4T/ITBMApwNdGzrJliiikU0wqroVwYFi8H8/cv5wAmQy7/O4feXJyXgjXmsSMz+iiKam 6T4XvwRQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p8jYS-0099bz-9b; Fri, 23 Dec 2022 15:01:48 +0000 Date: Fri, 23 Dec 2022 07:01:48 -0800 From: Luis Chamberlain To: Schspa Shi Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, syzbot+10d19d528d9755d9af22@syzkaller.appspotmail.com, syzbot+70d5d5d83d03db2c813d@syzkaller.appspotmail.com, syzbot+83cb0411d0fcf0a30fc1@syzkaller.appspotmail.com Subject: Re: [PATCH] umh: fix UAF when the process is being killed Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 22, 2022 at 08:09:38PM +0800, Schspa Shi wrote: > > Attaching the full test program in case anyone wants to add some > comments. Good stuff. That looks like a kernel sefltest. So you can just add it as an initial selftest for completion so lib/test_completion.c and extend lib/Kconfig.debug for a new kconfig symbol for it, and then just add a script on tools/testing/selftets/completion/ with a simple makefile which references a script which just calls modprobe. You can look at tools/testing/selftests/kmod/ for an example. But I still think you may want an SmPL Coccinelle grammer patch to hunt down other users with this pattern. The beneefit is that then you can use the same Coccinelle patch to also then *fix* the issue in other places. The current uaf on umh is not something I'm terribly concerned to be exploited in the wild. I don't think other use cases would be easier, but, all this work would close the gap completely. Thanks for doing this. Luis