Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1082353rdg; Fri, 13 Oct 2023 09:38:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHecMRBM19acFFfwoZwats87aKTMBvuUqanPC58IOpzunulBwUwCgT3lCTnBSypZ1lJhBH5 X-Received: by 2002:a17:903:248:b0:1c4:72c9:64fc with SMTP id j8-20020a170903024800b001c472c964fcmr28259848plh.22.1697215138762; Fri, 13 Oct 2023 09:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697215138; cv=none; d=google.com; s=arc-20160816; b=BldfIR99aTU1QPRoN8giOG1wW2ozSByAst4s6SvW/mdtsZCR7Rv80vDdGiWgh6Y+n/ o4esVAQxeOXh5eHp6FXql10bh4r5QLmUL0tTUcz5UnsxD4NXmkEr0auNkQS1no6DaWP2 q8bkgUBK8VEqkiNHl61xfdh7QMPE/jcj28EQTvGqp91cWMzGpURroGAMA/cAfCmOSQP+ FMGFXEnR2Dsa+bIx44YU1kNO3hMdxxLcldBWQv9oz/dO7rk7jSrPhYZoD1T4CIuBSk1N rFK1UR537V0a1rlFSSGb4Zx9fF3kgQxW7+0HFx96zzICQG9Jxv7GnE28yYu4rviVKKxk t+Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=85tz8MZnQIy0CUyHXD4OwO6hFEU+0OOkrrzLhDAPynw=; fh=tl2aGAXISma15kBsuXs/v/ij5r+Y6AXOpSuzYCP+xy8=; b=mRjgQf33kqhNte2TrGDzWFgf5tQy4XXYag8MgVJATGEsvERbUPrQ4FGCEhq9aYSFUk ADcVWCOxO0LLay/sAlMvu297R8/8AIz+MSfjrQqs9tMdR8tysiXfETtTMFYzhgyv3fiX UOc9Bubi6/5blGqoXMJIYM49IPD9VwYZ2EkMubmoQvR9XA6Al94uiK+WSuBJtoKHD3ZH El7yHqKgHqxayrBoIQITGhpiG1zCI95aJSeM0VUy1gv/aImbUf+B553Y9yV2BHBZDO4T EpXJ1gzYIO/gD2cKqWnl4YFvSootxuX2rQgYSgATPI8jUKogzps6iAuwOL1Ap721fDGR clgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=Q90R7Tdr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id o15-20020a170902d4cf00b001c6189eaaebsi146896plg.186.2023.10.13.09.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 09:38:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=Q90R7Tdr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D70C48027E29; Fri, 13 Oct 2023 09:38:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231390AbjJMQil (ORCPT + 99 others); Fri, 13 Oct 2023 12:38:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbjJMQih (ORCPT ); Fri, 13 Oct 2023 12:38:37 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F747BE for ; Fri, 13 Oct 2023 09:38:35 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-d9a7a3e17d1so2533190276.2 for ; Fri, 13 Oct 2023 09:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1697215114; x=1697819914; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=85tz8MZnQIy0CUyHXD4OwO6hFEU+0OOkrrzLhDAPynw=; b=Q90R7Tdrw7oRx2g7QAuiOQfZ0moqLRi0ko1qyZhnLu68DdroxUEZIZKnYfrcTlEKHZ F2o9IHgWzk8aHLHfIF14T7v2rkjG2OaTJntJhFE020tmKlxjtdvweSw81h/GmEDVdT9A obdHXgUydPNnob+3r8KdEv1ojDVBnCdthXzgdmq56O3rNndoRI6ecYVSF13Q5/GpIJAG 1PGe5u0iFbpoIMhdrS5/6EYJOBP4xVIj6gT6rMzbL535Bqnu3JiRuURSrChrMOZkF1HY J7lJIBRJCJsY8ji8W3H64++Bt/h22HUxEe9ijrUNRiqs5KdQxqiKKlyVD4AUGDpkk5T7 c1Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697215114; x=1697819914; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=85tz8MZnQIy0CUyHXD4OwO6hFEU+0OOkrrzLhDAPynw=; b=mC8ZieJbPzGJay+ZWc2+PpokpMvFcVfBYPtJQvwIk0l/GZqN1o+WB5kk5njkpx2dR6 jwmTipGZMQs8NWvChOQRzVY9cERma8rz1BtkPVwfNbP4PkZlCuIw8E1INp8XfYcdsZDG 4uFVNlm//0F4HHrSR2qFGOx/lCl8uVGz3R10zdsGrCQRhhwNl5McL2hnsrfVywcxH2Bj AOMWwDjyRr3sGdDzC6Xz1/t/SIdSGy6myXITA4FLSa+blyUmvZqs5pRvpIX/pimW5AjX I4fXkC/rpFMO81PSoZGWenIG9skuRBIA9lpzLNPaDL/09cp38bMo/KUoGLfATfYWLbmD nZmg== X-Gm-Message-State: AOJu0YxEo5p7OqQLz00lIphXrcdeMTdB9gYWPJ9bpes6NV+cBRTf6kCT tB/W6HhpuhQu9THlq/5GdxO0DXTQRffHaKkGOQOd X-Received: by 2002:a25:8f8c:0:b0:d89:f292:6e80 with SMTP id u12-20020a258f8c000000b00d89f2926e80mr26964031ybl.35.1697215114724; Fri, 13 Oct 2023 09:38:34 -0700 (PDT) MIME-Version: 1.0 References: <20231012215518.GA4048@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20231013-karierte-mehrzahl-6a938035609e@brauner> <20231013-hakte-sitzt-853957a5d8da@brauner> In-Reply-To: <20231013-hakte-sitzt-853957a5d8da@brauner> From: Paul Moore Date: Fri, 13 Oct 2023 12:38:24 -0400 Message-ID: Subject: Re: [PATCH] audit,io_uring: io_uring openat triggers audit reference count underflow To: Christian Brauner Cc: Dan Clash , linux-kernel@vger.kernel.org, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, dan.clash@microsoft.com, audit@vger.kernel.org, io-uring@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 13 Oct 2023 09:38:54 -0700 (PDT) On Fri, Oct 13, 2023 at 12:22=E2=80=AFPM Christian Brauner wrote: > > On Fri, Oct 13, 2023 at 11:56:08AM -0400, Paul Moore wrote: > > On Fri, Oct 13, 2023 at 11:44=E2=80=AFAM Christian Brauner wrote: > > > > > > On Thu, 12 Oct 2023 14:55:18 -0700, Dan Clash wrote: > > > > An io_uring openat operation can update an audit reference count > > > > from multiple threads resulting in the call trace below. > > > > > > > > A call to io_uring_submit() with a single openat op with a flag of > > > > IOSQE_ASYNC results in the following reference count updates. > > > > > > > > These first part of the system call performs two increments that do= not race. > > > > > > > > [...] > > > > > > Picking this up as is. Let me know if this needs another tree. > > > > Whoa. A couple of things: > > > > * Please don't merge patches into an upstream tree if all of the > > affected subsystems haven't ACK'd the patch. I know you've got your > > boilerplate below about ACKs *after* the merge, which is fine, but I > > find it breaks decorum a bit to merge patches without an explicit ACK > > or even just a "looks good to me" from all of the relevant subsystems. > > I simply read your mail: > > X-Date: Fri, 13 Oct 2023 17:43:54 +0200 > X-URI: https://lore.kernel.org/lkml/CAHC9VhQcSY9q=3DwVT7hOz9y=3Do3a67BVUn= VGNotgAvE6vK7WAkBw@mail.gmail.com > > "I'm not too concerned, either approach works for me, the important bit > is moving to an atomic_t/refcount_t so we can protect ourselves > against the race. The patch looks good to me and I'd like to get this > fix merged." > > including that "The patch looks good to me [...]" part before I sent out > the application message: Some of this is likely due to email races, or far faster than normal responses. When I was writing the email you reference above ("This patch looks good to me...") the last email I had from you was asking for changes to the patch; since you were suggesting a change I made the assumption (which arguably one shouldn't assume things) that you were not planning to merge the patch. > X-Date: Fri, 13 Oct 2023 17:44:36 +0200 > X-URI: https://lore.kernel.org/lkml/20231013-karierte-mehrzahl-6a93803560= 9e@brauner > > > Regardless, as I mentioned in my last email (I think our last emails > > raced a bit), I'm okay with this change, please add my ACK. > > It's before the weekend and we're about to release -rc6. This thing > needs to be in -next, you said it looks good to you in a prior mail. I'm > not sure why I'm receiving this mail apart from the justified > clarification about -stable although that was made explicit in your > prior mail as well. I hope I explained the intent in my last email a bit more clearly with the explanation above. Regardless, I think the lessons to be learned is that I won't assume that your suggestion of changes and merging a patch are mutually exclusive, and just to be on the safe side I would ask that you not merge audit, LSM, or SELinux related patches without an explicit ACK from those subsystems. Hopefully that should prevent things like this from happening again. --=20 paul-moore.com