Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp147824pxb; Thu, 2 Sep 2021 22:02:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTQ/xYmJBVhFLGqAPp7TmR1xS2E6TQOeuojhLVCroHIhnPtKj7/rC5z9ngzOGehovnQox/ X-Received: by 2002:a02:374f:: with SMTP id r76mr1141042jar.24.1630645346655; Thu, 02 Sep 2021 22:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630645346; cv=none; d=google.com; s=arc-20160816; b=nne316C357vsTMd2OUqGKukBQmmNJp9cHWB+l5gdCpjWZreQeOM7lXeRI3v2OfvKw3 pq90AcpR208GZHoI25itW0tC+X18ahuHz3/FQorZtypuyEEs83BacCfTkdvJWNeBPgHa hsvpvwqMVk9g4+tiaZxBhwwY9BWB0CRQqMHc8S4NM3au3uLVnBe8afW8KGO0iXhHXr6T vTsOQbsqwaNVhCQJJ3BBcoU1HSGw1g0sOHlaEPImUhVFZJTmREoxoPwdwO1vWzZtn8C/ 0Mr5OgB8Qrmtzordy9IQVR7vJmrCU6WlgnfwiH0vsDkY7GMobmjnCrQ5EY/UtzMkX0JC 3vNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dJfqDQcfF4roaTG57uVqg5I9alTSc50jIPG/Hdr+W6g=; b=vVL3HNkt9CAbDX87KvIjZB0pJ7byGqIxGBxwGbLjdpTAvxRk6zXvMTIeycwuE7bRGx Qr+k3icPeGWh9RHSHQBo4G9QQ2m95RMJvSS7dN0HitDh/kfxcfGu/CIjyf0J1/ALc6+H zUYCJfrepN9U5fkxxbaZiEeLG3BsM263y0axSIH5R/ZzHdDAuAeZyKSXXKOO3w+eBKcc o08xZ2tKK7Xm5KnCzwKc4EFbiAlo5ruW6VmoYKC3j0O0cOf+VaPyzeT82+p1BJgOdepz A0OG7ukrTqgv43urwo+GqZnebVMYSZr8qjvxrk8qQqQAUC29PmzGb9gUnK8Dh0YiZwB1 ZwyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f+Js2Gui; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q14si5274005ilo.128.2021.09.02.22.02.14; Thu, 02 Sep 2021 22:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f+Js2Gui; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232347AbhICFBO (ORCPT + 99 others); Fri, 3 Sep 2021 01:01:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:58980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbhICFBL (ORCPT ); Fri, 3 Sep 2021 01:01:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E98C6056C; Fri, 3 Sep 2021 05:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630645212; bh=fbMZl8VBOcbMURISC4vnJ6+SwDyWl+Ghz6xF4QwL0ok=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f+Js2GuiNpgDbIa3uyd5qDH2tXYsWDbamaWkQLwTTSFRg/6s0CqtU1vBZNYNGYI3V JjsnfNRGldxAVCWAEGjw5lgWCKwKmdXT7LMui1djr6VivllaN3qzKQSdO7k/JOj5kA 1klg/0TG9WWnu7cMhkCExmSG8iDWWsSPZP6+OWJ8= Date: Fri, 3 Sep 2021 07:00:09 +0200 From: Greg Kroah-Hartman To: "Eric W. Biederman" Cc: Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, syzbot+01985d7909f9468f013c@syzkaller.appspotmail.com, Alexey Gladkov Subject: Re: [PATCH 5.10 036/103] ucounts: Increase ucounts reference counter before the security hook Message-ID: References: <20210901122300.503008474@linuxfoundation.org> <20210901122301.773759848@linuxfoundation.org> <87v93k4bl6.fsf@disp2133> <875yvk1a31.fsf@disp2133> <875yvizwb9.fsf@disp2133> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 03, 2021 at 06:57:39AM +0200, Greg Kroah-Hartman wrote: > On Thu, Sep 02, 2021 at 01:06:34PM -0500, Eric W. Biederman wrote: > > Sasha Levin writes: > > > > > On Wed, Sep 01, 2021 at 12:26:10PM -0500, Eric W. Biederman wrote: > > >>Greg Kroah-Hartman writes: > > >> > > >>> On Wed, Sep 01, 2021 at 09:25:25AM -0500, Eric W. Biederman wrote: > > >>>> Greg Kroah-Hartman writes: > > >>>> > > >>>> > From: Alexey Gladkov > > >>>> > > > >>>> > [ Upstream commit bbb6d0f3e1feb43d663af089c7dedb23be6a04fb ] > > >>>> > > > >>>> > We need to increment the ucounts reference counter befor security_prepare_creds() > > >>>> > because this function may fail and abort_creds() will try to decrement > > >>>> > this reference. > > >>>> > > >>>> Has the conversion of the rlimits to ucounts been backported? > > >>>> > > >>>> Semantically the code is an improvement but I don't know of any cases > > >>>> where it makes enough of a real-world difference to make it worth > > >>>> backporting the code. > > >>>> > > >>>> Certainly the ucount/rlimit conversions do not meet the historical > > >>>> criteria for backports. AKA simple obviously correct patches. > > >>>> > > >>>> The fact we have been applying fixes for the entire v5.14 stabilization > > >>>> period is a testament to the code not quite being obviously correct. > > >>>> > > >>>> Without backports the code only affects v5.14 so I have not been > > >>>> including a Cc stable on any of the commits. > > >>>> > > >>>> So color me very puzzled about what is going on here. > > >>> > > >>> Sasha picked this for some reason, but if you think it should be > > >>> dropped, we can easily do so. > > >> > > >>My question is what is the reason Sasha picked this up? > > >> > > >>If this patch even applies to v5.10 the earlier patches have been > > >>backported. So we can't just drop this patch. Either the earlier > > >>backports need to be reverted, or we need to make certain all of the > > >>patches are backported. > > >> > > >>I really am trying to understand what is going on and why. > > > > > > I'll happily explain. The commit message is telling us that: > > > > > > 1. There is an issue uncovered by syzbot which this patch fixes: > > > > > > "Reported-by: syzbot" > > > > > > 2. The issue was introduced in 905ae01c4ae2 ("Add a reference to ucounts > > > for each cred"): > > > > > > "Fixes: 905ae01c4ae2" > > > > > > Since 905ae01c4ae2 exist in 5.10, and this patch seemed to fix an issue, > > > I've queued it up. > > > > Which begs the question as Alex mentioned how did 905ae01c4ae2 get into > > 5.10, as it was merged to Linus's tree in the merge window for 5.14. > > > > > In general, if we're missing backports, backported something only > > > partially and should revert it, or anything else that might cause an > > > issue, we'd be more than happy to work with you to fix it up. > > > > > > All the patches we queue up get multiple rounds of emails and reviews, > > > if there is a better way to solicit reviews so that we won't up in a > > > place where you haven't noticed something going in earlier we'd be more > > > than happy to improve that process too. > > > > I have the bad feeling that 905ae01c4ae2 was backported because it was a > > prerequisite to something with a Fixes tag. > > > > Fixes tags especially in this instance don't mean code needs to go to > > stable Fixes tags mean that a bug was fixed. Since I thought the code > > only existed in Linus's tree, I haven't been adding Cc stable or even > > thinking about earlier kernels with respect to this code. > > > > I honestly can't keep up with the level of review needed for patches > > targeting Linus's tree. So I occasionally glance at patches destined > > for the stable tree. > > > > Most of the time it is something being backported without a stable tag, > > but with a fixes tag, that is unnecessary but generally harmless so I > > ignore it. > > > > In this instance it looks like a whole new feature that has had a rocky > > history and a lot of time to stablize is somehow backported to 5.10 and > > 5.13. I think all of the known issues are addressed but I won't know > > if all of the issues syzkaller can find are found for another couple of > > weeks. > > > > Because this code was not obviously correct, because this code did not > > have a stable tag, because I am not even certain it is stable yet, > > I am asking do you know how this code that feels to me like feature work > > wound up being backported? AKA why is 905ae01c4ae2 in 5.10 and 5.13. > > Looks like Sasha added it to the tree last week and it went out in the > last set of releases. Sasha, why was this added? Let me see if it was > a requirement of some other patch... Sorry, no, that was this patch, let me get my coffee before I dig into this...