Эх сурвалжийг харах

security: fix security_file_lock cmd argument

Pass posix-translated lock operations to security_file_lock
when invoked via sys_flock.

Signed-off-by: Sten Spans <Sten_Spans@genua.de>
Signed-off-by: James Morris <jmorris@namei.org>
Sten Spans 16 жил өмнө
parent
commit
713c0ecdb8
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      fs/locks.c

+ 1 - 1
fs/locks.c

@@ -1591,7 +1591,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
 	if (can_sleep)
 	if (can_sleep)
 		lock->fl_flags |= FL_SLEEP;
 		lock->fl_flags |= FL_SLEEP;
 
 
-	error = security_file_lock(filp, cmd);
+	error = security_file_lock(filp, lock->fl_type);
 	if (error)
 	if (error)
 		goto out_free;
 		goto out_free;