From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752464AbbK1Wur (ORCPT ); Sat, 28 Nov 2015 17:50:47 -0500 Received: from 3.mo69.mail-out.ovh.net ([188.165.52.203]:38052 "EHLO 3.mo69.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbbK1Wun (ORCPT ); Sat, 28 Nov 2015 17:50:43 -0500 X-Greylist: delayed 4641 seconds by postgrey-1.27 at vger.kernel.org; Sat, 28 Nov 2015 17:50:43 EST From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Jeff Dike , Richard Weinberger , Tristan Schmelcher , Greg Kroah-Hartman , user-mode-linux-devel@lists.sourceforge.net, user-mode-linux-user@lists.sourceforge.net Subject: [PATCH 1/2] um: Set secure access mode for temporary file Date: Sat, 28 Nov 2015 22:32:29 +0100 Message-Id: <1448746350-19998-2-git-send-email-mic@digikod.net> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448746350-19998-1-git-send-email-mic@digikod.net> References: <1448746350-19998-1-git-send-email-mic@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 2135832123466361113 X-Ovh-Remote: 94.23.54.103 (ns3096276.ip-94-23-54.eu) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekhedrkeehucetufdoteggodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekhedrkeehucetufdoteggodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the default insecure mode 0777 with 0700 for temporary file. Prohibit other users to change the executable mapped code. Signed-off-by: Mickaël Salaün --- arch/um/os-Linux/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index 897e9ad..798aeb4 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c @@ -142,7 +142,7 @@ static int __init create_tmp_file(unsigned long long len) if (fd < 0) exit(1); - err = fchmod(fd, 0777); + err = fchmod(fd, 0700); if (err < 0) { perror("fchmod"); exit(1); -- 2.6.2