[LU-11911] lov_iocontrol: BUG: unable to handle kernel NULL pointer dereference at 0000000000000100 Created: 31/Jan/19  Updated: 22/Jan/20  Resolved: 19/Apr/19

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.13.0, Lustre 2.12.4

Type: Bug Priority: Minor
Reporter: Vladimir Saveliev Assignee: Vladimir Saveliev
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

For inactive OST lov->lov_tgts[index]->ltd_exp is NULL, it should be checked before accessing lov->lov_tgts[index]->ltd_exp->exp_obd.

static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                         void *karg, void __user *uarg)
...
                imp = lov->lov_tgts[index]->ltd_exp->exp_obd->u.cli.cl_import;
                if (!lov->lov_tgts[index]->ltd_active &&
                    imp->imp_state != LUSTRE_IMP_IDLE)
                        RETURN(-ENODATA);
...

The problem can be seen with:

# REFORMAT=yes sh llmount.sh
# lctl conf_param lustre-OST0001.osc.active=0
# sh llmountcleanup.sh
# NOFORMAT=yes sh llmount.sh
# lfs df

It causes:

[ 2659.212961] BUG: unable to handle kernel NULL pointer dereference at 0000000000000100
[ 2659.216168] IP: [<ffffffffc0cbd3b8>] lov_iocontrol+0x308/0x21f0 [lov]


 Comments   
Comment by Gerrit Updater [ 31/Jan/19 ]

Vladimir Saveliev (c17830@cray.com) uploaded a new patch: https://review.whamcloud.com/34148
Subject: LU-11911 lov: fix lov_iocontrol for inactive OST case
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 56714ad1b89ff6656c4373bbd0ed70528616e941

Comment by Gerrit Updater [ 18/Feb/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34148/
Subject: LU-11911 lov: fix lov_iocontrol for inactive OST case
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 0facd12afa33c61e4123f6e793d232d8c814fbec

Comment by Peter Jones [ 19/Apr/19 ]

Landed for 2.13

Comment by Gerrit Updater [ 14/Jan/20 ]

Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/37226
Subject: LU-11911 lov: fix lov_iocontrol for inactive OST case
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: c8afeb8163f255544b6172c594558ac705c9151d

Comment by Gerrit Updater [ 22/Jan/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37226/
Subject: LU-11911 lov: fix lov_iocontrol for inactive OST case
Project: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: 4c1b35e4dbf3c79b19b5103fecc410f58234c88d

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