Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp317300ybl; Tue, 28 Jan 2020 03:50:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwPPXnPsdZ6FWS226kQsWDx5PUK7rLYFjdt2RAEKEDZF/OJSzuSjjQ/bTAuuSodn8xoEhH4 X-Received: by 2002:a05:6808:a8e:: with SMTP id q14mr2425863oij.173.1580212208439; Tue, 28 Jan 2020 03:50:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580212208; cv=none; d=google.com; s=arc-20160816; b=NSWn76tuF/8x29EhVVmBT8dBV9zOF+m8DbaJ2mh/Q4HsbSUEqAOzn/6MERoOwBqOsj UrYahDlDyArOFapJ5YZG64oRLzgZEWdNeKpaC8jJ7mqWF0r2Y0kVtqPsGfeSxX1FDfw+ JA/+m/Bh+DFJUDypFDKCj9GNthn0opd044njTAs+evGd08D2r73f5R2XOr7Q0P7Uvwkj uv2ADduIHQaFW/ExiLWbhL7zvczjcoCI8VG7B9mjOLHcuBK33zPRMcPVQ9lv266/VTBl Fpt61eEvuR1dSqW5Gwy/twIooMBh469SeXt8tqFJCn3sJ18fA2pPDz6pIijFQ4Ad5X8a Khmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lz7R+vtlTh6RBBwj0e/+jD30ITTxMxb0pWI2woJxCN4=; b=BFqUB0BURkCfSgv9k/fchDtQWaIMHGi/4GeN+pOLf97zVg+YTWo0rawRtBpp7uv8Nr Pz1St3KuJNZT2mg3OplKLR8fIoBV50gghwG4YR1Qnbw5SnUG7ElbRzdefL9jTK7d9iw8 SzltBrXJ6E9sZ0gJKhDp4qUuJWpLRXV4GodDt4x4rOQby7XgDtWxLeNTRhbK5e+2+epn ETV2Li0AT2DNdChuvlD160eh8MstSUJIHY1O7RRUN4C5tiLsNCqoqQjWqQEm6ZrjDe6w dAE9bosEHVd0CVMtNAxBWaxPEGr7fBqejjA6ZswoLBARE21YifrC+/FXcteViaH3lISs sZ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iXjK0EpU; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si6337480otp.129.2020.01.28.03.49.55; Tue, 28 Jan 2020 03:50:08 -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=@redhat.com header.s=mimecast20190719 header.b=iXjK0EpU; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726211AbgA1Lse (ORCPT + 99 others); Tue, 28 Jan 2020 06:48:34 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58981 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725959AbgA1Lsd (ORCPT ); Tue, 28 Jan 2020 06:48:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580212112; 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: in-reply-to:in-reply-to:references:references; bh=lz7R+vtlTh6RBBwj0e/+jD30ITTxMxb0pWI2woJxCN4=; b=iXjK0EpUFLJbFcE55x3mbfbnjLLXQtocwKSWSYhlY8It3ijHFQkPYotuFa8ipLHnqnvan4 eQ/bciTlsFBtSJRiTR0kvbJHBaKtJU6Ky39LylENhcAteUgwhM9rjD2qIJ0c4hbmEXcxLo 1jMg/mLL1FB/toLRQ3yKq1jOCFHyk/c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-389-UsiETWpOOCi5duRfEJ096Q-1; Tue, 28 Jan 2020 06:48:24 -0500 X-MC-Unique: UsiETWpOOCi5duRfEJ096Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 949F0107ACC4; Tue, 28 Jan 2020 11:48:22 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.70]) by smtp.corp.redhat.com (Postfix) with SMTP id 3FDA788828; Tue, 28 Jan 2020 11:48:20 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 28 Jan 2020 12:48:21 +0100 (CET) Date: Tue, 28 Jan 2020 12:48:18 +0100 From: Oleg Nesterov To: Jann Horn Cc: Amol Grover , David Howells , Shakeel Butt , James Morris , Kees Cook , Thomas Gleixner , kernel list , linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" Subject: Re: [PATCH] cred: Use RCU primitives to access RCU pointers Message-ID: <20200128114818.GA17943@redhat.com> References: <20200128072740.21272-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/28, Jann Horn wrote: > > On Tue, Jan 28, 2020 at 8:28 AM Amol Grover wrote: > > task_struct.cred and task_struct.real_cred are annotated by __rcu, > > task_struct.cred doesn't actually have RCU semantics though, see > commit d7852fbd0f0423937fa287a598bfde188bb68c22. For task_struct.cred, > it would probably be more correct to remove the __rcu annotation? Yes, but get_task_cred() assumes it has RCU semantics... To be honest I didn't know we have this helper. Can't it race with revert_creds() in do_faccessat() ? Oleg.