[LU-5918] (lcommon_misc.c:194:cl_put_grouplock()) ASSERTION( cg->cg_gid ) failed Created: 13/Nov/14  Updated: 14/Nov/14  Resolved: 13/Nov/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.1, Lustre 2.7.0
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Frank Zago (Inactive) Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates LU-5817 cl_put_grouplock()) ASSERTION( cg->cg... Resolved
Severity: 3
Rank (Obsolete): 16523

 Description   

Taking and releasing a group lock with group id 0 will crash the client. Works for any user.

/* gcc -Wall grplock.c -o grplock -Ilustre/include -Ilibcfs/include */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>

#include <lustre/lustreapi.h>

int main(void)
{
	int fd;
	const char *dname = "/mnt/lustre/testfile";
	int rc;

	fd = open(dname, O_CREAT | O_RDWR, 0600);
	printf("fd=%d\n", fd);

	rc = ioctl(fd, LL_IOC_GROUP_LOCK, 0);
	printf("rc=%d %d\n", rc, errno);

	rc = ioctl(fd, LL_IOC_GROUP_UNLOCK, 0);
	printf("rc=%d %d\n", rc, errno);

	return 0;
}

2 ways to fix, depending on whether group id 0 is special. Either reject the lock when group id is 0, or remove that assert.



 Comments   
Comment by Patrick Farrell (Inactive) [ 13/Nov/14 ]

Duplicate of https://jira.hpdd.intel.com/browse/LU-5817

Generated at Sat Feb 10 01:55:38 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.