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: Ib4de80cac8b36f73d8f5c6dd9824722153189285
Signed-off-by: ANANDU KRISHNAN E <quic_anane@quicinc.com>
This commit is contained in:
ANANDU KRISHNAN E 2024-08-20 17:21:05 +05:30 • committed by Anandu Krishnan E
commit de9f4fe6f8

View file

@ -5806,7 +5806,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;