From owner-freebsd-hackers@freebsd.org Mon Aug 28 02:31:42 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 463ABE039F5 for ; Mon, 28 Aug 2017 02:31:42 +0000 (UTC) (envelope-from cedric.blancher@gmail.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10CCE65252 for ; Mon, 28 Aug 2017 02:31:42 +0000 (UTC) (envelope-from cedric.blancher@gmail.com) Received: by mail-io0-x231.google.com with SMTP id g33so12180806ioj.3 for ; Sun, 27 Aug 2017 19:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ds6LJnvDJ8eWtBcjlq0lth9tBzmNAv+bRntApi+Y98w=; b=PtFGJyqotu9yk48pjpYxaagfhdaGRXGsvIIASa9WQtJliR8nBfbZ5zgOkxcHGmpUEC tQExBYZHaBt1sNGPynd8vD/+X5XMcrrGBXxVykija49B4HETT2fjq82nxqEOAyNYt9NQ Vpb/jKUGR+fNa6dwxs35dnn+20+rz59hdRwlczHgiuIoCues295PCK7dFCk6WhkjldKI OsIHN4pkzRUwqSsBrTtpZyHiaShBoOVmMT3dZ+mTQWaIDKYplK8gB05P7Z19Q1x4GVFe c/3JXq7Q76HlBFwEz1gpeoXU/svXS+H+DoRczT7pRju37QNc3YId/5SLXLasau4w24TI gFAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ds6LJnvDJ8eWtBcjlq0lth9tBzmNAv+bRntApi+Y98w=; b=KfIJ+oQpqDFXjV58eppvEf6YUHinHE7Jaa3su4DqfpcIWoRXi4ExUJtTqQAKwT4vCJ FphnRSMYdnmznBX6l0PAdKapCJCCC34FhPcprajt82Q4+iqbmoEt59ptZH/HCx862ZtC RTHh1+JErQt9MqUUuCVBOxyBjiuePF8VoQ6gaYvCBLO0AFmfV92SmaGEXqMs5eFbejsx tsLyvZYqBgXXmRgU8Gh4SIOAfRwL3YFzSBZtncQo8rqqZA3CtP/Rdmk6C4FYPKu4F4Ul 5cFlXcrbkk+daM3YTbaMUBKAvSu6IYP4mcKBYvEzAB33qvVzgPd3q7lLrSboiE/kRByu bCrg== X-Gm-Message-State: AHYfb5jslH+CYeU2FJata9dWCsAZe7E+y8Nk6dRk1LNQt7GIV9XGRWAw j4n24n7gWsV4ITEvv15t+H1lcOda4A== X-Received: by 10.107.35.84 with SMTP id j81mr5337725ioj.131.1503887501165; Sun, 27 Aug 2017 19:31:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.150.203 with HTTP; Sun, 27 Aug 2017 19:31:40 -0700 (PDT) In-Reply-To: <20170826161827.GA21456@schoggimuss.roe.ch> References: <20170826161827.GA21456@schoggimuss.roe.ch> From: Cedric Blancher Date: Mon, 28 Aug 2017 04:31:40 +0200 Message-ID: Subject: Re: [PATCH] O_NOATIME support for open(2) To: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2017 02:31:42 -0000 You know, this was long discussed in a Solaris rfe, and it was found that O_NOATIME has serious security implications and can be used to circumvent atime-based monitoring. So basically, you open a security hole with this. Ced On 26 August 2017 at 18:18, Daniel Roethlisberger wrote: > I'm trying to implement O_NOATIME support for open(2) in order to > provide a more elegant way for backup/archiving software to > prevent atime clobbering. Except for a 2008 thread on this list > I did not find any material; not sure if anybody is interested in > this or if there are reasons why this was never implemented. > > The attached patch against 11.1 implements O_NOATIME support for > open(2); it prevents read(2) and mmap(2) from clobbering atime if > the file descriptor was opened with O_NOATIME. O_NOATIME is only > permitted for root and the owner of the file. Currently it is > only implemented for ufs/ffs. It seems to work for me but has > not been extensively tested. > > I am interested in feedback from people who know their way around > I/O and VFS code before I extend this to other file systems, make > O_NOATIME tunable by fcntl(2), wire it to the Linux compat layer > and write docs. Does the implementation look sane? Did I miss > something important? > > Specifically, is there a better way to pass O_NOATIME into > vm_mmap_vnode other than adding an additional boolean_t argument? > I did not use an additional mmap flag because that would have > required additional logic to prevent userland from passing the > flag to the mmap syscall. > > Daniel > > -- > Daniel Roethlisberger > http://daniel.roe.ch/ > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" -- Cedric Blancher [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur