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] [day] [month] [year] [list]
Message-Id: <20071026132439.decb40d9.akpm@linux-foundation.org>
Date:	Fri, 26 Oct 2007 13:24:39 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Dmitry Antipov <antipov@....rtsoft.ru>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] -EINVAL if no fasync op for file

On Thu, 18 Oct 2007 13:35:51 +0400
Dmitry Antipov <antipov@....rtsoft.ru> wrote:

> This patch proposes an additional error checking performed within setfl().
> 
> As a result, fcntl (fd, F_SETFL, O_ASYNC) will return -1 and set errno
> to -EINVAL if filp->f_op->fasync is NULL for file specified by fd. This
> is possible, for example, if fd is a descriptor returned by inotify_init().
> 
> 
> Dmitry
> 
> 
> 
> [2.6.23-fcntl-fasync-check.patch  text/x-patch (353B)]
> Signed-off-by: Dmitry Antipov <antipov@....rtsoft.ru>
> 
> --- .orig-2.6.23/fs/fcntl.c	2007-10-17 15:26:06.000000000 +0400
> +++ 2.6.23/fs/fcntl.c	2007-10-17 15:25:27.000000000 +0400
> @@ -240,6 +240,9 @@
>  			error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0);
>  			if (error < 0)
>  				goto out;
> +		} else {
> +			error = -EINVAL;
> +			goto out;
>  		}
>  	}

This would have made sense whent he code was originally written
but it now has a (small) potential to break existing applications.

I guess if the _only_ fd's which don't implement fasync are inotify,
signalfd and other such new-and-obscure things then the risk is
probably acceptably low.

But is the proposed change actually very useful?
-
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