Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2715321ybi; Sat, 13 Jul 2019 22:04:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxl4m+N1zdOi7MUkf5gkW3aDoOImFCQNnQWY2OcNNNXBFLHRdOW2DjpHqZ9QWMWL8q6zBJV X-Received: by 2002:a65:6497:: with SMTP id e23mr19272817pgv.89.1563080645780; Sat, 13 Jul 2019 22:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563080645; cv=none; d=google.com; s=arc-20160816; b=KjxeKE2kieIz3CNLOfDWRCH/2he+pTy03KeaQ6nXrHD2sJumm9kYfnWnyMG6/pDGTJ uSSjNWPpc8Dk+WlzHaBwKww7rklD4lyfLFZwOTmNsPAYtz4OcOZcaLBCMIldnsQsFyTv KV/sF+OPjACZ9AZkBI0LzFN8XjmdPcoY5K3iKrom9AwgDwqSaDFP1bisGc1p7AaU/9Qr dKbSYvUuykQr4h3qxLrYkWbrxVjHwFihKiT36OpngqHPF4DcE3KY8Essv/6hBtykhYvx z8LxsASIjC9cR3fxL4KlJJRKraMHG7/leFAw9AcdIz+BhnUaJ3pciquqe5Q4JEz+j3L/ A22A== 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=S+CLR//OyzM+aYJU6s+9PqtlXqSsNWfyLe2vWBf5AFs=; b=U1ZeX0MTV+8Eo6Lp5hqWBqOa/3rNvk94xQzbuxUwFX/1UW7qjoAiurEw6IwuCfxMDY CPUAI1v8ZAd5nSBXvvAOpmrPnWbLOe47RK2ar2yBGFOLDLaSFkXOvdd/UgSoKhpPaSLy zhiKhZRcXM09bkJGgxDQXzPbeFpnnb2lspigaQC7kEP0fklAma9R3egMm/okZ4to1DTo 9B2hL4NrQ3EHkjHnUYUflk0eHRadgmxPpgK0+b/jv397Gz2fg2zubWDU0vtBD9VHJTzD 2M2rHT9y3KxGfFFZ5uRTCH/8oMNu3CmWoYXno7O0QLTTOZHM/nmaxMFZI1Xf+bgSbAVj s9tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MjE58dCr; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si12905068pfe.269.2019.07.13.22.03.23; Sat, 13 Jul 2019 22:04:05 -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=@linux-foundation.org header.s=google header.b=MjE58dCr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725958AbfGNFCh (ORCPT + 99 others); Sun, 14 Jul 2019 01:02:37 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:46866 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725379AbfGNFCh (ORCPT ); Sun, 14 Jul 2019 01:02:37 -0400 Received: by mail-lj1-f194.google.com with SMTP id v24so12977588ljg.13 for ; Sat, 13 Jul 2019 22:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S+CLR//OyzM+aYJU6s+9PqtlXqSsNWfyLe2vWBf5AFs=; b=MjE58dCrdguAUpOtUkl/U/NSXmQDiCHjFHuxcdtbD7ta0zup4jZpz0IAQVBfVA6kpf V+VT+h7mQ+tMcmzLdabkCFPuen8WrxlT9Qeah1NFYVatiCTv/bARuUlzJzO+jUIuIRZu nRut479R733DMsKhXl7DDGc8bgL1cXkE2SOB4= 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=S+CLR//OyzM+aYJU6s+9PqtlXqSsNWfyLe2vWBf5AFs=; b=uBIHEWHSB/GigR/8kkqOY/BacNpUDE99pQiWQMl1mxqCANWOHrFOW3xtTLwIrrN3h/ sZTeJ0c/U/LBb22v+7gH9QJruagveczmwHRO27u1g8ZDww6dnvnqPsoBnW5/qPXfDCA4 s4cj6FNN9Br+7R5V4Qwil5UtkVbrECfd/vRVhpdOvgQT4s/yaSpIOE1e0sTd4+8Yb3xI Wp9p7/K+jc9RzCCyNydRYEaL/dUcG64NdO+whCR2+M8W4quwL/iaZnQzVqpnkdMxPGIs bjA1e5BfF43jI7A6Qz7OX2KqU2iT9nz5fRslp4hlnWqrPu1Nem4sz/IpIjLJv2VQ3Mgq YKkw== X-Gm-Message-State: APjAAAXy3tq/1m1H76cONa4ol/aLONFD/MmRVBKN2Bny6crhGrIbBnoS LTclz/+i5c1zNsqcerbyeNL5AsyV9FI= X-Received: by 2002:a2e:85d7:: with SMTP id h23mr10435467ljj.53.1563080554094; Sat, 13 Jul 2019 22:02:34 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id t63sm2326008lje.65.2019.07.13.22.02.32 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jul 2019 22:02:32 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id d24so12966415ljg.8 for ; Sat, 13 Jul 2019 22:02:32 -0700 (PDT) X-Received: by 2002:a2e:9b83:: with SMTP id z3mr9894882lji.84.1563080551761; Sat, 13 Jul 2019 22:02:31 -0700 (PDT) MIME-Version: 1.0 References: <20190713072855.GB23167@avx2> <20190713073209.GC23167@avx2> <87sgr9gsiq.fsf@xmission.com> In-Reply-To: <87sgr9gsiq.fsf@xmission.com> From: Linus Torvalds Date: Sat, 13 Jul 2019 22:02:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] proc: revert /proc/*/cmdline rewrite To: "Eric W. Biederman" Cc: Alexey Dobriyan , Andrew Morton , Alexey Izbyshev , Oleg Nesterov , Michal Kubecek , shasta@toxcorp.com, Linux List Kernel Mailing , Security Officers Content-Type: multipart/mixed; boundary="0000000000000b394a058d9d0db5" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000000b394a058d9d0db5 Content-Type: text/plain; charset="UTF-8" [ Apparently this thread wasn't on the lists, and I didn't even notice. So re-sending the patches ] On Sat, Jul 13, 2019 at 9:16 PM Eric W. Biederman wrote: > Given that this fixes a regression and a bug. > > Acked-by: "Eric W. Biederman" I'd much rather start from scratch. Like the attached. Alexey Izbyshev has a third patch that then limits the setproctitle() case to only allow looking into the env[] area, which looks reasonable. Linus --0000000000000b394a058d9d0db5 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-proc-pid-cmdline-remove-all-the-special-cases.patch" Content-Disposition: attachment; filename="0001-proc-pid-cmdline-remove-all-the-special-cases.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jy2hrimq0 RnJvbSA1NTYzYTJmYjM5ZmUwYWQ0MmYyMzlkMmY1ODMxMjhkNTAxNTUwMDJiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW51cyBUb3J2YWxkcyA8dG9ydmFsZHNAbGludXgtZm91bmRh dGlvbi5vcmc+CkRhdGU6IFNhdCwgMTMgSnVsIDIwMTkgMTM6NDA6MTMgLTA3MDAKU3ViamVjdDog W1BBVENIIDEvMl0gL3Byb2MvPHBpZD4vY21kbGluZTogcmVtb3ZlIGFsbCB0aGUgc3BlY2l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z ZXQrZ290LW4pOwotCQkJaWYgKGdvdCA8IG9mZnNldCkKLQkJCQlicmVhazsKLQkJCWdvdCAtPSBv ZmZzZXQ7Ci0KLQkJCS8qIEluY2x1ZGUgdGhlIE5VTCBpZiBpdCBleGlzdGVkICovCi0JCQlpZiAo Z290IDwgc2l6ZSkKLQkJCQlnb3QrKzsKLQkJfQotCi0JCWdvdCAtPSBjb3B5X3RvX3VzZXIoYnVm LCBwYWdlK29mZnNldCwgZ290KTsKKwkJZ290IC09IGNvcHlfdG9fdXNlcihidWYsIHBhZ2UsIGdv dCk7CiAJCWlmICh1bmxpa2VseSghZ290KSkgewogCQkJaWYgKCFsZW4pCiAJCQkJbGVuID0gLUVG QVVMVDsKLS0gCjIuMjIuMC4xOTMuZzA4MzkzNWY5YTIKCg== --0000000000000b394a058d9d0db5 Content-Type: text/x-patch; charset="US-ASCII"; name="0002-proc-pid-cmdline-add-back-the-setproctitle-special-c.patch" Content-Disposition: attachment; filename="0002-proc-pid-cmdline-add-back-the-setproctitle-special-c.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jy2hrlpn1 RnJvbSA2M2RkMTQ5OTljNmIyMTBmYmUzM2Y3ODBmZWM1M2ZhZWZhODY3ZDk1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW51cyBUb3J2YWxkcyA8dG9ydmFsZHNAbGludXgtZm91bmRh dGlvbi5vcmc+CkRhdGU6IFNhdCwgMTMgSnVsIDIwMTkgMTQ6Mjc6MTQgLTA3MDAKU3ViamVjdDog W1BBVENIIDIvMl0gL3Byb2MvPHBpZD4vY21kbGluZTogYWRkIGJhY2sgdGhlIHNldHByb2N0aXRs ZSgpIHNwZWNpYWwKIGNhc2UKClRoaXMgbWFrZXMgdGhlIHNldHByb2N0aXRsZSgpIHNwZWNpYWwg Y2FzZSB2ZXJ5IGV4cGxpY2l0IGluZGVlZCwgYW5kCmhhbmRsZXMgaXQgd2l0aCBhIHNlcGFyYX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