lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v4 44/45] mm: fs: initialize fsdata passed to write_begin/write_end interface
    On Fri, Jul 01, 2022 at 04:23:09PM +0200, Alexander Potapenko wrote:
    > Functions implementing the a_ops->write_end() interface accept the
    > `void *fsdata` parameter that is supposed to be initialized by the
    > corresponding a_ops->write_begin() (which accepts `void **fsdata`).
    >
    > However not all a_ops->write_begin() implementations initialize `fsdata`
    > unconditionally, so it may get passed uninitialized to a_ops->write_end(),
    > resulting in undefined behavior.

    ... wait, passing an uninitialised variable to a function *which doesn't
    actually use it* is now UB? What genius came up with that rule? What
    purpose does it serve?

    \
     
     \ /
      Last update: 2022-07-04 22:10    [W:4.004 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site