From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbdCPN6I (ORCPT ); Thu, 16 Mar 2017 09:58:08 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:51830 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751535AbdCPN6G (ORCPT ); Thu, 16 Mar 2017 09:58:06 -0400 Date: Thu, 16 Mar 2017 14:57:35 +0100 From: Peter Zijlstra To: Oleg Nesterov Cc: Dmitry Vyukov , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , LKML , Mathieu Desnoyers , syzkaller Subject: Re: perf: use-after-free in perf_release Message-ID: <20170316135735.5psknfxe7e73gnag@hirez.programming.kicks-ass.net> References: <20170307165131.GA6097@redhat.com> <20170314125508.GK3343@twins.programming.kicks-ass.net> <20170314140302.GA28146@redhat.com> <20170314140754.GG3328@twins.programming.kicks-ass.net> <20170314143010.GA30351@redhat.com> <20170314150241.GO5680@worktop> <20170314151910.GA31766@redhat.com> <20170314152625.GP5680@worktop> <20170314155949.GE32474@worktop> <20170315164302.GA17317@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170315164302.GA17317@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 15, 2017 at 05:43:02PM +0100, Oleg Nesterov wrote: > static inline int list_is_first(const struct list_head *list, > const struct list_head *head) > { > return head->next == list; > } > > won't be symmetrical with list_is_last() we already have. This is the one that makes sense to me though; that is, the current list_is_last() doesn't make sense to me. I would expect: static inline int list_is_last(const struct list_head *list, const struct list_head *head) { return head->prev == list } because @head is the list argument (yes, I know, horrible naming!).