lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 12 May 2017 10:15:45 +0200
From:   Miklos Szeredi <>
To:     Jeff Layton <>
Cc:     David Howells <>,
        viro <>,
        linux-fsdevel <>,, lkml <>
Subject: Re: [PATCH 3/9] VFS: Introduce a mount context

On Wed, May 10, 2017 at 3:48 PM, Jeff Layton <> wrote:

> I was thinking that you'd need some well-defined way to tell whether the
> string should be replaced. If the thing just hangs out across syscalls,
> then you don't know when it got put there. Is it a leftover from a
> previous syscall or did a lower layer just put it there?

Example userspace code:

    /* Throw away previous error string */
    get_detailed_error(NULL, 0);
    ret = somesyscall(...);
    if (ret == -1) {
        char errbuf[1024];

        /* Get detailed error string for somesyscall */
        get_detailed_error(errbuf, sizeof(errbuf));
        err(1, errbuf);

>> That's why I liked the static string thing.  It's just one assignment
>> and no worries about freeing.  Not sure what to do about modules,
>> though.  Can we somehow move the cost of checking the validity to the
>> place where the error is retrieved?
> Seems a little dangerous,


>  and could be limiting. Dynamically allocated
> strings seem like they could be more useful.

Overdesign always starts with that.  A static string is infinitely
more descriptive than an error num, and we've done pretty well with
the latter, so I'm not convinced that we really need a formatted

Maybe just use kstrdup_const() if CONFIG_MODULE_UNLOAD is set,
otherwise plain assignment.  Then free the string when retrieving and
on task exit.


Powered by blists - more mailing lists