Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752455Ab3JLOlJ (ORCPT ); Sat, 12 Oct 2013 10:41:09 -0400 Received: from merlin.infradead.org ([205.233.59.134]:60431 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555Ab3JLOlH (ORCPT ); Sat, 12 Oct 2013 10:41:07 -0400 Date: Sat, 12 Oct 2013 16:40:57 +0200 From: Peter Zijlstra To: Roel Kluin Cc: Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: lockdep: testing '0' where '\0' intended? Message-ID: <20131012144057.GA2675@laptop.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 966 Lines: 30 On Sat, Oct 12, 2013 at 01:06:03AM +0200, Roel Kluin wrote: > Not entirely sure about the assembly part, but shouldn't it... > -------- > Test for the nul character rather than the '0' (== 0x30), in the > __get_user_unknown() case. > > Signed-off-by: Roel Kluin > --- > diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c > index b2c71c5..71b3aba 100644 > --- a/kernel/lockdep_proc.c > +++ b/kernel/lockdep_proc.c > @@ -632,7 +632,7 @@ static ssize_t lock_stat_write(struct file *file, > const char __user *buf, > if (get_user(c, buf)) > return -EFAULT; > > - if (c != '0') > + if (c != '\0') No we really meant '0'. Its so that: echo 0 > /proc/lock_stat resets the stats. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/