Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp330982imn; Thu, 4 Aug 2022 07:38:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR5mVgkxRZxUW9bH/qPOLoQIgTiIax7ZIlL2/PmH5Z6wJabc0P4zhJMqi7El36bM2IQ6NwJS X-Received: by 2002:a17:907:2809:b0:730:a723:9ddf with SMTP id eb9-20020a170907280900b00730a7239ddfmr1659800ejc.42.1659623909849; Thu, 04 Aug 2022 07:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659623909; cv=none; d=google.com; s=arc-20160816; b=BLWT2qNTvjghXfubDJHnggVV1Pagd8TmhXTJNk9q32E7cOdSX+nM0FTNeDZssKWgvN ibVhV9a4sipDI/3ryFaw0zpXr1WQakyWiv7+LBXEfG0rUkHhqgDsVfyCsJn7L43Ga2QE L0XXdUMj9FGTaxaVtTYdO9PYRyf03bHgC2kX5tXWxwz7Nk8XXEluwApEQBvPZaj+s537 3ElvaQT4ZRysIfrmL4JBSFs6TS8D973W/NLIIrKY1NEpvhY2GIR0R92duW/qLays7eGU YkWfxA/9oZPELKEPSa1vpfu2vjLFmInCsHpZMCLJfOUkuVGSZ7IB1aQROgPIrvh2wMaX b6nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=q+k2/oQCg1jExDf3V4wAMLxe+YHu3Cav2Cj1hEhSNaI=; b=g7YiqHlHoL/Q+YDyfXlKbaaiapcKorkl187mYI3+LpzPRjfMjQ3TwhmSrhknYf3hzk ojxI4ZDG6woknazLEyO6g03ywCFEnCCicrqrtcWwY3NVCz1M49SvmLAK/+3pfw3YB2oq xEgM65VPPwHsv3S4jYkv7sdxfGkz57JIDfNlMol1X06m2k2GmkmQY9dpsjgk6zYH9jAO XPMKm2RqdV8UP3wdMAmSmA38P3tpUfcvVawJKEgjMXeCvmaWToJL+y23LkaNqjzNFODF 4UkDXnqo4GtndXOl8vgFlzD5eR5WsDuYw/2FpaV+4fNLmGaY2adIsJPNF39nh8KZmyHY iXmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="hE/oiEFn"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a1709064bd300b0072b9b9c2a74si917101ejv.251.2022.08.04.07.38.04; Thu, 04 Aug 2022 07:38:29 -0700 (PDT) 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=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="hE/oiEFn"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239732AbiHDOgW (ORCPT + 99 others); Thu, 4 Aug 2022 10:36:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234258AbiHDOgU (ORCPT ); Thu, 4 Aug 2022 10:36:20 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB2332060 for ; Thu, 4 Aug 2022 07:36:19 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id z187so9615239pfb.12 for ; Thu, 04 Aug 2022 07:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=from:to:cc:in-reply-to:references:subject:message-id:date :mime-version:content-transfer-encoding; bh=q+k2/oQCg1jExDf3V4wAMLxe+YHu3Cav2Cj1hEhSNaI=; b=hE/oiEFnClv6y9rBHS2KMK6uuYGV0bVD21qZwtxdqZZmyh8k38w/J6Qot3ihBwHCsr +9bjT8zHi1y2HAOFKWIAT0cE2At/qgXJNxJMte7A2oqMd7MD9csFv3Hi4a75c5HMJ2iA GtwMS+oGPYOklrpW7S0botKdD3HBD3wXtRpXfjlQYKeW+mGGBCAJjfGk0Jfbgih5+NLr pD+VnyUgWZ2lTvRKRodcgEjHjACT105SBfJGerMo6oqdwY6tfVz7XNgUK6YEX5wtZ1vk vCcHZ9gczAibbdkDA+LGnxCrdEt+13gYZhYXchttcZhGXn+L38dkEeV0oZvFKdNWgy4H n+bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:in-reply-to:references:subject :message-id:date:mime-version:content-transfer-encoding; bh=q+k2/oQCg1jExDf3V4wAMLxe+YHu3Cav2Cj1hEhSNaI=; b=HtpDxB+SHuplgxNdYTBSxezKCDKRI1RRU35kPeAarCk5pD+6cfeYKdPP4l6EsSVah3 hJ2IHv6eCWCh+QE50mk36H/sOQ6NF0GvcgXVJ2eOHrzB8sbfOMa6WwKGknTPkvI5nWcC EJ4uhLSoobJP3St+B1R+lIZahP94qz5xZvjomeLQgAPooilyA2pG0v+PJI+YCLYLPWHk RpRz26RaPZrPaTrPXn0dPudAXXg+IOLeuG4Tz7dCkeb3MuNVCKMfGLLLPZhA8W0epJSw 3R6b+p0b7PiKqzlT+LbglevN0sLMJytAaqaGV09l5xM0EniuT6UHfIFhJktLbx3+MGn0 M73w== X-Gm-Message-State: ACgBeo1B/0o0Q+QD+Rb+TZch57eg+bJlIkUDJ2HXXhU27ai7wQdRjTFr ZiJXBL+0uEuHAOPJKA7L/y8GAQ== X-Received: by 2002:a63:82c2:0:b0:41b:c0f3:39b3 with SMTP id w185-20020a6382c2000000b0041bc0f339b3mr1878157pgd.86.1659623778954; Thu, 04 Aug 2022 07:36:18 -0700 (PDT) Received: from [127.0.1.1] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id x12-20020a17090300cc00b0016d2db82962sm1084731plc.16.2022.08.04.07.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 07:36:18 -0700 (PDT) From: Jens Axboe To: paul@paul-moore.com, yepeilin.cs@gmail.com, eparis@redhat.com, asml.silence@gmail.com Cc: linux-audit@redhat.com, peilin.ye@bytedance.com, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220803222343.31673-1-yepeilin.cs@gmail.com> References: <20220803050230.30152-1-yepeilin.cs@gmail.com> <20220803222343.31673-1-yepeilin.cs@gmail.com> Subject: Re: [PATCH v2] audit, io_uring, io-wq: Fix memory leak in io_sq_thread() and io_wqe_worker() Message-Id: <165962377794.930556.772272743019429536.b4-ty@kernel.dk> Date: Thu, 04 Aug 2022 08:36:17 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Wed, 3 Aug 2022 15:23:43 -0700, Peilin Ye wrote: > From: Peilin Ye > > Currently @audit_context is allocated twice for io_uring workers: > > 1. copy_process() calls audit_alloc(); > 2. io_sq_thread() or io_wqe_worker() calls audit_alloc_kernel() (which > is effectively audit_alloc()) and overwrites @audit_context, > causing: > > [...] Applied, thanks! [1/1] audit, io_uring, io-wq: Fix memory leak in io_sq_thread() and io_wqe_worker() commit: f482aa98652795846cc55da98ebe331eb74f3d0b Best regards, -- Jens Axboe