Received: by 10.223.185.116 with SMTP id b49csp4838661wrg; Tue, 27 Feb 2018 03:35:28 -0800 (PST) X-Google-Smtp-Source: AG47ELspsbXxqEdo1zghKaZDcI6Q7uQaDhp8kBa5Q0ogfpgeU2DcE+kQCWX6R1JatGCYCzJtapWv X-Received: by 2002:a17:902:3341:: with SMTP id a59-v6mr9083683plc.20.1519731328132; Tue, 27 Feb 2018 03:35:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519731328; cv=none; d=google.com; s=arc-20160816; b=SSP0gSxTsZUzDfXGAxI6OpcbYdG0af15oKa7ZNymEqGBRp9rFNwkamBzlrY8u9ta4+ 5UYWwQXhOs9eqiPkQrkqw0Qc7a8HLtux29MlGZiq4t0IVbGQkJzptzsgMuzyDU73Lthv EW2NWkY322xJrxYpR6agja1Zh/lTRu2YkCBvXjlcTRTAt3KRbZza8LnMkf+dfTe0LVTb HrvZ06FW/8QBzLjD4M3mfBoBqwzVNLfo2Mq/YpzPDp2MG+fMHKBI77NLxrpUR81oPgsA yNXD/DLtR4MMsWajyKczvIqZ9OV5oSbxNRfFxsGi0oI1H2gViu/6JdauQS/CNt+3WbkD YjsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=XsJZ1ubZt0EF1FQWi+rz0qlc9Kt63sambjpDOj464Gc=; b=vFRjOCMMe4fK/GUhZllGrXj6jU6T5lDv3a2eQ3WH61lPtoEsGd19r7VyRAjjlV+X2+ cVCGNw5tzDDTTXrgUIq6X63rXEyY837L23ATMFcumhmyvBElFNOlumdbfWrUHCOsanac 4E0XDL/FHqyMcGGAhAQkvCIP+qVWCvATB5FFvTrYi5kghObULufM1XkCwe97JclFWpNn erkLUBik8liNlAv6xunoDmgxwWMiMXyT9LeoywUnoj4cgxR5pTVe6G8EB52JnPbxtSHJ wHv3EVNFWnToWvZa8y/wQGrqK0pxIDHKmLCHRPIpdPyF3XjNGcqKLb4mjyA8onVBQl0O aF+A== ARC-Authentication-Results: i=1; mx.google.com; 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 t12-v6si8427397plm.392.2018.02.27.03.35.13; Tue, 27 Feb 2018 03:35:28 -0800 (PST) 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; 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 S1752762AbeB0Ld5 (ORCPT + 99 others); Tue, 27 Feb 2018 06:33:57 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:47750 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752439AbeB0Ldz (ORCPT ); Tue, 27 Feb 2018 06:33:55 -0500 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtps (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1eqdW5-0004MR-Mp from Harish_Kandiga@mentor.com ; Tue, 27 Feb 2018 03:33:53 -0800 Received: from hkandiga-VirtualBox.ina.mentorg.com (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.224.2; Tue, 27 Feb 2018 03:33:52 -0800 From: Harish Jenny K N To: , , , CC: , , Subject: [PATCH] mmc: card: Don't show eMMC RPMB and BOOT areas in /proc/partitions Date: Tue, 27 Feb 2018 17:03:49 +0530 Message-ID: <1519731229-19141-1-git-send-email-harish_kandiga@mentor.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrew Gabbasov Since RPMB area is accessible via special ioctl only and boot areas are unlikely to contain any partitions, exclude them all from listing in /proc/partitions. This will hide them from various user-level software (e.g. fdisk), thus avoiding unnecessary access attempts. Signed-off-by: Andrew Gabbasov Signed-off-by: Harish Jenny K N --- drivers/mmc/core/block.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 20135a5..376e47e 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2341,7 +2341,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, set_disk_ro(md->disk, md->read_only || default_ro); md->disk->flags = GENHD_FL_EXT_DEVT; if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT)) - md->disk->flags |= GENHD_FL_NO_PART_SCAN; + md->disk->flags |= GENHD_FL_NO_PART_SCAN + | GENHD_FL_SUPPRESS_PARTITION_INFO; /* * As discussed on lkml, GENHD_FL_REMOVABLE should: -- 1.9.1