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: <YIxaf3hu2mRUbBGn@pevik>
Date:   Fri, 30 Apr 2021 21:29:03 +0200
From:   Petr Vorel <petr.vorel@...il.com>
To:     Heiko Thiery <heiko.thiery@...il.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH iproute2-next v2] lib/fs: fix issue when
 {name,open}_to_handle_at() is not implemented

Hi,

> > +++ b/lib/fs.c
> > @@ -30,6 +30,27 @@
> >  /* if not already mounted cgroup2 is mounted here for iproute2's use */
> >  #define MNT_CGRP2_PATH  "/var/run/cgroup2"

> > +
> > +#ifndef defined HAVE_HANDLE_AT
> This is also wrong, it must be:
> #ifndef HAVE_HANDLE_AT

> > +struct file_handle {
> > +	unsigned handle_bytes;
> > +	int handle_type;
> > +	unsigned char f_handle[];
> > +};
> > +
> > +int name_to_handle_at(int dirfd, const char *pathname,
> > +	struct file_handle *handle, int *mount_id, int flags)
> > +{
> > +	return syscall(name_to_handle_at, 5, dirfd, pathname, handle,
> > +	               mount_id, flags);
> Also I overlooked bogus 5 parameter, why is here? Correct is:

> 	return syscall(__NR_name_to_handle_at, dfd, pathname, handle,
> 			   mount_id, flags);
Uh, one more typo on my side, sorry (dfd => dirfd):
	return syscall(__NR_name_to_handle_at, dirfd, pathname, handle,
 			   mount_id, flags);


Kind regards,
Petr

> > +}
> > +
> > +int open_by_handle_at(int mount_fd, struct file_handle *handle, int flags)
> > +{
> > +	return syscall(open_by_handle_at, 3, mount_fd, handle, flags);
> And here 3, correct version is is:
> 	return syscall(__NR_open_by_handle_at, mount_fd, handle, flags);


> + adding at the top:

> #ifndef HAVE_HANDLE_AT
> # include <sys/syscall.h>
> #endif

> Kind regards,
> Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ