Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4911909yba; Tue, 30 Apr 2019 06:25:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyz/8QdDBkozxqMwWaZw3mHOnlsGB3V2HuYOrA0oIKL++tYvY+2z3GZXhc+oJKCUmOfwnNZ X-Received: by 2002:a62:528b:: with SMTP id g133mr25232904pfb.246.1556630715678; Tue, 30 Apr 2019 06:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556630715; cv=none; d=google.com; s=arc-20160816; b=UvYgkqlREQCjHV77CHXbmtePahNuAN+vJ+i1oChqr2FkyOZW58iSe6SshvSP6DSuC/ S/y0/OlutzP5FQjPqVetOdDB+ghyTyKPUsCFin7FSfq9F/lDezaxnRpbYUdUmYKLdwMT CwD2AdejzHZGq+BmKT5v5quDSArzsFxBbWr61/1gxdA9X4mPdxfZrZcFU2HLQpAFIKBT n7Z51bTBsuQHE3wa5cECr1fw4qR6n13skYEvhmUCOeze8AKVJb6/IKbXgXCgfewiiVqX NGINzci+50zafQiyQY6lQ0UWNVF9xet9usxDjkOpwojpu502yKWMXyWUm/lcpYvfKwrG vivw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qnpMUYkMmL9pa1NwW2JEoP1ItjcZEv+YmAjkVOUYqyQ=; b=s/08NFTjvnt5tegR2TRbQgyuSBm5hy40ZBm65BgM3+g2UhrKdUaH/edvUtzZ0D4R9d rc9SlmuCx64oW55g+ysje/nM3F8nuIR3hEfBZBTNZCllXl5+moYmVEd2XFEtiZqQzQ/I YjJJJztkwY5VWLDmESfSRrbH9fdSdfEpFeALNY4QLIZjw9Hp1lgsSsANWJfim8MdFDM7 vbdB/MPUm5yj/yYqYuTh25c7DTvBP5+ZzRtPy2N8qk31frUqtej88QVBxxxl2DzWWxep cfM0o4xcjPXaVBusuNQXzbrBoRAYU5OWasQFYFW9+s/p0nxbk7adAmttLCF2d2S1xtuD ei6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PxutZQVn; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cm8si8281011plb.159.2019.04.30.06.24.59; Tue, 30 Apr 2019 06:25:15 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=PxutZQVn; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726679AbfD3NYI (ORCPT + 99 others); Tue, 30 Apr 2019 09:24:08 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34804 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbfD3NYH (ORCPT ); Tue, 30 Apr 2019 09:24:07 -0400 Received: by mail-lf1-f68.google.com with SMTP id 3so226279lfr.1 for ; Tue, 30 Apr 2019 06:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=qnpMUYkMmL9pa1NwW2JEoP1ItjcZEv+YmAjkVOUYqyQ=; b=PxutZQVnmGiTrO83tBry4NYVOaB4lJN09Oxip41bc355LYSr1LYeo1lMf41kY1dbPT Az2YTmBmBe5x538dT+JRe1+JYJCz1FoZpsDQi9caft0FfB24tBWxwTJv5idXE3tCj309 ndFGbbBo2539UPe3H3O748UbjUEB5fXovu/9xWmEfhXYjNsDa8MGUA7FNgzTEwcV2NYx BzUCxvrUpvXfcEOn53rFrUqaBy+pwlNLr7oHR8TPl+xrEZ1Otp/fmWcn5hIPL8+9gurK qq05lb0/OOuJZi6nG1tjGqZ27/O0Si7Z+rZrnHkVNiZ1eEaLz2uJksbogv7Sccdikqvu +sog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=qnpMUYkMmL9pa1NwW2JEoP1ItjcZEv+YmAjkVOUYqyQ=; b=pzJiAuxAkNC9GyWmiTtIN8PV0HNmLU+C3W6ASp0HOGb3AKLyGzM/ELNOq6nbTe7Pjl 3RMYhZJcbnNeYo0YEL2pXg3pbUiDsT6K0RZtLB/BmF67YLUK945bQj0SgD1YxT2lxKrH YV73lBQgZ8XWdIA24YQFO5185EOgN5epwKQMlpd64x5AoEvQYLpPUHhSM3NCYbmgySC0 91RRBUUIaRBOJ+HkbHkjCKrKsD7kGPtUn0tQVpL5MBGKh+8Opbkxw/spApihWFJu9ME9 4IDGVdGYioNJ/BaBAxhuueYcYHPRnQ7p8ujpE8wXpJfaikP+kTFwRQLkYB2E5s6133JT jbkg== X-Gm-Message-State: APjAAAVjlkk0vcZiUbS3mmDJQrd5+aMZBw1aG1mfvf/2I130TvYWoexB fy7azHJj5GgByNcKk5zy1TQ= X-Received: by 2002:a19:5507:: with SMTP id n7mr15109749lfe.140.1556630645642; Tue, 30 Apr 2019 06:24:05 -0700 (PDT) Received: from uranus.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id s24sm7499626ljs.30.2019.04.30.06.24.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Apr 2019 06:24:04 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id 7333A46019C; Tue, 30 Apr 2019 16:24:03 +0300 (MSK) Date: Tue, 30 Apr 2019 16:24:03 +0300 From: Cyrill Gorcunov To: Michal =?iso-8859-1?Q?Koutn=FD?= Cc: Kirill Tkhai , brgl@bgdev.pl, arunks@codeaurora.org, geert+renesas@glider.be, mhocko@kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, ldufour@linux.ibm.com, rppt@linux.ibm.com, mguzik@redhat.com, mkoutny@suse.cz, vbabka@suse.cz, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] mm: get_cmdline use arg_lock instead of mmap_sem Message-ID: <20190430132403.GG2673@uranus.lan> References: <20190418182321.GJ3040@uranus.lan> <20190430081844.22597-1-mkoutny@suse.com> <20190430081844.22597-2-mkoutny@suse.com> <4c79fb09-c310-4426-68f7-8b268100359a@virtuozzo.com> <20190430093808.GD2673@uranus.lan> <1a7265fa-610b-1f2a-e55f-b3a307a39bf2@virtuozzo.com> <20190430104517.GF2673@uranus.lan> <20190430105609.GA23779@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190430105609.GA23779@blackbody.suse.cz> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 30, 2019 at 12:56:10PM +0200, Michal Koutn? wrote: > On Tue, Apr 30, 2019 at 01:45:17PM +0300, Cyrill Gorcunov wrote: > > It setups these parameters unconditionally. I need to revisit > > this moment. Technically (if only I'm not missing something > > obvious) we might have a race here with prctl setting up new > > params, but this should be harmless since most of them (except > > stack setup) are purely informative data. > > FTR, when I reviewed that usage, I noticed it was missing the > synchronization. My understanding was that the mm_struct isn't yet > shared at this moment. I can see some of the operations take place after > flush_old_exec (where current->mm = mm_struct), so potentially it is > shared since then. OTOH, I guess there aren't concurrent parties that > could access the field at this stage of exec. Just revisited this code -- we're either executing prctl, either execve. Since both operates with current task we're safe.