Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S271210AbTHCRXH (ORCPT ); Sun, 3 Aug 2003 13:23:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S271222AbTHCRXH (ORCPT ); Sun, 3 Aug 2003 13:23:07 -0400 Received: from smtp-100-sunday.noc.nerim.net ([62.4.17.100]:55821 "EHLO mallaury.noc.nerim.net") by vger.kernel.org with ESMTP id S271210AbTHCRXD (ORCPT ); Sun, 3 Aug 2003 13:23:03 -0400 Date: Sun, 3 Aug 2003 19:23:12 +0200 From: Jean Delvare To: "Robert T. Johnson" , "Greg KH" Cc: sensors@stimpy.netroedge.com, linux-kernel@vger.kernel.org Subject: Re: PATCH: 2.4.22-pre7 drivers/i2c/i2c-dev.c user/kernel bug and mem leak Message-Id: <20030803192312.68762d3c.khali@linux-fr.org> Reply-To: sensors@stimpy.netroedge.com, linux-kernel@vger.kernel.org X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2702 Lines: 82 Hi all, Ten days ago, Robert T. Johnson repported two bugs in 2.4's drivers/i2c/i2c-dev.c. It also applies to i2c CVS (out of kernel), which is intended to become 2.4's soon. Being a member of the LM Sensors dev team, I took a look at the repport. My knowledge is somewhat limited but I'll do my best to help (unless Greg wants to handle it alone? ;-)). For the user/kernel bug, I'm not sure I understand how copy_from_user is supposed to work. If I understand what the proposed patch does, it simply allocates a second buffer, copy_from_user to that buffer instead of to the original one, and then copies from that second buffer to the original one (kernel to kernel). I just don't see how different it is from what the current code does, as far as user/kernel issues are concerned. I must be missing something obvious, can someone please bring me some light? For the mem leak bug, it's clearly there. I admit the proposed patch fixes it, but I think there is a better way to fix it. Compare what the proposed patch does: --- i2c-dev.c Sun Aug 3 18:24:33 2003 +++ i2c-dev.c.proposed Sun Aug 3 19:13:58 2003 @@ -226,6 +226,7 @@ res = 0; for( i=0; i as the main I2C contact in MAINTAINERS. Simon Vogl and Frodo Looijaard's have been doing a really great job, but they do not work actively on I2C anymore, so they end up forwarding every repport to the list anyway. -- Jean Delvare http://www.ensicaen.ismra.fr/~delvare/ - 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/