From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750983AbbLHVqK (ORCPT ); Tue, 8 Dec 2015 16:46:10 -0500 Received: from a.ns.miles-group.at ([95.130.255.143]:11949 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbbLHVp4 (ORCPT ); Tue, 8 Dec 2015 16:45:56 -0500 Subject: Re: [PATCH v2 1/2] um: Set secure access mode for temporary file To: Tristan Schmelcher , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= References: <1448805802-12156-1-git-send-email-mic@digikod.net> <1448805802-12156-2-git-send-email-mic@digikod.net> <56641CEA.5080202@digikod.net> <566449A3.6030504@digikod.net> Cc: linux-kernel@vger.kernel.org, Jeff Dike , Greg Kroah-Hartman , user-mode-linux-devel , user-mode-linux-user@lists.sourceforge.net From: Richard Weinberger Message-ID: <56674F91.8050108@nod.at> Date: Tue, 8 Dec 2015 22:45:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 08.12.2015 um 21:37 schrieb Tristan Schmelcher: > On 6 December 2015 at 09:43, Mickaël Salaün wrote: >> Well, I'm concerned to use umask because it is not thread-safe and drivers may use create_mem_file() in a multi-theaded context. > > You are right. We should perhaps set the umask to 0700 permanently > during process start. But I am not sure if this will interfere with > other UML code. It *should* not hurt. Let's see what explodes. :) >> I prefer to stick to fchmod and handle the race-condition with O_TMPFILE unsell someone is sure that this will not create bugs :) > > The fchmod call is basically useless and should probably be removed. I agree. Thanks, //richard