Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4249864imm; Mon, 30 Jul 2018 11:06:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeY5Q3AcUB2pwCxpiH2WMRXpZQLnoMlaEvcrm5qqKzVaN2+kOm7ZfdpGvO07n/FuDmcerNc X-Received: by 2002:a17:902:a5:: with SMTP id a34-v6mr17658538pla.60.1532974018467; Mon, 30 Jul 2018 11:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532974018; cv=none; d=google.com; s=arc-20160816; b=bEEdBBvxNc8tI6qu71igEV200lQ23Bhhsz/WLtMQLhfEdkFs/mKA1nMFCUP3Ns3zig XTlxz6N+Z4JOj/HYMvFq+nlkaSp0SwKX/AzvHBVFUbJJ4iRVSMIne4BLI32Iqbt8T4d/ X7j5hhp0wLPmNHOaGMTrXn9g6CEGcsURhwQP4d+2IVo3Ht96Ui65w8/jymGDURWkSS2p wwHdiEKZrtppltExd47yaAQoTyg8/7Gw7tZd7kxij9PghvEpjhNsx4iF+NzC4r2GOTSX RiDzz4o4MLYtvXySKVNy2+1b0o7WW5C71RfIr96Ei0htO7hXYRt241iCleAKkO/W50Be 7nkg== 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 :arc-authentication-results; bh=iA49bsGEYWaVednDy8fMlMTrm9jlxQiKn4iQ+EJVW/k=; b=qv3E7J9k+KXrhYGjNycJGpEiklkW/wxTK516wvA4Zm2TKZpGKBZJfFrd+/qdTdpdqD E4FW5zk3L1sqgnvmYfzXuw+zGVaLQ8G0DnrV+NPeNrqFJjAwI/yibs5ywirGpHGy+Mpy ElWIDxJGyw3DIQS+hXKigmitqWSh4nTcTW4iE9VXjAF/jIp7DdxaH3BwqndYfx9Gq/a2 63P/I0TG1M2tc/aB3UuVVkjXjThVw+fsFs29y27Pe3PEG2WGCehwThDlDmNcFvOhdS0b /ZlqubmTy2eVaWyHEXKGTnlq3lMPBTgBk4uwVtX3I8e7Br+J09ZnwhnKIMumNy3LeIcY vFNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=d20+q73u; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u123-v6si11574235pgb.414.2018.07.30.11.06.20; Mon, 30 Jul 2018 11:06:58 -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=@google.com header.s=20161025 header.b=d20+q73u; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731930AbeG3Tir (ORCPT + 99 others); Mon, 30 Jul 2018 15:38:47 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:55724 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728801AbeG3Tir (ORCPT ); Mon, 30 Jul 2018 15:38:47 -0400 Received: by mail-wm0-f66.google.com with SMTP id f21-v6so299330wmc.5 for ; Mon, 30 Jul 2018 11:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iA49bsGEYWaVednDy8fMlMTrm9jlxQiKn4iQ+EJVW/k=; b=d20+q73uJgdCy2I6HOSHfVR2WTE8BShmJKHdkE/5feu4Us2PaIYGqZYdhkjQFR4Wpe /S8WLbPhbYbD6CBzp/Qj2LiTBQsfLWKQcCL7LN5Toxuf2yN6qrUthmuw+3p1LPX7oxId Keb95Z89tDOD/SPsZSsZE5Jh94dhPux9S+rgEOCJPFwAA/VTQlpSYQh5VDI2wLx4qxV6 gtp9Bj3828ccfJ6XoDzQbKMq7p3/CcjhUH4Ci5Zavu0JZHploGmVIsDR3J8KIbNFSF/m 0lhKJ1e+8LDF2iRe9TXkI9IMzoAlNsfg8pTp47Rl95vbO9vxwW79TSDpes1qvF07O9I8 X2XA== 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=iA49bsGEYWaVednDy8fMlMTrm9jlxQiKn4iQ+EJVW/k=; b=IHWTu8pxsnQcesytjH0pnp39Ke72vvP/1xw3bzTlM2QDuMRg5qBQmuNMUNtDCDOWDm ctbzIGzrdG9pHMFI06hk3XG44QzU85/KTiRJw+Nkr4QkzlKZVX+/BayX8uNQqIpZ5Fma RsItzW4+vMYJG2o0zXJLv/wtCfXEbVbzNIwQvbBATcw7qQZowV29qOwjMA+R8JxGLuix xOfrkl6mClPTnv73IjI/+4KoTIamEaIEY4MMVRTwuPaa2vVQh5hwxTJO+eGrE38PWF5U LoKaCIEKh+OQYuZDrI/RTGY96XdhofNJzszxTxYL1myjD0Unler9C6LrtJMYB00UAIbd T/+g== X-Gm-Message-State: AOUpUlH9zPwG48nY6ScAdQupMG7epbDRq0WKRQMZ3EVnOtO9XTazwvF9 /koedI9DVc1H+oDrbbTzY8DNCpzrTJIOBLn8maHIGQ== X-Received: by 2002:a1c:8b81:: with SMTP id n123-v6mr211526wmd.142.1532973756539; Mon, 30 Jul 2018 11:02:36 -0700 (PDT) MIME-Version: 1.0 References: <20180729193646.201721-1-toddpoynor@gmail.com> <20180729193646.201721-5-toddpoynor@gmail.com> In-Reply-To: From: Todd Poynor Date: Mon, 30 Jul 2018 11:02:24 -0700 Message-ID: Subject: Re: [PATCH 04/13] staging: gasket: core: allow root access based on user namespace To: Dmitry Torokhov Cc: "toddpoynor@gmail.com" , Rob Springer , John Joseph , benchan@chromium.org, Greg KH , devel@driverdev.osuosl.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, On Mon, Jul 30, 2018 at 10:57 AM Dmitry Torokhov wrote: > > Hi Todd, > > On Sun, Jul 29, 2018 at 12:37 PM Todd Poynor wrote: > > @@ -1064,7 +1067,8 @@ static int gasket_open(struct inode *inode, struct file *filp) > > char task_name[TASK_COMM_LEN]; > > struct gasket_cdev_info *dev_info = > > container_of(inode->i_cdev, struct gasket_cdev_info, cdev); > > - int is_root = capable(CAP_SYS_ADMIN); > > + struct pid_namespace *pid_ns = task_active_pid_ns(current); > > + int is_root = ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN); > > ns_capable() returns bool, why did you make is_root an integer? Gaah, I forgot to change the type of the existing var. Will fix, thanks -- Todd > > Thanks, > Dmitry