From: Julian Sikorski <belegdol@gmail.com>
To: Steve French <smfrench@gmail.com>
Cc: Jeremy Allison <jra@samba.org>, CIFS <linux-cifs@vger.kernel.org>
Subject: Re: Permission denied when chainbuilding packages with mock
Date: Mon, 15 Nov 2021 08:10:50 +0100 [thread overview]
Message-ID: <bc98153c-3a23-a527-10f2-9ea56cb7774c@gmail.com> (raw)
In-Reply-To: <CAH2r5mvPot1Xhsg6eVPz0h11-+FEL+cBrLL9ucLSUPrf_+7ywg@mail.gmail.com>
Am 15.11.21 um 04:25 schrieb Steve French:
> The patch is in Linus's tree, so you should be able to try it with the
> weekly kernel updates for various distros which have download sites
> for more current kernel packages (Ubuntu, Fedora etc.) or build kernel
> yourself if you prefer.
>
> To get it into stable we will need to send a followup email as
> described in their process guide below:
>
> "send an email to stable@vger.kernel.org containing the subject of the
> patch, the commit ID, why you think it should be applied"
>
> but some of the distros will apply it automatically (it is still
> helpful to send the email to stable as a reminder)
>
Thank you. I found the patch in the Linus' tree yesterday and I saw you
have just sent the email to stable. So it looks like we are all set.
Thank you again for fixing this so quickly.
Best regards,
Julian
> On Sat, Nov 13, 2021 at 9:37 AM Julian Sikorski <belegdol@gmail.com> wrote:
>>
>> Am 10.11.21 um 12:23 schrieb Julian Sikorski:
>>> W dniu 10.11.2021 o 08:56, Steve French pisze:
>>>> Fix for the kernel client attached
>>>>
>>>>
>>>> On Tue, Nov 9, 2021 at 6:54 PM Jeremy Allison <jra@samba.org> wrote:
>>>>>
>>>>> On Tue, Nov 09, 2021 at 10:26:59AM +0100, Julian Sikorski wrote:
>>>>>> Am 09.11.21 um 09:10 schrieb Steve French:
>>>>>>> Yes - here is a trivial reproducer (excuse the ugly sample
>>>>>>> cut-n-paste)
>>>>>>>
>>>>>>> #include <stdio.h>
>>>>>>> #include <stdlib.h>
>>>>>>> #include <unistd.h>
>>>>>>> #include <string.h>
>>>>>>> #include <fcntl.h>
>>>>>>> #include <sys/types.h>
>>>>>>> #include <sys/stat.h>
>>>>>>>
>>>>>>> int main(int argc, char *argv[]) {
>>>>>>> char *str = "Text to be added";
>>>>>>> int fd, ret, fsyncrc, fsyncr_rc, openrc, closerc, close2rc;
>>>>>>>
>>>>>>> fd = creat("test.txt", S_IWUSR | S_IRUSR);
>>>>>>> if (fd < 0) {
>>>>>>> perror("creat()");
>>>>>>> exit(1);
>>>>>>> }
>>>>>>> ret = write(fd, str, strlen(str));
>>>>>>> if (ret < 0) {
>>>>>>> perror("write()");
>>>>>>> exit(1);
>>>>>>> }
>>>>>>> openrc = open("test.txt", O_RDONLY);
>>>>>>> if (openrc < 0) {
>>>>>>> perror("creat()");
>>>>>>> exit(1);
>>>>>>> }
>>>>>>> fsyncr_rc = fsync(openrc);
>>>>>>> if (fsyncr_rc < 0)
>>>>>>> perror("fsync()");
>>>>>>> fsyncrc = fsync(fd);
>>>>>>> closerc = close(fd);
>>>>>>> close2rc = close(openrc);
>>>>>>> printf("read fsync rc=%d, write fsync rc=%d, close rc=%d, RO close
>>>>>>> rc=%d\n", fsyncr_rc, fsyncrc, closerc, close2rc);
>>>>>>> }
>>>>>>>
>>>>>>
>>>>>> I can confirm this fails on my machine without nostrictsync:
>>>>>>
>>>>>> $ ./test
>>>>>>
>>>>>> fsync(): Permission denied
>>>>>>
>>>>>> read fsync rc=-1, write fsync rc=0, close rc=0, RO close rc=0
>>>>>>
>>>>>> and works with nostrictsync:
>>>>>>
>>>>>> $ ./test
>>>>>>
>>>>>> read fsync rc=0, write fsync rc=0, close rc=0, RO close rc=0
>>>>>>
>>>>>> So is the bug in the Linux kernel?
>>>>>
>>>>> Yes, it's in the kernel cifsfs module which is forwarding an
>>>>> SMB_FLUSH request
>>>>> (which the spec says must fail on a non-writable handle) to
>>>>> a handle opened as non-writable. Steve hopefully will fix :-).
>>>>
>>>>
>>>>
>>> Thank you. I can confirm that 5.15.1 kernel with this patch applied [1]
>>> works both with the test case you provided earlier as well as with mock
>>> chainbuilds without the need for the nostrictsync mount option. Fedora
>>> kernel-5.14.16-301.fc35.x86_64 was failing without it.
>>>
>>> Tested-by: Julian Sikorski <belegdol@gmail.com>
>>>
>>> Best regards,
>>> Julian
>>>
>>> [1] https://gitlab.com/belegdol/kernel-ark/-/commits/fedora-5.15-cifs-fix/
>>
>> Hi,
>>
>> may I ask what the usual process of getting the patch into the Linus's
>> tree and to the stable branches is? If it takes longer, I am going to go
>> back to nostrictsync for now.
>>
>> Best regards,
>> Julian
>
>
>
next prev parent reply other threads:[~2021-11-15 7:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-07 21:10 Permission denied when chainbuilding packages with mock Julian Sikorski
2021-11-07 21:44 ` Jeremy Allison
2021-11-07 21:49 ` Jeremy Allison
2021-11-07 22:03 ` Jeremy Allison
2021-11-07 22:15 ` Julian Sikorski
2021-11-07 22:47 ` Jeremy Allison
2021-11-07 22:50 ` Steve French
2021-11-07 22:55 ` Julian Sikorski
2021-11-08 1:46 ` Jeremy Allison
2021-11-07 22:51 ` Julian Sikorski
2021-11-08 1:48 ` Jeremy Allison
2021-11-08 6:59 ` Julian Sikorski
2021-11-08 15:52 ` Julian Sikorski
2021-11-08 16:46 ` Jeremy Allison
2021-11-09 8:10 ` Steve French
2021-11-09 9:26 ` Julian Sikorski
2021-11-10 0:54 ` Jeremy Allison
2021-11-10 7:56 ` Steve French
2021-11-10 11:23 ` Julian Sikorski
2021-11-13 15:37 ` Julian Sikorski
2021-11-15 3:25 ` Steve French
2021-11-15 7:10 ` Julian Sikorski [this message]
2021-11-09 19:25 ` Jeremy Allison
-- strict thread matches above, loose matches on Subject: below --
2021-11-07 15:44 Julian Sikorski
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=bc98153c-3a23-a527-10f2-9ea56cb7774c@gmail.com \
--to=belegdol@gmail.com \
--cc=jra@samba.org \
--cc=linux-cifs@vger.kernel.org \
--cc=smfrench@gmail.com \
/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