From: Satinder <jeet_sat12@yahoo.co.in>
To: linux-kernel@vger.kernel.org
Subject: [Query] regarding sock_ioctl in linux kernel
Date: Wed, 28 Dec 2005 10:15:28 +0000 (GMT) [thread overview]
Message-ID: <20051228101528.50347.qmail@web8318.mail.in.yahoo.com> (raw)
Hi everybody,
I was viewing the linux source code (version 2.6.9 )
for socket APIs.
in function sock_ioctl() [file net/socket.c.]
I found that the kernel is handling the socket pointer
without any check.
Even in 'default' case it is calling
sock->ops->ioctl() without checking whether the
sock->ops having value or not.
Is this assumed that the kernel will call the
sock_ioctl only when the socket data structure/ file
structure/socket substructure exists, or there is
some other reason for not putting checks before
calling file operations in sock_ioctl
There may be case when someone may alloc socket in
init module and map it to file descriptor using
sock_map_fd() and increament its reference count using
fget().
And at cleanup time it releases the socket using
sock_release() without unmaping file descriptor and
decreamenting the referenece count.
and socket->file would be NULL without freeing the
inode number when sock_release returns. So at reboot
time many network process may try to use this socket
beacause inode is not being released. In this case
kernel may crash.?
If anyone could explain this that would be very nice.
Please keep me in cc.
TIA
Regards,
Satinder
Send instant messages to your online friends http://in.messenger.yahoo.com
next reply other threads:[~2005-12-28 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-28 10:15 Satinder [this message]
2006-01-03 15:10 ` Ram Gupta
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=20051228101528.50347.qmail@web8318.mail.in.yahoo.com \
--to=jeet_sat12@yahoo.co.in \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®