Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp361395ybl; Tue, 28 Jan 2020 04:40:17 -0800 (PST) X-Google-Smtp-Source: APXvYqz9pQ3LycYIS7utOGx97ADvjfbGBu+FO8DC4ImEHEWZdfu4XpcRxvutFC+TZu4+U/xY9Ezz X-Received: by 2002:a9d:1706:: with SMTP id i6mr7046576ota.151.1580215216912; Tue, 28 Jan 2020 04:40:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580215216; cv=none; d=google.com; s=arc-20160816; b=IcvmRdbOIxtCoo3GxmM3SlS3iWVkSrezl8rrxWpgWYge//XSj/Fl5IXLON1+dmSKKK pCfcomRKqOKSCTuD4YMm6PqvGbB+Vwy7qEVsm0LfzHsXM0jgGctYQ27zCrbpg1vuLo+D etOiNlatUMznyA+P6AHGGhM1cCEwi/OVKv0LRLDC1m9dmCBQTFwf5cHhVWB0JzpwIC55 JcUHVcPDAzB7GKkEFyd9exsqWfVYC5YSYe1P4aO0dFofIWaP3j6JRmxYTWKKmT3RdMTi IT/K6bNlaq/oBL2GQGMFKZnI4OinlbyMzVGznyBBXMfRcfmKCVY6T5m6G99K8Wv1aqFA wZuQ== 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=jAUdcUoNlbNA3wmapQDhv1Xevu4+dUMP19fy7F3OARs=; b=Ap0fc7N5aSgpA6ACc51eS2BNGoUWRCHP8TtILSF90ImpQ6IWizHL50OkbxnVVzsIVu 3ZqMzrShxh0iqXScqCl7M5vXlKKZEOzLWci1z0avl8D14Wd3pUqiDYZHziEQ2izMpQIl hxL84KKqSzC6dUejCBZIV+i4wO4GKCxbBItpGzPErF+NETIjZm9tHMTou7RITIfRlaxi wFj3x0xX33sKUVmiyTAx2HKwDQC0VkSO6Aa34r5UmEgz7PsZHT8lpQPRvFynX/zcVqZu rqvBBRRpn4bU19Hc38c/vpk92xApj/yobGPFVRAU7SMJk4nRTBAVzvTTYnPzccO7Z+pp Lccg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K62JkGjH; 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 d19si4352395ote.3.2020.01.28.04.40.04; Tue, 28 Jan 2020 04:40:16 -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=K62JkGjH; 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 S1726024AbgA1Miq (ORCPT + 99 others); Tue, 28 Jan 2020 07:38:46 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42082 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725283AbgA1Miq (ORCPT ); Tue, 28 Jan 2020 07:38:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580215125; 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=jAUdcUoNlbNA3wmapQDhv1Xevu4+dUMP19fy7F3OARs=; b=K62JkGjHw2opSm71KNW93l2CKHflbv5kSV6NkSdYGQGB8md+cZT4jXle5eHX2DS/RcTxbk rdU+O/zD5aiL7QOPWnBxW1DvHujDP734+TwZmlJTUc6Ws+mBl/IIzrkkOaqAtxUQIfbiH9 AzFZxJ8jGXTItgHWI9J4QKWMPbklIEA= 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-185-GuLWnJoVMYevW03hQENvBQ-1; Tue, 28 Jan 2020 07:38:41 -0500 X-MC-Unique: GuLWnJoVMYevW03hQENvBQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 843518010C9; Tue, 28 Jan 2020 12:38:39 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.70]) by smtp.corp.redhat.com (Postfix) with SMTP id 0BD1D89D13; Tue, 28 Jan 2020 12:38:36 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 28 Jan 2020 13:38:38 +0100 (CET) Date: Tue, 28 Jan 2020 13:38:35 +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" , Casey Schaufler Subject: Re: [PATCH] cred: Use RCU primitives to access RCU pointers Message-ID: <20200128123834.GB17943@redhat.com> References: <20200128072740.21272-1-frextrite@gmail.com> <20200128114818.GA17943@redhat.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.13 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 12:48 PM Oleg Nesterov wrote: > > 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... > > Oh, huh. AFAICS get_task_cred() makes no sense semantically, and I > think it ought to be deleted. Ah, sorry for noise Jann. Somehow I managed to missread this function as if it uses task->cred. No, it reads ->real_cred so it is fine. Oleg.