From: Arnd Bergmann <arnd@arndb.de>
To: spereira@tusc.com.au
Cc: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>,
acme@ghostprotocols.net, ak@muc.de, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, pereira.shaun@gmail.com
Subject: Re: [PATCH 3/4 -2.6.15]:x25: 32 bit (socket layer) ioctl emulation for 64 bit kernels
Date: Tue, 17 Jan 2006 01:15:06 +0100 [thread overview]
Message-ID: <200601170115.07019.arnd@arndb.de> (raw)
In-Reply-To: <1137453135.6553.19.camel@spereira05.tusc.com.au>
Am Dienstag, 17. Januar 2006 00:12 schrieb Shaun Pereira:
> +static int compat_x25_subscr_ioctl(unsigned int cmd,
> + struct compat_x25_subscrip_struct __user *x25_subscr32)
> +{
> + struct x25_subscrip_struct x25_subscr;
> + struct x25_neigh *nb;
> + struct net_device *dev;
> + int rc = -EINVAL;
> +
> + if (cmd != SIOCX25GSUBSCRIP && cmd != SIOCX25SSUBSCRIP)
> + goto out;
btw, the above check is not needed here, but that's not my point.
> +
> + rc = -EFAULT;
> + if(copy_from_user(&x25_subscr, x25_subscr32, sizeof(*x25_subscr32)))
> + goto out;
Unfortunately, I just found another bug in this code, similar to one you
already fixed in the sock_get_timestamp handler:
You can't do the copy_from_user like this if the arguments have different
types. Changing the declaration 'struct x25_subscrip_struct x25_subscr;'
to 'struct compat_x25_subscrip_struct x25_subscr;' should fix this problem,
but please verify that it really works with a test case that relies on the
contents of x25_subscr->extended.
Arnd <><
next prev parent reply other threads:[~2006-01-17 0:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-12 6:02 [PATCH 2/4 - 2.6.15]net: 32 bit (socket layer) ioctl emulation for 64 bit kernels Shaun Pereira
2006-01-12 19:24 ` Arnd Bergmann
2006-01-13 3:14 ` Shaun Pereira
2006-01-13 11:46 ` Arnd Bergmann
2006-01-16 5:59 ` Shaun Pereira
2006-01-16 6:41 ` YOSHIFUJI Hideaki / 吉藤英明
[not found] ` <200601161043.31742.arnd@arndb.de>
2006-01-16 23:11 ` [PATCH 1/4 - 2.6.15 ]net : " Shaun Pereira
2006-01-16 23:11 ` [PATCH 2/4 - 2.6.15]net: " Shaun Pereira
2006-01-16 23:12 ` [PATCH 3/4 -2.6.15]:x25: " Shaun Pereira
2006-01-17 0:15 ` Arnd Bergmann [this message]
2006-01-17 4:20 ` [PATCH 3/4 -2.6.15- RESEND]:x25: " Shaun Pereira
2006-01-18 6:56 ` Shaun Pereira
2006-01-19 0:57 ` Arnd Bergmann
2006-01-19 1:05 ` David S. Miller
2006-01-16 23:12 ` [PATCH 4/4]x25: " Shaun Pereira
2006-01-16 9:39 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200601170115.07019.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=acme@ghostprotocols.net \
--cc=ak@muc.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pereira.shaun@gmail.com \
--cc=spereira@tusc.com.au \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).