Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4120462imm; Tue, 25 Sep 2018 11:40:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV60m6+b+JSJQZfoSSyCHyJuyt7xXTywriaImddXbWQBtoqOTkHc2423CmlniKajpoQe++yeC X-Received: by 2002:a17:902:6689:: with SMTP id e9-v6mr2378407plk.115.1537900856551; Tue, 25 Sep 2018 11:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537900856; cv=none; d=google.com; s=arc-20160816; b=t5sySLvwh9Lbj3CAMpqZ6g8lU30tVsOeOEEWH7Xt2uCe6m6yTDQrnkd6CZIEW5tDdS aF0OEHXMdDCCjC9PEp5Ml8lr4TaFX0itTVG9/PGNmqxelZMGqp3WJUr0SSQ/YJQAyQJC AmifomYIQAItxxmxJrFOHaQCUF/KcozdCn2sVTgg8fKAqEYO01KIpFnL/rNX5dSA+mQJ 0PEpVvZruyGb4lPlFgYlocs7aJeEQELp8kR0uWyZdmCoOPX0xRSFVkY271AFnaqhcnsH Gqk8tmrwC29lD6pwg6oYoFBhmffd0MOtc5ujoeJ3htxrjxthPpk2TkQXzgi2i7UZBK87 f8zg== 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=9gjsbWy8viaUdrt5D75hpJqxS2wAmj/8yUFyJb6Z28M=; b=B3J4P3hsNpjMu6Pzl468ZJRBcecA9qKUtIVbSq8WrljREs8CwsL7HoSd1NAEgEv6nT Zkbu0x9HayzUjmqSrHS8Wva3Eegx9U7QSGjqspotXdzOiAEL73SkUNhh8BawpPPId7ok yQkx8IfaqTiLHj3ORAYE9+9YYAFvnEHTYfbNDBDefojwzVduxrvx9vFeJnXL41yoEzLV L/dA+72qEtXsC0itEJoBYFhL6fT5ABd8Xhnx/ErgMwaoJMIS0apj237zDUqZ02jWdmUN 2YSUvEQL0DAna7xPfBVsfbMTrP15o1rFHuQtOJe3fg1S1vyWQvSNCfaCVMdNOAQufnA1 uPfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gCEA7QoF; 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 72-v6si2876337pfq.6.2018.09.25.11.40.41; Tue, 25 Sep 2018 11:40:56 -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=gCEA7QoF; 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 S1727433AbeIZAsr (ORCPT + 99 others); Tue, 25 Sep 2018 20:48:47 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:32874 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbeIZAsr (ORCPT ); Tue, 25 Sep 2018 20:48:47 -0400 Received: by mail-lj1-f194.google.com with SMTP id l19-v6so8259368ljb.0; Tue, 25 Sep 2018 11:39:55 -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=9gjsbWy8viaUdrt5D75hpJqxS2wAmj/8yUFyJb6Z28M=; b=gCEA7QoFKwN1P4RF471/n42XJ2OmoIIRtiJ8eWp9IP7c0yD7L90WdVI2S4Rz69EHs6 bYvvxL1HH0ItBVJfkJaRCLyVrdGHQG8wwwjNelBifeabZXcw1WSIxD4jr0t9y5s9/QPn fQXCbUSdD3C1fhhl+VoYtKS6w5oPWorcbI9ULN8BWDjO0J0bkkMMqziLvwBmpKEsFfFu mT1ev/pWYUyVWv+f5bp7VhbQnmYqe2kk2PuuKeVHVczvp36FucK4VrrcZ6qt5km6c3hb pCczCrM6seWYiIYIq/tx1lYK5pxecihPN3O3AEGDk5XF3JPMlUhlQIXsSM+wye4EGqRF qdyA== 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=9gjsbWy8viaUdrt5D75hpJqxS2wAmj/8yUFyJb6Z28M=; b=N1Ki0uBAKUEq6Vvi7PiEQAk67ujkuFR6IK+QpRMHIibo/P/JtPbUkZCFgm3H4CH0R5 3q9WBV7P30O/sjANO4zwicTZwRxUq47SlZvWtywEZFMUGXUQ7hVaaSIa4IPg/7dGKPrP LYu+722vkR0iHNRMhR9fOnLTOe5/L1m/BQh0GEGkV8k7bITAAZ0CRkCmOGa2EaWnrYeG 68HIVcBLk20pQ6hjnBS9aDuJbxhE2b5IiNYgjXsalwX6iV3KHop33Nhutmwqh8moF1RM MWkZuAMllczCV6t/12k9FW1Y20usF/aSV+I/a680Xjzqg5Ia/7X2vTz0ePfiqOvP2S+i NYvw== X-Gm-Message-State: ABuFfogZwnpnCCDiYXubXUQvgM8oefG7ud2htLc+v0GhiuM6Eg8LIeWg e2ol6lKLPJ9l8ISHdTYaBLqkgQtwr90= X-Received: by 2002:a2e:3e0d:: with SMTP id l13-v6mr1781943lja.151.1537900794813; Tue, 25 Sep 2018 11:39:54 -0700 (PDT) Received: from uranus.localdomain ([5.18.102.224]) by smtp.gmail.com with ESMTPSA id 3-v6sm539524ljs.69.2018.09.25.11.39.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Sep 2018 11:39:53 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id 8E6A746067E; Tue, 25 Sep 2018 21:39:53 +0300 (MSK) Date: Tue, 25 Sep 2018 21:39:53 +0300 From: Cyrill Gorcunov To: Tong Zhang Cc: adobriyan@gmail.com, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, wenbo.s@samsung.com Subject: Re: Leaking path for set_task_comm Message-ID: <20180925183953.GI15710@uranus> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 25, 2018 at 01:27:08PM -0400, Tong Zhang wrote: > Kernel Version: 4.18.5 > > Problem Description: > > When using prctl(PR_SET_NAME) to set the thread name, it is checked by security_task_prctl. > > We discovered a leaking path that can also use method implemented in > fs/proc/base.c:1526 comm_write(), to do similar thing without asking LSM’s decision. I don't understand how it is a problem. Could you please explain? procfs/comm is created with S_IRUGO|S_IWUSR permissions. So prctl and procfs are simply different interfaces.