From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id ACA471EF6B4; Thu, 18 Jul 2013 20:46:56 -0400 (EDT) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by befuddled.reisers.ca (Postfix) with ESMTPS id DAB341EF56E for ; Thu, 18 Jul 2013 20:46:55 -0400 (EDT) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6J0kqLl010286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Jul 2013 00:46:53 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6J0kpTs025390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 Jul 2013 00:46:52 GMT Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6J0kpfP003695 for ; Fri, 19 Jul 2013 00:46:51 GMT MIME-Version: 1.0 Message-ID: <481c693b-a8bb-4700-baca-6e4a44fc23d6@default> Date: Thu, 18 Jul 2013 17:46:49 -0700 (PDT) From: Don Raikes Sender: Don Raikes To: "Speakup is a screen review system for Linux." Subject: RE: OT: kernel oops References: <0d30e6e5-261e-47e0-b5da-2ce5fe6bad24@default> <87mwpjx3ae.fsf@mushroom.PK5001Z> <20130718234302.GA7934@jdc.jasonjgw.net> In-Reply-To: <20130718234302.GA7934@jdc.jasonjgw.net> 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=utf-8 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 00:46:56 -0000 Ok guys, I have one more question on this assignment :-) I successfully read in the data using copy_from_user and then I did some ma= ngling of the data which I verified worked properly. Now I want to put it back into user space, so I use: If (copy_to_user(buf, tbuf2, count)) Buf is defined in the parameter list of my function as: Const char __user * buf Tbuf2 is defined as=20 Char *tbuf; And count is just an int. I get a compile time error: /home/seed/hw5/hookme.c:128: warning: passing argument 1 of =C3=A2=E2=82=AC= =CB=9Ccopy_to_user=C3=A2=E2=82=AC=E2=84=A2 discards qualifiers from pointer= target type Any good ideas on why this occurring and how I can fix it? Thanks in advance for any help! -----Original Message----- From: Jason White [mailto:jason@jasonjgw.net]=20 Sent: Thursday, July 18, 2013 4:43 PM To: speakup@linux-speakup.org Subject: Re: OT: kernel oops Chris Brannon wrote: > Don Raikes writes: >=20 > > The section of code that is having problems looks like this: > *SNIP* > > if (copy_from_user(&tbuf, buf, count)) >=20 > This line is your problem. You are passing a=20 > pointer-to-pointer-to-character (char **) as the first argument to=20 > copy_from_user, but you should be passing char * instead. So ditch=20 > the ampersand, and all will be right with the world! > I could give you a thorough explanation of why this is failing, if you=20 > like, but to make a long story short, this line of code is smashing=20 > the stack! In other words, you're passing it the address of the pointer to the buffer,= rather than the pointer itself, which holds the address of the buffer. _______________________________________________ Speakup mailing list Speakup@linux-speakup.org http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup