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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 13 May 2017 01:53:40 +0300
From:   Cyrill Gorcunov <gorcunov@...il.com>
To:     Jann Horn <jannh@...gle.com>
Cc:     linux-fsdevel@...r.kernel.org,
        kernel list <linux-kernel@...r.kernel.org>,
        Linux API <linux-api@...r.kernel.org>,
        Al Viro <viro@...iv.linux.org.uk>, akpm@...uxfoundation.org,
        avagin@...tuozzo.com, xemul@...tuozzo.com,
        Michael Kerrisk-manpages <mtk.manpages@...il.com>,
        avagin@...nvz.org, jbaron@...mai.com,
        Andy Lutomirski <luto@...capital.net>
Subject: Re: [patch v4 resend 2/2] kcmp: Add KCMP_EPOLL_TFD mode to compare
 epoll target files

On Sat, May 13, 2017 at 12:41:30AM +0200, Jann Horn wrote:
> [resending as plaintext]
> 
> I realize that the existing kcmp code has the same issue, but:
> 
> Why are you not taking a reference to filp or filp_tgt? This can end up
> performing a comparison between a pointer to a freed struct file and a
> pointer to a struct file that was allocated afterwards, right? So it can
> return a false "is equal" result when the two files aren't actually the same
> if one of the target tasks is running? This looks like it unnecessarily
> exposes information about whether an allocation reuses the memory of
> a previously freed allocation.

It work with unlocked data on purpose for speed sake. Moreover even
if we grap a reference it is valid _only_ during comparision operation,
next we drop ref and it can be easily freed by os. Thus it's up to
a caller to keep references to files/task and other resources used.

	Cyrill

Powered by blists - more mailing lists