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: <Pine.LNX.4.64.0705202146560.22011@alien.or.mcafeemobile.com>
Date:	Sun, 20 May 2007 22:05:00 -0700 (PDT)
From:	Davide Libenzi <davidel@...ilserver.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	Davi Arnaut <davi@...ent.com.br>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] signalfd: retrieve multiple signals with one read() call

On Sun, 20 May 2007, Andrew Morton wrote:

> > I think it fits the rule "buffer must be big enough for at least one sigingo".
> > We use the special return 0; as indicator that the process we were 
> > monitoring signals, detached the sighand.
> > 
> 
> hm.  Kernel violates proper read() semantics in many places.  Looks like we
> just did it again.

I think we can have the check that "if size == 0 return 0". The above 
cited return-0-on-detch would still apply for enough sized buffers. So:

1) size == 0, return 0 (POSIX wants this)

2) size < sizeof(signalfd_siginfo), return EINVAL

3) size >= sizeof(signalfd_siginfo) && DETACH, return 0

The signalfd falls into what POSIX defined as "special file", and can 
return a lower-than-size result.


> Unless we just remove the __clear_user() altogether.  Who said that "Unused
> memebers should be zero"?

Because it is a typically used value for still-unused/reserved members? 
Better than random values I think ;)
Members validity is driven by si_code & SI_MASK anyway.


- Davide


-
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