Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp418864imm; Thu, 28 Jun 2018 23:31:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKTI9mjGzLy9SXZkVFFoS6Ebz3EbaxaPjB30cGaXbGHn6Wcx4DaVGvA/FmPEF99A0OQWYp8 X-Received: by 2002:a17:902:15a8:: with SMTP id m37-v6mr13601652pla.219.1530253878689; Thu, 28 Jun 2018 23:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530253878; cv=none; d=google.com; s=arc-20160816; b=juf/iUtu3Wd6Yl328s7k3bnd6MbJbUWBxoi2HhSzIaDGW2EPPHLkYGynxckz6fNaqo S8jgJFUK6IqfZe+l04ildccFCqLVk2PHL80rLbMMyrfU8Pv0dv6wKjfNk3g5BU6ZzTAj nFLbVQXL4zfiRrfpEFWvy4Yzl+9nsyComE9maLcSCcCoSfqMnL1FMGHXx9zOPIcC9Unm +c39ud+rW6aAWhl93oLgDqR4p4ArW3C+/wfWr1wiZitSV751klISRzr7NDB6B15oxtFI OVjKz30Ytdm/SQzeKJAr8dN10O9CIbVimyDgDuwoVJtVVCx51RgzgIhYWR+sVOQIVOAr b5eA== 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=poJidiszCBRirUJNXfXCf1Ah3zwYRAU9HpEcfUG9lY0=; b=V9DefxgPZ4v1klYfavrX/PIQTnkyIGj6bMYCmoLqn5GgeRieQQK01HVvVyKuNyE0vF MYMjHv81V1ZVx+aLlsSYquTP+zSDRTGbA4RqBcrJATOkAnsE7cnZpI/7SfIyR2CFGTmD SwBHe+N85rvtTgze07KrWe2qJuCtDbGe+uVc3umFM29g6raAzjFnVhUBpQzOXgS93RF8 SR0UYwxXrKJcC4IA8kaIgoOfFttlClInMfuU8D5tg9g7G0nlbu9KhebUP1Eo0CX22yQt rdOzUtG64Uc+x1g6c+UF/ceDKbAVJSFMXvF2f1srzA4HR7h+WO9jrbCDQUij1lElbhrs AXFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=nN+VuIzh; 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 n4-v6si7411044pgd.341.2018.06.28.23.31.04; Thu, 28 Jun 2018 23:31:18 -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=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=nN+VuIzh; 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 S967535AbeF2AXQ (ORCPT + 99 others); Thu, 28 Jun 2018 20:23:16 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:42128 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934116AbeF2AXP (ORCPT ); Thu, 28 Jun 2018 20:23:15 -0400 Received: by mail-lf0-f66.google.com with SMTP id u202-v6so5513041lff.9 for ; Thu, 28 Jun 2018 17:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=poJidiszCBRirUJNXfXCf1Ah3zwYRAU9HpEcfUG9lY0=; b=nN+VuIzh6F5wwQTl08UL16ZeW8aYaTMsMWNf39si+FkIofqBVP03NN1mlBV4V2PgI8 k3oBinKZEarwhPDKWfT9NKOxKZF/0UiFYdCqm/J6l4C3+aTx9/4v9dMYwS7+P4eC/Nnv GueG1KsKGADEZHjx8sZQpMVM3PZk0x66VfQM0VXg3zO8ak4/jlSRUgZP90kzT+FgknGu iG2pc67Nl5UgXM8e+iCDQYutJzl+avMmAK5QYyWTROlP+TNf1RI6bsg+OMMSgjDm/MkV zzdU/PjwbMrIofTfn88ORNNt64OCmIYgW1pCbtR8e5tFJthBfErHokg/OSp23bhDfvJs DRow== 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=poJidiszCBRirUJNXfXCf1Ah3zwYRAU9HpEcfUG9lY0=; b=lOOHiBMFGctIw7Ny3rUhxw9Z76fI5SjCiwuHGz/DDEiC37ZI2q8DbyDe28eb/zYRRJ IjvqT7p/S7iu01Ygk6wzAgRbCC8kegR6saQ+Y9bKmB5SVFRU4ebEBvimpmmMGpeLPKB2 GcHmyQsxTQnTqN/Ik0wslXcRB253Oum4CQlB8hV0lYmRFlRpl8s9pdW6KUyd2BUFzbu8 DyxafloiphrJrT4v16S5HpQnssUKRbqnFN6U/XV17URhEu1cHPqRc+k6QTrNgH0nq9HO 9XlNCXPk2NRZlXaKZ7W2Ms79cFWBLXENZaKg4L5BF6rYFZiEmFBFbastWQrQ8BS81FuO LQAQ== X-Gm-Message-State: APt69E3YFnYwtohBiz9zcqUsQGPJoldGKOzoMWljh4w6lkqTGGMCRkWA GeZgoSTqvpnGOVK7GqQqDnHYuYcWewof1bnAavVx X-Received: by 2002:a19:a892:: with SMTP id r140-v6mr8053105lfe.39.1530231793937; Thu, 28 Jun 2018 17:23:13 -0700 (PDT) MIME-Version: 1.0 References: <20180625163425.216965-1-jannh@google.com> <9d5d0cb7-5875-0814-835b-097db650b6a1@tycho.nsa.gov> In-Reply-To: <9d5d0cb7-5875-0814-835b-097db650b6a1@tycho.nsa.gov> From: Paul Moore Date: Thu, 28 Jun 2018 20:23:02 -0400 Message-ID: Subject: Re: [PATCH] selinux: move user accesses in selinuxfs out of locked regions To: Stephen Smalley , jannh@google.com Cc: Eric Paris , selinux@tycho.nsa.gov, security@kernel.org, linux-kernel@vger.kernel.org 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 On Tue, Jun 26, 2018 at 8:15 AM Stephen Smalley wrote: > On 06/25/2018 12:34 PM, Jann Horn wrote: > > If a user is accessing a file in selinuxfs with a pointer to a userspace > > buffer that is backed by e.g. a userfaultfd, the userspace access can > > stall indefinitely, which can block fsi->mutex if it is held. > > > > For sel_read_policy(), remove the locking, since this method doesn't seem > > to access anything that requires locking. > > > > For sel_read_bool(), move the user access below the locked region. > > > > For sel_write_bool() and sel_commit_bools_write(), move the user access > > up above the locked region. > > > > Cc: stable@vger.kernel.org > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > > Signed-off-by: Jann Horn > > Only question I have is wrt the Fixes line, i.e. was this an issue until userfaultfd was introduced, and if not, > do we need it to be back-ported any further than the commit which introduced it. Considering we are talking about v2.6.12 I have to wonder if anyone is bothering with backports for kernels that old. Even the RHEL-5.x based systems are at least on v2.6.18. Regardless, I think this is fine to merge as-is; thanks everyone. > Otherwise, you can add my > Acked-by: Stephen Smalley -- paul moore www.paul-moore.com