From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/fcntl34: use struct flock64 on 32bit
Date: Mon, 13 Jun 2016 20:25:14 +0200 [thread overview]
Message-ID: <20160613182513.GC354@rei.lan> (raw)
In-Reply-To: <575EF441.5020506@redhat.com>
Hi!
> > Since both manual and glibc examples use struct flock with OFD locks in
> > examples and if I compile glibc example for OFD locks[1] on 32bit system
> > garbage is passed to kernel syscalls and the program hangs, so I would
> > call this glibc/kernel bug.
> >
> > I would expect glibc to convert the flock structure to 64 bit one
> > silently in this case.
>
> That might not be possible as such "silent" conversion could break
> a lot of existing programs that rely on hardcoded 32bit struct flock
> size.
What I meant was to use the user supplied flock structure to initialize
flock64 before doing the syscall. We would have to copy the l_type back
in case of FGETLK but apart from that I do not see any problem with
this.
Also I've tried to run the test on purely 32bit machine (i686 openSUSE
Tumbleweed) and the problem seems to be present there as well. I can see
that it calls fcntl64() which fails with EINVAL and both l_start and
l_len are clearly garbage. So 32bit glibc with 32bit kernel seems to be
broken as well.
--
Cyril Hrubis
chrubis@suse.cz
prev parent reply other threads:[~2016-06-13 18:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-10 12:43 [LTP] [PATCH] syscalls/fcntl34: use struct flock64 on 32bit Jiri Jaburek
2016-06-10 14:04 ` Jiri Jaburek
2016-06-10 14:50 ` [LTP] [PATCH v2] syscalls/fcntl34: disable on 32bit without _FILE_OFFSET_BITS==64 Jiri Jaburek
2016-06-13 14:22 ` [LTP] [PATCH] syscalls/fcntl34: use struct flock64 on 32bit Cyril Hrubis
2016-06-13 17:58 ` Jiri Jaburek
2016-06-13 18:25 ` Cyril Hrubis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160613182513.GC354@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox