lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130207170300.GN3222@fieldses.org>
Date:	Thu, 7 Feb 2013 12:03:00 -0500
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	Pavel Shilovsky <piastry@...rsoft.ru>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-cifs@...r.kernel.org, linux-nfs@...r.kernel.org,
	wine-devel@...ehq.org
Subject: Re: [PATCH v2 3/8] vfs: Add O_DENYREAD/WRITE flags support for open
 syscall

On Thu, Feb 07, 2013 at 08:50:16PM +0400, Pavel Shilovsky wrote:
> 2013/2/7 J. Bruce Fields <bfields@...ldses.org>:
> > That would be a bug, I think.  E.g. "man 3posix open":
> >
> >         No  files  shall  be created or modified if the function returns
> >         -1.
> >
> > Looking at the code...  See the references to FILE_CREATED in
> > atomic_open--looks like that's trying to prevent may_open from failing
> > in this case.
> >
> >> I think
> >> there is no difference between this case and the situation with
> >> deny_lock_file there.
> >
> > Looks to me like it would be a bug in either case.
> 
> Then we returned from lookup_open in do_last we go to 'opened' lable.
> Then we have a 3(!) chances to return -1 while a file is created
> (open_check_o_direct, ima_file_check, handle_truncate

I don't know about the first two, but handle_truncate won't be hit since
will_truncate is false.

> ). In this case
> these places are bugs too.
> 
> We can call vfs_unlink if we failed after a file was created, but
> possible affects need to be investigated.

We definitely don't want to try to undo the create with an unlink.

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ