public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* video_usercopy() enforces change of VideoText IOCTLs since 2.6.8
@ 2004-10-07 16:54 Michael Geng
  2004-10-08 10:52 ` Gerd Knorr
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Geng @ 2004-10-07 16:54 UTC (permalink / raw)
  To: Gerd Knorr; +Cc: linux-kernel

Hello Gerd,

from kernel 2.6.7 to 2.6.8 function video_usercopy() in 
videodev.c was modified in a way that IOCTLs which do not
use the _IO macros defined in linux/ioctl.h will get their
driver's ioctl function called with arg = 0.

This means that the videotext drivers (saa5246a and saa5249)
only produce segmentation faults in kernel version >= 2.6.8.

Shall we change the IOCTL definitions in include/linux/videotext.h?
This would mean that existing userspace programs will have to be 
recompiled in order to work with the latest kernel version.

Nevertheless I suggest changing these IOCTLs to the new method. 
I will work out a patch if you agree.

Below is the change I'm talking about:

int
video_usercopy(struct inode *inode, struct file *file,
	       unsigned int cmd, unsigned long arg,
	       int (*func)(struct inode *inode, struct file *file,
			   unsigned int cmd, void *arg))
{
	char	sbuf[128];
	void    *mbuf = NULL;
	void	*parg = NULL;
	int	err  = -EINVAL;

	cmd = video_fix_command(cmd);

	/*  Copy arguments into temp kernel buffer  */
	switch (_IOC_DIR(cmd)) {
	case _IOC_NONE:
===> 2.6.7:
		parg = (void *)arg;
===> 2.6.8:
		parg = NULL;
        ...

	/* call driver */
	err = func(inode, file, cmd, parg);

Bye,
Michael

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-10-13 14:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-07 16:54 video_usercopy() enforces change of VideoText IOCTLs since 2.6.8 Michael Geng
2004-10-08 10:52 ` Gerd Knorr
2004-10-08 21:00   ` Andrew Morton
2004-10-09  9:28     ` Gerd Knorr
2004-10-09 11:28       ` Michael Geng
2004-10-09 12:18         ` Gerd Knorr
2004-10-10  8:55           ` Michael Geng
2004-10-11 15:14             ` Gerd Knorr
2004-10-11 16:21               ` Michael Geng
2004-10-13 11:00                 ` Alan Cox
2004-10-13 14:42                   ` Michael Geng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox