Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5194520imb; Thu, 7 Mar 2019 09:45:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwB9gx+EQJucu0uPvvksx+WZzWYIiwEarnD74p3qXRFfFdH0/M8D3ppGbnq15/ZoWwq+4lj X-Received: by 2002:a63:a70b:: with SMTP id d11mr12180506pgf.213.1551980710090; Thu, 07 Mar 2019 09:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551980710; cv=none; d=google.com; s=arc-20160816; b=ulIXf4cPvCI6eGFXICKMBSeZPZjHR4745vw79W+cM25bshI7TVP5g0oML2FiNw67rP MqCtC5+6Jj4QqoYO/zN+YksdkuRxQ4oCx4gnyD2/NNiDx04qoJU+HIiSLTUjH5c1EtKt qVsZRs2QSjecZdu8ERP5suSeKCvzwjVCahnxIu7loxYOyzQvKq24BY964PSJmocWZpF2 sHkvWt9XBCSEf6McKsQiumVOwfJ5lgP9KEf/9vMir62M2u2S89gD+2a5mQ1Oog4BZiTE w06ILSIViqJeNLpc651C5fpvdjwRiXjHRaBgTlYxd3D0iZNcZCwE4DZxuAGsemUp0kGP PS6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JHry6dhslx2GQxhF8l2skqCf/87do0ohQJE5cSZtzQ8=; b=cnxnwu08GIuWm40U+YpGQvs5Z3F6gzNzGWBApYc8WfhwacAAHT5oLgaMLGryoM5hMu BSaI7Z5d8NpTMlGdEDqm/qQmk8VRrL+rzPjodpcQB+jTgTSXk3IKhLI4jCFwrxQbkj2l E0wCo93tZW8G8lCOd8llEWjC6nENnp9AFSNvfANqiGNZev1T5utpxjL+SH6sUD5Tln0o ipfIYvZ971ZHEQ5L9AK6TjvQrApZ74DkSIjqQtkDR51V34jgSt7emBNUGYqCu+WllRsw 4laGadqnnWfA9clENnjVhQnvThhtLlR2XqrZ2Np7wqbX2797jJM1AFl9hL/87miQLLRm Tlpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hKpCKfkM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7si4270946pgp.196.2019.03.07.09.44.54; Thu, 07 Mar 2019 09:45:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hKpCKfkM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726414AbfCGRnl (ORCPT + 99 others); Thu, 7 Mar 2019 12:43:41 -0500 Received: from mail-vk1-f195.google.com ([209.85.221.195]:35535 "EHLO mail-vk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbfCGRnk (ORCPT ); Thu, 7 Mar 2019 12:43:40 -0500 Received: by mail-vk1-f195.google.com with SMTP id l136so3918708vke.2 for ; Thu, 07 Mar 2019 09:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JHry6dhslx2GQxhF8l2skqCf/87do0ohQJE5cSZtzQ8=; b=hKpCKfkMltmWFGLG4NtZdcyMdFFi1sBp/kJKK5bl1LIiXCfGQf9ZLGB7DX0oTsWV8v IECnZk29iu+lFRIZonNZhGe8JXF7Z4sTM2IQN9pHAap7bTw9ggAM6RCFrtAzBGRksKB+ ugyQzNJKNdaDQRrJ+SF4dYtOs8R38k+26oaf0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JHry6dhslx2GQxhF8l2skqCf/87do0ohQJE5cSZtzQ8=; b=Ag1ots5vBJ6o3GxHYOqzyccNAxzNxmM8odF9XjzjUJyDAeU+97RNUc4Ih7/ZhgbWnK 0yvxNg+PQuIPZu6k1O7KdN/KJUelbD6BM3f+1yYmcwvsZxCT6rkqbq3AC/hE/qfOzmLG cdUdfG1cleaPNhjbE/JThi2JiiLUngttFmnHTb5CQ8kUqEHmDkVRU+FjyCrbtMs0uxU1 npskATPXa2Qwrrq08OsvpOglfEK8YC/QLxFgQbl6lkBlWp0szhFnBA9trgMTS9TyZAOk MWL7Hj6ZczuT/ovyJqYzvC9hERjXJ7ZDLzlyhOekZ1j1RbAjExxjslg8tGE3wP6NYE/O VDRg== X-Gm-Message-State: APjAAAWuFJSCVYQFphJ8EnQRpCFNN+n3r79Sbkh88DwQPhILESpMyaYm x/aDgdXszuhi7JFJo+smr9o6xa5mfl4= X-Received: by 2002:a1f:2acb:: with SMTP id q194mr6736917vkq.92.1551980618572; Thu, 07 Mar 2019 09:43:38 -0800 (PST) Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com. [209.85.217.45]) by smtp.gmail.com with ESMTPSA id x8sm3490700vkc.36.2019.03.07.09.43.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 09:43:37 -0800 (PST) Received: by mail-vs1-f45.google.com with SMTP id y19so5007604vsc.4 for ; Thu, 07 Mar 2019 09:43:36 -0800 (PST) X-Received: by 2002:a67:6983:: with SMTP id e125mr7355378vsc.222.1551980616476; Thu, 07 Mar 2019 09:43:36 -0800 (PST) MIME-Version: 1.0 References: <20190306110549.7628-1-elena.reshetova@intel.com> In-Reply-To: <20190306110549.7628-1-elena.reshetova@intel.com> From: Kees Cook Date: Thu, 7 Mar 2019 09:43:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/3] creds/cgroups/ns_proxy refcount_t conversions To: Elena Reshetova Cc: "Eric W. Biederman" , serue@us.ibm.com, Peter Zijlstra , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 6, 2019 at 3:05 AM Elena Reshetova wrote: > > I would like to reopen ages-old discussion on these conversions now. > Eric had objections against them in past, namely on not providing enough > security for reference counters (but we still argue it is better > than overflowing atomic_t and resulting use-after-free). > However now, refcount_t has been successfully used in kernel in many places, > helped to detect bugs and mistakes in logic of refcounters. > We have converted most of core kernel reference counters by now and these > 3 are pretty core ones, so it would be really great to have them covered > also. > > The patches are fully independent and can be cherry-picked and > discussed separately. More information about each conversion in each patch > separately. These look good to me. Perhaps they can go via -mm, maybe with Eric and/or Peter's ack/review? I'd really like to get these done so we can get closer to finishing the refcount_t conversions... Thanks! -Kees > > Elena Reshetova (3): > nsproxy: convert nsproxy.count to refcount_t > groups: convert group_info.usage to refcount_t > creds: convert cred.usage to refcount_t > > include/linux/cred.h | 15 +++++++------- > include/linux/nsproxy.h | 6 +++--- > kernel/cred.c | 44 ++++++++++++++++++++--------------------- > kernel/groups.c | 2 +- > kernel/nsproxy.c | 6 +++--- > net/sunrpc/auth.c | 2 +- > 6 files changed, 38 insertions(+), 37 deletions(-) > > -- > 2.17.1 > -- Kees Cook