Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261153AbTFBT4w (ORCPT ); Mon, 2 Jun 2003 15:56:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261769AbTFBT4w (ORCPT ); Mon, 2 Jun 2003 15:56:52 -0400 Received: from e31.co.us.ibm.com ([32.97.110.129]:49821 "EHLO e31.co.us.ibm.com") by vger.kernel.org with ESMTP id S261153AbTFBT4t (ORCPT ); Mon, 2 Jun 2003 15:56:49 -0400 Date: Mon, 2 Jun 2003 15:10:12 -0500 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: multipart/mixed; boundary=Apple-Mail-15--1031998591 Subject: [CHECKER][PATCH] pnpbios dereferencing user pointer From: Hollis Blanchard To: linux-kernel@vger.kernel.org Message-Id: <37C2C7CC-9536-11D7-BBCD-000A95A0560C@us.ibm.com> X-Mailer: Apple Mail (2.552) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1200 Lines: 43 --Apple-Mail-15--1031998591 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Another simple case of a memcpy that should be copy_from_user... -- Hollis Blanchard IBM Linux Technology Center --Apple-Mail-15--1031998591 Content-Disposition: attachment; filename=pnpbios-memcpy.diff Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="pnpbios-memcpy.diff" --- linux-2.5.70/drivers/pnp/pnpbios/proc.c.orig Mon Mar 24 16:30:11 2003 +++ linux-2.5.70/drivers/pnp/pnpbios/proc.c Tue May 27 13:18:57 2003 @@ -185,7 +185,10 @@ return -EIO; if (count != node->size - sizeof(struct pnp_bios_node)) return -EINVAL; - memcpy(node->data, buf, count); + if (copy_from_user(node->data, buf, count)) { + kfree(node); + return -EFAULT; + } if (pnp_bios_set_dev_node(node->handle, boot, node) != 0) return -EINVAL; kfree(node); --Apple-Mail-15--1031998591-- - 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/