Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp744937rwj; Fri, 23 Dec 2022 07:34:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQV5NklBlkPJpkDDcd9iP10I7uG4zK8gkgQVtYtcFQUa46M58p84VuUBH/lrqVhG3cOPx1 X-Received: by 2002:a05:6a20:3d85:b0:a3:587b:56ac with SMTP id s5-20020a056a203d8500b000a3587b56acmr16036126pzi.52.1671809642462; Fri, 23 Dec 2022 07:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671809642; cv=none; d=google.com; s=arc-20160816; b=Pnpnxouio1+iTdXaY+p0NhpGLfWS8l9ivbkcLkScGW45JXO4Nc+7tGc4ZDWlZ/dXyj SkHAQlgu+ip2sGs/VfU80gXKCCZv2zhTO1vzQ5ttSmej9JxdQY/7OKT1whfU2UI560hG Dj5nW9wbmEbgO/WaOWWTDWHtrQ2lXdWCfof+0l3An+2trKjaVnGmbuajYD4t8CXifgt6 cpO36cCe2eGWDtCkdvy+iN4Po2lpOqncoRqoLB4CNkDYHRIIoI2nV1/IbSU7bWl9Ojdg x3vWhozCIupu5Yr/Jg4ReQ0FeCR1pDiAqb7llezFHT0M5K1zYomt8GlMgx88X4ZHiWN/ cY4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jGTZSdyngRKzjzBfe0/ecutPYFiMdCVieiSey3gpzJA=; b=EVESfyPxbyixpqMmqMgZn7OpWY+7emCONtENPZI6YfRfmw/82koau9fmapbGrK9U9r ysKCvVjewZM09B7zB7UB8ssZckIma8VDiRQnTn7PmZIqM+/TPthC9i9hGPtz4uMLeL3L qo0uLBLA1WtNs//Q31CNGQiT0jiTfZ0DLcEhfQa+eCVAoPrW+hTeYl5lxpt0EeAACnQj tuWP4+cxSid3WwVnorq7ATRJ8Z/O3xVZ97NhVFcLHmfpe4brDem7eGmsT3ZuHWqkJp2j SA6M/rnMhA1pgidPoxltw8FJ5kK9Q6H8s9BP2vwrTnCO0l+5q2gtHb8Gst7ImoF/ESVK Iogw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=zV2WPcOw; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a654788000000b00457f4e8e21esi3892239pgs.731.2022.12.23.07.33.53; Fri, 23 Dec 2022 07:34:02 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=zV2WPcOw; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230255AbiLWPCF (ORCPT + 65 others); Fri, 23 Dec 2022 10:02:05 -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 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 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