lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9027.1211551014@vena.lwn.net>
Date:	Fri, 23 May 2008 07:56:54 -0600
From:	corbet@....net (Jonathan Corbet)
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	video4linux-list@...hat.com, linux-kernel@...r.kernel.org,
	mchehab@...radead.org
Subject: Re: [PATCH] video4linux: Push down the BKL 

> diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
> [...]
> -	.ioctl = video_ioctl2,
> +	.unlocked_ioctl = video_ioctl2,

Weird, that was always intended to be that way, I'm not sure what
happened.  In any case, consider this part to be

	Acked-by: Jonathan Corbet <corbet@....net>

However, in this part:

> diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
> [...]

> +	lock_kernel();
>  	err = __video_do_ioctl(inode, file, cmd, parg);
> +	unlock_kernel();

This forces the BKL on all V4L2 drivers whether or not they need it.
Given that this code can, in fact, be a path where latency matters
(consider VIDIOC_DQBUF), I'm not sure that's the best way to do it.

On the other hand, the next level of BKL pushdown would be painful as
all hell, given the massive number of callbacks in the V4L2 API.  So I'm
thinking it might be justified to create a video_ioctl2_locked() for
V4L2 drivers which are not yet known to be safe in the absence of the
BKL.  The amount of extra code would be quite small, and it would let
safe drivers operate BKL-free.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ