public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v4 0/6] fcntl fortification
@ 2023-07-30 19:25 Sergey Bugaev
  2023-07-30 19:25 ` [PATCH v4 1/6] Fix calling fcntl64 (fd, F_SETLK, &flock64) Sergey Bugaev
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Sergey Bugaev @ 2023-07-30 19:25 UTC (permalink / raw)
  To: libc-alpha

Hello,

this is the v4 of the fcntl fortification work. v1 was at [0], v2 at
[1], v3 at [2].

[0]: https://sourceware.org/pipermail/libc-alpha/2023-May/148332.html
[1]: https://sourceware.org/pipermail/libc-alpha/2023-May/148569.html
[2]: https://sourceware.org/pipermail/libc-alpha/2023-June/149096.html

Changes since v3:

- Rebased onto the latest master.
- Fixed the bug found by Linaro CI (thanks!): F_DUPFD_CLOEXEC is not
  always defined, so it has to be surrounded by ifdef checks too.
- This patchset is now compatible with Frédéric Bérat's work on
  fortifying glibc itself / --enable-fortify-source!
- Fixed a bug: F_GETLK etc may have the same values as F_GETLK64 etc, so
  the previous version of this patchset would complain about F_GETLK64
  usage with struct flock64, since the check for F_GETLK happened first.
  This is now fixed by accepting both struct flock and struct flock64 if
  F_GETLK has the same value as F_GETLK64.
- Found and fixed a few cases of what seems to be actual commmand / type
  confusion in the tests! Specifically, it was calling
  fcntl64 (fd, F_SETLK, &flock64)
  in a few places, which is incorrect according to my understanding and
  my tests of Linux behavior. Please see the first patch for some more
  details, and please correct me if I'm wrong!

I've checked that this builds and passes tests (there are a few test
failures, but they all seem unrelated) for x86_64-linux-gnu and
i686-linux-gnu with and without --enable-fortify-source. I've also
checked that it builds for x86_64-gnu with and without
--enable-fortify-source, but I haven't run the tests.

Sergey

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

end of thread, other threads:[~2023-08-08 18:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-30 19:25 [PATCH v4 0/6] fcntl fortification Sergey Bugaev
2023-07-30 19:25 ` [PATCH v4 1/6] Fix calling fcntl64 (fd, F_SETLK, &flock64) Sergey Bugaev
2023-07-31 17:50   ` Adhemerval Zanella Netto
2023-08-08 18:40     ` Sergey Bugaev
2023-07-30 19:25 ` [PATCH v4 2/6] support: Add support_fcntl_support_ofd_locks () Sergey Bugaev
2023-07-30 19:25 ` [PATCH v4 3/6] cdefs.h: Define __glibc_warn_system_headers_{begin,end} Sergey Bugaev
2023-07-30 19:25 ` [PATCH v4 4/6] cdefs.h: Enable __errordecl & __warnattr for Clang 14+ Sergey Bugaev
2023-08-02 17:23   ` Adhemerval Zanella Netto
2023-07-30 19:26 ` [PATCH v4 5/6] io: Add FORTIFY_SOURCE check for fcntl arguments Sergey Bugaev
2023-07-30 19:54   ` Sergey Bugaev
2023-08-02 19:46   ` Adhemerval Zanella Netto
2023-07-30 19:26 ` [PATCH v4 6/6] io: Also verify 2-arg fctnl calls at runtime Sergey Bugaev
2023-08-08 18:29   ` Adhemerval Zanella Netto
2023-07-31 14:40 ` [PATCH v4 0/6] fcntl fortification Zack Weinberg
2023-07-31 17:25   ` Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).