add forgotten ->b_data in memcpy() call in ext3/resize.c (oopsable)
sbi->s_group_desc is an array of pointers to buffer_head. memcpy() of buffer size from address of buffer_head is a bad idea - it will generate junk in any case, may oops if buffer_head is close to the end of slab page and next page is not mapped and isn't what was intended there. IOW, ->b_data is missing in that call. Fortunately, result doesn't go into the primary on-disk data structures, so only backup ones get crap written to them; that had allowed this bug to remain unnoticed until now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Adrian Bunk <bunk@stusta.de>
This commit is contained in:
@@ -997,6 +997,21 @@ static inline int pskb_trim(struct sk_buff *skb, unsigned int len)
|
||||
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
|
||||
* @skb: buffer to alter
|
||||
* @len: new length
|
||||
*
|
||||
* This is identical to pskb_trim except that the caller knows that
|
||||
* the skb is not cloned so we should never get an error due to out-
|
||||
* of-memory.
|
||||
*/
|
||||
static inline void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
|
||||
{
|
||||
int err = pskb_trim(skb, len);
|
||||
BUG_ON(err);
|
||||
}
|
||||
|
||||
/**
|
||||
* skb_orphan - orphan a buffer
|
||||
* @skb: buffer to orphan
|
||||
|
||||
Reference in New Issue
Block a user