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 64A12C41535 for ; Thu, 22 Dec 2022 22:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbiLVWuh (ORCPT ); Thu, 22 Dec 2022 17:50:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiLVWue (ORCPT ); Thu, 22 Dec 2022 17:50:34 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A61215805 for ; Thu, 22 Dec 2022 14:49:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671749387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T5tSKb7wZI9TuUYQEjEMUmwtz91Vlj6W8nktMCP9Zus=; b=ZtVjycAwKhUj/FfTO22PXbCEh7I/SL9xD805T+/FOJ2zxPXk8/m5EfYXDzXE+KXJEqGfeP QbthY2dDUF9kWWYU68MnFy89ikdBCCysWad9W5V1YI6ysFaGwvkHpqgQeYsvEGmAuPBkNr dAHsjt9t34lNw3LoL4VYZINup62lEAc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-140-DR4enSDDO1yddjyLFPIYKw-1; Thu, 22 Dec 2022 17:49:46 -0500 X-MC-Unique: DR4enSDDO1yddjyLFPIYKw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F6043804522; Thu, 22 Dec 2022 22:49:45 +0000 (UTC) Received: from llong.com (unknown [10.22.32.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 647DC51EF; Thu, 22 Dec 2022 22:49:44 +0000 (UTC) From: Waiman Long To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider Cc: Phil Auld , Wenjie Li , =?UTF-8?q?David=20Wang=20=E7=8E=8B=E6=A0=87?= , Quentin Perret , Will Deacon , linux-kernel@vger.kernel.org, Waiman Long Subject: [PATCH v4 0/2] sched: Fix dup_user_cpus_ptr() & do_set_cpus_allowed() bugs Date: Thu, 22 Dec 2022 17:49:35 -0500 Message-Id: <20221222224937.21028-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v4: - Make sure user_cpus_ptr allocation size is large enough for rcu_head. This series fixes a UAF bug in dup_user_cpus_ptr() and uses kfree_rcu() in do_set_cpus_allowed to avoid lockdep splats. Waiman Long (2): sched: Fix use-after-free bug in dup_user_cpus_ptr() sched: Use kfree_rcu() in do_set_cpus_allowed() kernel/sched/core.c | 59 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 8 deletions(-) -- 2.31.1