Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4835848iob; Mon, 9 May 2022 02:48:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwofF38nqnqiSyfn07wJmzVbnAh9M5Wm4+GKnUGEPnhI70YYjJDXy4ap/38VzrIujs0dhvH X-Received: by 2002:a62:a105:0:b0:50d:c97b:3084 with SMTP id b5-20020a62a105000000b0050dc97b3084mr15247631pff.61.1652089681290; Mon, 09 May 2022 02:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652089681; cv=none; d=google.com; s=arc-20160816; b=JX+7m5uUFHRAenpn/h3kNzaiqVaquYyxDJlpL3MLoMA+kvtllLm+ix0hYpESZiY7Hb kiGehcP4D2d/XJ1/Uwgx9gaBL8uZd4ADtdeIqq80CmNriijazP3wIywV3Q62dJW+UvsQ +8L8Qqqby4Qv1R2rlfLAmbx/glAYup+ag+vfh8RxVUG1UnPvFtr4097vZDQXJNW4Ype+ OQ9dr9la6bjGUPiLGu8z4KfInFgW9PCdrydVnwOBwYWWy+pqCympLMwvKAkqkxoL3W0F 1GsXTfosmebk96Pe5CheIS2CsyqzCY2Fsgq0FP+WwcsZOsFAd4L1xbsd/40Pm28u9jcg AJEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=jfZTaJpoicKUuG8rwolaeaxRajSEFHW5W78I383CE1I=; b=Y98rTHm59A9xU4O0OlQMpHs16EKP4KW1hAc9ZVfJDZGYOVArw59BaYMZ0nYZL9qEJ/ rOiTHdJnuiOlQce3rjJlNxD0JAyWU9U1k5FBO3t3RiLlCwuYUa6/s9BGu9OkuFl8E1vj rKH9vP007AX6iBTJnBzZVyhmZ2IN/Gp8IjaQQ5k0LGrrSshM8TQYv3eZ4s3isHJgFqGJ uik4ctef5eSP1rc6yKThMZ+aSYi239oVK8uaufsA1BaGbIQJ/MOJ3BbYjke3Bz4zTaob G416/cAM0amHNUy8PYpEKfOWSjTrxFDbzyBXyWgUAbwn79hR1n6bFVhHe2eGu5MejJG9 OeaA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 129-20020a630187000000b003c6b63fc67esi4524689pgb.270.2022.05.09.02.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:48:01 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8A0041CA042; Mon, 9 May 2022 02:30:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444013AbiEFU46 (ORCPT + 99 others); Fri, 6 May 2022 16:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346231AbiEFU45 (ORCPT ); Fri, 6 May 2022 16:56:57 -0400 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 841DB6EB07; Fri, 6 May 2022 13:53:13 -0700 (PDT) Received: from in01.mta.xmission.com ([166.70.13.51]:37328) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nn4wo-008Pnb-Qf; Fri, 06 May 2022 14:53:10 -0600 Received: from ip68-227-174-4.om.om.cox.net ([68.227.174.4]:37272 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nn4wn-009MmH-Ri; Fri, 06 May 2022 14:53:10 -0600 From: "Eric W. Biederman" To: chill Cc: linux-arch@vger.kernel.org, Tejun Heo , Peter Zijlstra , Vincent Guittot , Al Viro , Jens Axboe , Thomas Gleixner , Linus Torvalds , linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <87mtfu4up3.fsf@email.froward.int.ebiederm.org> <20220506141512.516114-1-ebiederm@xmission.com> Date: Fri, 06 May 2022 15:53:01 -0500 In-Reply-To: (chill's message of "Fri, 6 May 2022 14:51:30 +0000") Message-ID: <8735hm1iz6.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1nn4wn-009MmH-Ri;;;mid=<8735hm1iz6.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.4;;;frm=ebiederm@xmission.com;;;spf=softfail X-XM-AID: U2FsdGVkX1/0RPxEyql+RbzaQX8b404dYmxPbZsYufU= X-SA-Exim-Connect-IP: 68.227.174.4 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-DCC: XMission; sa08 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ****;chill X-Spam-Relay-Country: X-Spam-Timing: total 378 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 14 (3.8%), b_tie_ro: 12 (3.2%), parse: 1.08 (0.3%), extract_message_metadata: 3.4 (0.9%), get_uri_detail_list: 0.93 (0.2%), tests_pri_-1000: 4.1 (1.1%), tests_pri_-950: 1.50 (0.4%), tests_pri_-900: 1.50 (0.4%), tests_pri_-90: 75 (19.8%), check_bayes: 72 (19.2%), b_tokenize: 6 (1.6%), b_tok_get_all: 7 (1.9%), b_comp_prob: 2.3 (0.6%), b_tok_touch_all: 52 (13.7%), b_finish: 1.38 (0.4%), tests_pri_0: 256 (67.7%), check_dkim_signature: 0.75 (0.2%), check_dkim_adsp: 4.0 (1.1%), poll_dns_idle: 1.33 (0.4%), tests_pri_10: 2.2 (0.6%), tests_pri_500: 8 (2.2%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 1/7] kthread: Don't allocate kthread_struct for init and umh X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org chill writes: > this looks like a real uaf vulnerability and can be executed by the user The potential to use memory after it has been freed appears completely real. As such it is a bug and it should definitely be fixed. That is as far as I can see. What I don't see, and I am very bad at this so I could be missing something, is what bad thing kthread_is_per_cpu could be tricked into doing. I see a window of a single instruction which reads a single bit that normally will return false. If that bit instead reads true it looks like the scheduler will simply decide to not run the process on another cpu. So I will put this change in linux-next. It will be tested and I will send it to Linus when the merge window for v5.19 opens. After Linus merges this I expect after a week or so it will be backported to the various stable kernels. Not that it needs to go farther than about v5.17 where I introduced the bug. Eric