Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3363274imc; Wed, 13 Mar 2019 16:17:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQ9xR+20yc7uIqxbSh/NgU8dS1Rsyp8HgLb1Z41gD+cNlRAKhD0j72PLULk4jUGjki1esT X-Received: by 2002:a63:2c50:: with SMTP id s77mr25433185pgs.440.1552519047571; Wed, 13 Mar 2019 16:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552519047; cv=none; d=google.com; s=arc-20160816; b=qlB+utX/lRVFQyjulEBq6faw5LPNXieG7ozIG2cerJ/dKK8SMI7Og6iwZUlCHYnPMt 4ZbvNZodKEuphRvfbXWshcMehFgdhfaYg+s2VNKLTgWLEThyu2fvUP5/AmQrX9OY5B1N +dMg0vtTGeZi+0yhkFyKAPjYnedp+3YNethGT4L6v+2SvsskX0XOLxwUwesAUJF21gzi QqJshWcXbbSiAcsxGrVlF0cKRk8x+O8gwRLLdsf7rMhgGs8f+wWaN9zAXzcrWTUJoJqz RKPbuyuTMEeumgRutQ0M3pZnCYhmqEvo2xz5yU8HywTXTxI85gSL1Lv1JFBm1iDjK5c8 6s0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0edIq/bmCBsDjSwWtLw8ydkY7bGspNWiVPKGuo9duyE=; b=re+8R0Ju55SOwpb72ElYDT3HOctGnmPDmLaAm+bBnHawh1zh3QrFDM76gXhHSHqdMJ UjIhFYBBTwuhx53LtIBDz4al61GMAFhR529SMWbRqdOlSKgadn5XEqSSIuNItYqvPMAx cj+ujHNsxPBYiKv5s70YDKOocJs4GjsWzgJ0hAhksPCaZ+GPSPE+3cQ/OdEO63yoH3hV pf2R/d50H/gYDN6XFodgLQ6CamhOzLpZpfGa5DpuuGaPiUFc7gKC9AG2nHbtug56nOEO RqHwT4U9aQkRJrZgm9MPjrlB3BuioCy69h7dOjKkHC+Cu4yGU67wJBf0ROLtFhjVA3bX DYvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tFeEPlNw; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z192si11031826pgd.500.2019.03.13.16.17.12; Wed, 13 Mar 2019 16:17:27 -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=@kernel.org header.s=default header.b=tFeEPlNw; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727148AbfCMXQW (ORCPT + 99 others); Wed, 13 Mar 2019 19:16:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:48346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbfCMXQW (ORCPT ); Wed, 13 Mar 2019 19:16:22 -0400 Received: from localhost (unknown [104.132.1.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A2FAE20854; Wed, 13 Mar 2019 23:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552518981; bh=pY43j7G6xl0NBncrHcJsAIOfj4V0queHPm7U342mFg0=; h=From:To:Cc:Subject:Date:From; b=tFeEPlNwki6FGi+PzFN73IlP85lqxLoGkcqQC8dWWxjXLJGPtVO1jffZTEz8rCD7o N3cJmF/+zfUgXM23HWlET8mN4oTibSOAiJEWHMuoh8Jpk0jsSmgC5OvDth2EGhkzTR XzubGqDAek4JEqkDhdDkpPvSW6SlseeKc/OA0CNk= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: set pin_file under CAP_SYS_ADMIN Date: Wed, 13 Mar 2019 16:16:19 -0700 Message-Id: <20190313231619.31453-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Android uses pin_file for uncrypt during OTA, and that should be managed by CAP_SYS_ADMIN only. Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 807a97ad2430..012815d816e6 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2873,8 +2873,8 @@ static int f2fs_ioc_set_pin_file(struct file *filp, unsigned long arg) __u32 pin; int ret = 0; - if (!inode_owner_or_capable(inode)) - return -EACCES; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; if (get_user(pin, (__u32 __user *)arg)) return -EFAULT; -- 2.19.0.605.g01d371f741-goog