Quellcode durchsuchen

msm: adsprpc: Avoid taking reference for group_info

Currently, the get_current_groups API accesses group info, which
increases the usage refcount. If the IOCTL using the
get_current_groups API is called many times, the usage counter
overflows. To avoid this, access group info without taking a
reference. A reference is not required as group info is not
released during the IOCTL call.

Change-Id: Iec31c90f9fd1a837fb697d5d7d1baba7d285374d
Signed-off-by: ANANDU KRISHNAN E <[email protected]>
ANANDU KRISHNAN E vor 7 Monaten
Ursprung
Commit
99c2a35413
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      dsp/adsprpc.c

+ 1 - 1
dsp/adsprpc.c

@@ -6551,7 +6551,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
 
 static int fastrpc_get_process_gids(struct gid_list *gidlist)
 {
-	struct group_info *group_info = get_current_groups();
+	struct group_info *group_info = current_cred()->group_info;
 	int i = 0, err = 0, num_gids = group_info->ngroups + 1;
 	unsigned int *gids = NULL;