[Home]

Summary:ASTERISK-05173: [patch] zaptel.c has unchecked calls to copy_from_user() and copy_to_user()
Reporter:Tony Mountifield (softins)Labels:
Date Opened:2005-09-28 09:41:24Date Closed:2008-06-07 11:04:44
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) zaptel.c-diff.txt
Description:In zaptel.c, some invocations of copy_from_user() and copy_to_user() do not have their return value checked, which results in compiler warnings when compiling under Linux 2.6 (see below).

Also, some calls which are checked, return -EIO as the error code instead of -EFAULT.

The attached patch corrects both of the above.

****** ADDITIONAL INFORMATION ******

 CC [M]  /usr/src/zaptel/zaptel.o
/usr/src/zaptel/zaptel.c: In function `zt_chan_write':
/usr/src/zaptel/zaptel.c:1761: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c: In function `ioctl_load_zone':
/usr/src/zaptel/zaptel.c:2408: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c: In function `zt_common_ioctl':
/usr/src/zaptel/zaptel.c:2760: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c:2820: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c:2823: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c:2905: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c:2935: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c: In function `zt_chanandpseudo_ioctl':
/usr/src/zaptel/zaptel.c:3657: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c:3667: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c:3670: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c:3729: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result
/usr/src/zaptel/zaptel.c:3733: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
Comments:By: Serge Vecher (serge-v) 2005-09-28 16:18:58

Patch applies and rids of annoying compiler warnings. Nothing seems broken ATM.



By: Kevin P. Fleming (kpfleming) 2005-09-28 23:07:23

Committed to CVS HEAD, thanks!

By: Digium Subversion (svnbot) 2008-06-07 11:04:44

Repository: dahdi
Revision: 782

U   trunk/zaptel.c

------------------------------------------------------------------------
r782 | kpfleming | 2008-06-07 11:04:43 -0500 (Sat, 07 Jun 2008) | 2 lines

check results of copy_from/to_user (issue ASTERISK-5173)

------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=782