[LU-6876] integer overflow in ptlrpc_lprocfs_svc_req_history_start Created: 19/Jul/15  Updated: 20/Jul/15

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: Liang Zhen (Inactive)
Resolution: Unresolved Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

It looks like ptlrpc_lprocfs_svc_req_history_start has an integer oveflow shifting an integer value more than 32 bits away:

static void *
ptlrpc_lprocfs_svc_req_history_start(struct seq_file *s, loff_t *pos)
{
...
        int                             i;
...
                if (i > cpt) /* make up the lowest position for this CPT */
                        *pos = PTLRPC_REQ_CPT2POS(svc, i);
}

This produces following warning indicating the overflow is pretty real:

lustre/ptlrpc/lproc_ptlrpc.c:852 ptlrpc_lprocfs_svc_req_history_start() warn: should '(i) << (64 - (svc)->srv_cpt_bits)' be a 64 bit type?


 Comments   
Comment by Joseph Gmitter (Inactive) [ 20/Jul/15 ]

Hi Liang,

Can you please have a look at this issue when you have time?

Thanks.
Joe

Generated at Sat Feb 10 02:04:02 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.