From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751342AbWDQWJ2 (ORCPT ); Mon, 17 Apr 2006 18:09:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751348AbWDQWJ2 (ORCPT ); Mon, 17 Apr 2006 18:09:28 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:42114 "EHLO pentafluge.infradead.org") by vger.kernel.org with ESMTP id S1751342AbWDQWJ1 (ORCPT ); Mon, 17 Apr 2006 18:09:27 -0400 Subject: Re: Slab corruption after unloading a module From: Arjan van de Ven To: zhiyi huang Cc: Andrey Borzenkov , linux-kernel@vger.kernel.org In-Reply-To: References: <200604161443.21653.arvidjaar@mail.ru> Content-Type: text/plain Date: Tue, 18 Apr 2006 00:09:20 +0200 Message-Id: <1145311760.2847.97.camel@laptopd505.fenrus.org> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2006-04-18 at 10:08 +1200, zhiyi huang wrote: > > > >> There was no problem if I just load and unload the module. But if I > >> write to the device using "ls > /dev/temp" and then unload the > >> module, I would get slab corruption. > > > > you return different value as what has really been consumed: > > > >> if (*f_pos + count > MAX_DSIZE) > >> count1 = MAX_DSIZE - *f_pos; > >> > >> if (copy_from_user (temp_dev->data+*f_pos, buf, count1)) { this is still buggy.. what if f_pos is huge???