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: <3lf3ed3xn2oaenvlqjmypuewtm6gakzbecc7kgqsadggyvdtkr@uyw4boj6igqu>
Date: Thu, 18 Dec 2025 16:16:40 -0800
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Matthew Wilcox <willy@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, 
	Andrii Nakryiko <andrii@...nel.org>, Shaurya Rane <ssrane_b23@...vjti.ac.in>, 
	"Darrick J . Wong" <djwong@...nel.org>, Christoph Hellwig <hch@...radead.org>, 
	Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, 
	Meta kernel team <kernel-team@...a.com>, bpf@...r.kernel.org, linux-fsdevel@...r.kernel.org, 
	linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
	syzbot+09b7d050e4806540153d@...kaller.appspotmail.com, Christoph Hellwig <hch@....de>
Subject: Re: [PATCH bpf v2] lib/buildid: use __kernel_read() for sleepable
 context

On Thu, Dec 18, 2025 at 11:55:39PM +0000, Matthew Wilcox wrote:
> On Thu, Dec 18, 2025 at 12:55:05PM -0800, Shakeel Butt wrote:
> > +	do {
> > +		ret = __kernel_read(r->file, buf, sz, &pos);
> > +		if (ret <= 0) {
> > +			r->err = ret ?: -EIO;
> > +			return NULL;
> > +		}
> > +		buf += ret;
> > +		sz -= ret;
> > +	} while (sz > 0);
> 
> Why are you doing a loop around __kernel_read()?  eg kernel_read() does
> not do a read around __kernel_read().  The callers of kernel_read()
> don't do a loop either.  So what makes you think it needs to have a loop
> around it?

I am assuming that __kernel_read() can return less data than the
requested. Is that assumption incorrect?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ