From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id F06511EF6B1; Fri, 19 Jul 2013 12:00:22 -0400 (EDT) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by befuddled.reisers.ca (Postfix) with ESMTPS id 5D36B1EF08B for ; Fri, 19 Jul 2013 12:00:22 -0400 (EDT) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6JG0IZR022590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Jul 2013 16:00:19 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6JG0IjH008483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 Jul 2013 16:00:18 GMT Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6JG0IOi012095 for ; Fri, 19 Jul 2013 16:00:18 GMT MIME-Version: 1.0 Message-ID: <444275b3-63df-4577-835c-04ebc2830eb3@default> Date: Fri, 19 Jul 2013 09:00:18 -0700 (PDT) From: Don Raikes Sender: Don Raikes To: "Speakup is a screen review system for Linux." Subject: RE: ot memory allocation question References: <41356f9b-e7c3-4522-b960-142abea1cedd@default> <87fvvawwrj.fsf@mushroom.PK5001Z> In-Reply-To: <87fvvawwrj.fsf@mushroom.PK5001Z> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7 (607090) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.2 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: "Speakup is a screen review system for Linux." List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2013 16:00:23 -0000 Chris, I gave that code segmentthat I sent a try, and it gives me an error in the = copy_to_user call. It looks like none of the bytes were copied to the user= space buffer. I also get incompatible pointer types in the call to sys_write -----Original Message----- From: Chris Brannon [mailto:chris@the-brannons.com]=20 Sent: Friday, July 19, 2013 5:38 AM To: Speakup is a screen review system for Linux. Subject: Re: ot memory allocation question Don Raikes writes: > My solution: > > Allocate a new larger buffer inside of the userspace and copy_to_user=20 > into the new buffer and then when I pass control to the "real" > sys_write function point it to the new buffer. > But the problem is how do I allocate this new buffer? There's no easy way to do this. You can't just pass your kernel buffer to = the system call you are intercepting, since the intercepted call expects a = user-space buffer. Have a look at this link for some inspiration: http://web.cs.wpi.edu/~cs4513/b05/proj1note2.txt Also be careful about the return value of the real sys_write system call. = If you're passing it a buffer larger than the n bytes passed in from usersp= ace, its return value can be greater than n. Don't just use it unmodified = as the return value for your function. -- Chris _______________________________________________ Speakup mailing list Speakup@linux-speakup.org http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup