Re: [PATCH cifs segfault ]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch didn't apply (presumably due to whitespace issues) - can
you resend it (can be sent offline if you prefer) as an attachment?

I also want to run it with checkpatch/sparse etc.

Also let me know if you see any issues with the read path

On Wed, Apr 7, 2021 at 4:03 PM Aurélien Aptel <aaptel@xxxxxxxx> wrote:
>
> Seth Thielemann <sthielemann@xxxxxxxxxxxxx> writes:
> >   This definitely could be a bug with the compiler, I ran into issues adding some printk's and things just magically worked and then changed to adding asm volatile nop sentinel's to make sure I was looking at the correct sections. I still think it's a reasonable change to use the ssize_t since the rc is a ssize_t and the outbound syscall path is also a ssize_t. Best case scenario is a segfault in userspace (made things easier to track down), but will likely wind up with memory corruption otherwise.
>
> Looking at this more I found that commit 97adda8b3ab7 fixed a very
> similar issue:
>
> -       ctx->rc = (rc == 0) ? ctx->total_len : rc;
> +       ctx->rc = (rc == 0) ? (ssize_t)ctx->total_len : rc;
>
> I think the logic is that compiler sees the "then" part as unsigned and
> so casts the "else" part to unsigned as well.
>
> In any case I think the change is good. We could change rc type in the
> read path as well.
>
> Reviewed-by: Aurelien Aptel <aaptel@xxxxxxxx>
>
> Cheers,
> --
> Aurélien Aptel / SUSE Labs Samba Team
> GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
> GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
>


-- 
Thanks,

Steve




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux