lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3hfmYF6b5T35Xqi@ZenIV>
Date:   Sat, 19 Nov 2022 04:46:17 +0000
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Peilin Ye <yepeilin.cs@...il.com>
Cc:     Peilin Ye <peilin.ye@...edance.com>,
        Cong Wang <cong.wang@...edance.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] coredump: Use vmsplice_to_pipe() for pipes in
 dump_emit_page()

On Mon, Oct 31, 2022 at 02:03:49PM -0700, Peilin Ye wrote:

> +	n = vmsplice_to_pipe(file, &iter, 0);
> +	if (n == -EBADF)
> +		n = __kernel_write_iter(cprm->file, &iter, &pos);

Yuck.  If anything, I would rather put a flag into coredump_params
and check it instead; this check for -EBADF is both unidiomatic and
brittle.  Suppose someday somebody looks at vmsplice(2) and
decides that it would make sense to lift the "is it a pipe" check
into e.g. vmsplice_type().  There's no obvious reasons not to,
unless one happens to know that coredump relies upon that check done
in vmsplice_to_pipe().  It's asking for trouble several years down
the road.

Make it explicit and independent from details of error checking
in vmsplice(2).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ